Search

Results include substring matches and semantically similar vals. Learn more
ejfox avatar
inventory
@ejfox
* This val creates an interactive tech stack wizard that generates a video game-style inventory screen. * It uses React for the UI, leverages emoji and Unicode symbols for a visually rich experience, and * incorporates Tailwind CSS for elegant, grayscale styling. * The wizard allows users to select tools, libraries, and APIs, then displays them in a shareable format.
HTTP
* This val creates an interactive tech stack wizard that generates a video game-style inventory screen.
* It uses React for the UI, leverages emoji and Unicode symbols for a visually rich experience, and
* incorporates Tailwind CSS for elegant, grayscale styling.
* The wizard allows users to select tools, libraries, and APIs, then displays them in a shareable format.
/** @jsxImportSource https://esm.sh/react */
import React, { useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
// Define tech options with emojis or Unicode symbols as icons
const techOptions = [
{ name: "React", icon: "⚛️" },
{ name: "Vue", icon: "🖖" },
{ name: "Flutter", icon: "🦋" },
{ name: "React Native", icon: "📱" },
{ name: "Electron", icon: "🔬" },
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
jonbo avatar
reactSSRExample
@jonbo
An interactive, runnable TypeScript val by jonbo
Express
export const reactSSRExample = async (req: express.Request, res: express.Response) => {
// Import React
const React = await import("npm:react");
const ReactDOMServer = await import("npm:react-dom/server");
return React.createElement("span", null, "southbound in 5 minutes");
return React.createElement(
return React.createElement(BikeLocation, {
return React.createElement("ul", null, bikeEls);
const html = ReactDOMServer.renderToString(
React.createElement(
yawnxyz avatar
WobbleShapes
@yawnxyz
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useRef, useEffect } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
function PotteryPlate({ radius, color, wobbliness, wobbleFrequency, wobbleIrregularity, rotation }) {
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
async function server(request: Request): Promise<Response> {
xpapla avatar
windowsXpSimulator
@xpapla
// This approach creates a Windows 98-style simulator using React for the UI and CSS for styling.
HTTP
// This approach creates a Windows 98-style simulator using React for the UI and CSS for styling.
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useRef, useEffect } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
const rect = windowRef.current.getBoundingClientRect();
x: e.clientX - rect.left,
y: e.clientY - rect.top
x: e.clientX - dragOffset.x,
y: e.clientY - dragOffset.y
function client() {
yawnxyz avatar
htmxGenFormsExample
@yawnxyz
An interactive, runnable TypeScript val by yawnxyz
HTTP (deprecated)
/** @jsx jsx **/
import { renderToString } from "npm:react-dom/server";
import { jsx } from "https://deno.land/x/hono@v3.11.7/middleware.ts";
import { Hono } from "https://deno.land/x/hono@v3.11.7/mod.ts";
yawnxyz avatar
redditImageGrab
@yawnxyz
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import React, { useEffect, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(req: Request): Promise<Response> {
namwen avatar
TravelApp
@namwen
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { ExternalLinkIcon } from "https://esm.sh/@chakra-ui/icons";
VStack,
} from "https://esm.sh/@chakra-ui/react";
import * as React from "https://esm.sh/react";
// import React, { useEffect, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import itinerary from "https://esm.town/v/namwen/veryTealAardvark";
import { renderToString } from "npm:react-dom/server";
function printItinerary() {
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
async function server(request: Request) {
roramigator avatar
pr0n
@roramigator
@jsxImportSource https://esm.sh/react
HTTP
/** @jsxImportSource https://esm.sh/react */
import React, { useEffect, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(req: Request): Promise<Response> {
stevekrouse avatar
zod_demo_frontend
@stevekrouse
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react */
import React, { useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import type { User } from "./zod_demo_shared";
const [serverResponse, setServerResponse] = useState<string>("");
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const { name, value } = e.target;
setUser(prev => ({ ...prev, [name]: name === "age" ? parseInt(value) || 0 : value }));
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
yawnxyz avatar
ragwithclaude_ui
@yawnxyz
Wanted to build a UI for Simon's thing but he locked it lol
HTTP (deprecated)
// rag with claude ui
// https://simonw-ragwithclaude.web.val.run/?question=what%20is%20shot%20scraper
import { renderToString } from "npm:react-dom/server";
import { jsx } from "https://deno.land/x/hono@v3.11.7/middleware.ts";
import { Hono } from "https://deno.land/x/hono@v3.11.7/mod.ts";
reosablo avatar
sampleVanIsland
@reosablo
simple App component made with VanJS This script is not for execution but for import for SSR + hydration. See https://www.val.town/v/reosablo/sampleVanSSR
Script
import type { VanObj } from "npm:mini-van-plate@0.5.6/shared";
const fromClient = typeof document !== "undefined";
/** root DOM id of App component for hydration */
// disable the button if we're not in the browser
const disabled = van.derive(() => !fromClient || generating.val);
const uuidsDom = ul();
form(
{ onsubmit: fromClient && handleSubmit },
label(
// hydrate App component if we're in the browser
// usually, this is done in `client.ts` script
if (fromClient) {
const { default: van } = await import("https://esm.sh/v135/vanjs-core@1.5.0");
all avatar
promptGen
@all
* This val creates a website that generates optimized prompts for Val Town based on user input. * It uses the OpenAI API to generate prompts and incorporates a loading animation. * The generated prompt is tailored to Val Town's specific features and best practices.
HTTP
* The generated prompt is tailored to Val Town's specific features and best practices.
/** @jsxImportSource https://esm.sh/react */
import React, { useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
const valTownFeatures = [
"OpenAI integration",
"React support",
"TypeScript support",
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") {
client();
async function server(request: Request): Promise<Response> {
stevekrouse avatar
server
@stevekrouse
tldraw example with builder, for consistent React versions.
HTTP (deprecated)
tldraw example with builder, for consistent React versions.
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useEffect } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
import { Tldraw } from "https://esm.sh/@tldraw/tldraw@2.3.0";
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export const server = (req) =>
iamseeley avatar
templateModalTest
@iamseeley
An interactive, runnable TypeScript val by iamseeley
HTTP (deprecated)
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.
</svg>
<div class="font-semibold group-hover:text-black">ReactJS</div>
</button>
<button class="group bg-gray-50 border-gray-300 flex items-center gap-2 overflow-hidden rounded border p-3 text-l
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.
</svg>
<div class="font-semibold group-hover:text-black">Preact</div>
</button>
<button class="group bg-gray-50 border-gray-300 flex items-center gap-2 overflow-hidden rounded border p-3 text-l
brianleroux avatar
ssr_a_web_component_for_fun
@brianleroux
demonstrates server-side rendering a web component
HTTP (deprecated)
demonstrates server-side rendering a web component