Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=react&page=836&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=react

Returns an array of strings in format "username" or "username/projectName"

Found 8966 results for "react"(2900ms)

turnitdownREADME.md1 match

@yawnxyz•Updated 8 months ago
141. The application uses the Hono framework to create a simple web server.
152. HTMX is used for handling AJAX requests without writing JavaScript.
163. Alpine.js provides reactivity for the clipboard functionality.
174. The Turndown library is used to convert HTML to Markdown.
18

iconExplorermain.tsx4 matches

@all•Updated 8 months ago
2 * This val creates an enhanced NPM package explorer using the npm registry API.
3 * It displays a grid of npm packages with basic information, categories, and navigation.
4 * The approach uses React for the frontend and fetch for API calls.
5 * It includes a details view for each package, a link to the npm page, and category navigation.
6 */
7
8/** @jsxImportSource https://esm.sh/react */
9import React, { useState, useEffect } from "https://esm.sh/react";
10import { createRoot } from "https://esm.sh/react-dom/client";
11
12const ITEMS_PER_PAGE = 30;

reluctantCoffeeGayalmain.tsx6 matches

@kaz•Updated 8 months ago
1/**
2 * This app implements a "Would You Rather" game with a ranking system for answers and a progress bar.
3 * It uses React for the frontend and SQLite for persistent storage on the backend.
4 * The ranking system updates based on user choices and displays in the Answers tab.
5 * A progress bar is added to show completion of 20 questions.
6 */
7/** @jsxImportSource https://esm.sh/react */
8import React, { useCallback, useEffect, useState } from "https://esm.sh/react";
9import { createRoot } from "https://esm.sh/react-dom/client";
10import {
11 BrowserRouter as Router,
15 useLocation,
16 useNavigate,
17} from "https://esm.sh/react-router-dom";
18
19// Types
240 const [username, setUsername] = useState("");
241
242 const handleLogin = useCallback(async (e: React.FormEvent) => {
243 e.preventDefault();
244 const response = await fetch("/api/login", {

fancyPlumSquirrelmain.tsx4 matches

@cofsana•Updated 8 months ago
1/**
2 * This val creates an elegant and professional web app for managing panel members for the State Street discussion.
3 * It uses React for the UI, SQLite for storing panel member information, and the Fetch API to communicate with the server.
4 * The design is clean and sophisticated, with a muted color palette and subtle animations.
5 */
6
7/** @jsxImportSource https://esm.sh/react */
8import React, { useEffect, useState } from "https://esm.sh/react";
9import { createRoot } from "https://esm.sh/react-dom/client";
10
11function App() {

TufteCSSmain.tsx3 matches

@all•Updated 8 months ago
6 */
7
8/** @jsxImportSource https://esm.sh/react */
9import React, { useState } from "https://esm.sh/react";
10import { createRoot } from "https://esm.sh/react-dom/client";
11
12function App() {

TufteCSSREADME.md1 match

@all•Updated 8 months ago
3- [x] Pill box style navigation
4- [ ] Tufte-inspired CSS
5- [ ] React
6- [ ] Lorum Ipsum Text Sample with all features
7- [ ] Admonishments

AlgoliaRecordSender2main.tsx5 matches

@willthereader•Updated 8 months ago
35 "chapterTitle": "A Side Ws",
36 "chapterNumber": 1,
37 "content": "Now, StarGazer and Newtype were saying Dragon left them everything in her will. Her properties. Her patents. Even her contracts. The PRT was scrambling to try and cut them out of everything. On one level it seemed like a huge overreaction now that they all knew Newtype and StarGazer hadn't attacked Dragon. On the other, Everett kind of understood it. Dragon was a known quantity when the PRT started handing her contracts. Newtype was…different. Plus StarGazer being an AI— \"Earth to Everett,\" Vince quipped, \"We doing okay up there buddy?\" But Dragon was an AI too. She had been the entire time and no one ever noticed. What a fucking mess. Everett was going to go bald at this rate. The world didn't need to get even more complicated. \"Hey, Tecton!\" Everett flinched, glancing at his side. \"Hm?\" Vince scowled. \"Aren't you only supposed to get like that when tinkering something?\" \"Like what?\"",
38 "startIndex": 42,
39 "endIndex": 62,
131 "chapterTitle": "A Side Ws",
132 "chapterNumber": 1,
133 "content": "\"Tagg is an asshole,\" Jouster agreed. \"That's why it was good to have Legend around. He kept Tagg from doing whatever he wanted.\" \"You think he should have stayed?\" \"That's not what I said.\" \"Maybe they should have,\" Spectre said reluctantly. \"All that stuff aside, the Triumvirate would have handled this better than the people in charge now.\" \"Pretty sure Alexandria did try to handle it,\" Vince pointed out. He glanced over and Everett couldn't help but nod in agreement. \"She didn't help the situation at all.\" And wasn't that an understatement. Speaking up, purposefully this time, Everett added, \"She showed up just in time to show everyone how badly StarGazer has been sandbagging.\" The mere mention of the name sparked a range of reactions. It might be official. If a government organization could trigger, last week easily marked the worst day of the PRT and the Protectorate's lives. And they might not survive it. That's the topic they were all dancing around. Everett saw it on their faces. The way everyone watched everyone else. Things had been dicey before everything with Dragon. It was normal in some ways.",
134 "startIndex": 210,
135 "endIndex": 230,
359 "chapterTitle": "A Side Ws",
360 "chapterNumber": 1,
361 "content": "\"There are still Londo Bell and Blue Cosmos protestors outside the PRT building,\" Miss Militia revealed. \"They're protesting each other as much as us, but that's not the story anyone is seeing.\" \"Nobody likes a bully,\" Chambers agreed. \"And we look very much like assassins at the moment.\" Banks growled. \"If the girl had bothered to stay and explain—\" \"Oh yes, stay and explain to the people who then tried to kill her best friend, destroy her living machine, and got themselves beat to a pulp by her stay-at-home tinker.\" Chambers slammed his glass on the table and glared. \"I'm quite done explaining this to toddlers. Nobody cares what she did or didn't do. She didn't attack Dragon. She fought Eidolon, the Slaughterhouse Nine, and Narwhal trying to save Dragon and that's a hell of a lot more compelling than our 'confusion' excuse.\" Chambers pinched the bridge of his nose and sighed. \"We spent twenty years putting heroes on pedestals. No one is shocked when one goes and does something that seems larger than life! We can't put the cat back in the box now just because a teenager showed us up at our own game!\" \"She's definitely a thinker,\" Reed proposed. \"On some level. Things work out for her too much. She reacts too quickly. Figures out what to do too readily. She might not even be aware of it.\"",
362 "startIndex": 609,
363 "endIndex": 629,
395 "chapterTitle": "A Side Ws",
396 "chapterNumber": 1,
397 "content": "\"Yes. Is Newtype—\" \"I'm afraid Taylor is taking the day for a personal matter. She's had an exhausting week.\" Seneca frowned. Kamil supposed Dragon invented a face for herself. Veda apparently hadn't done that yet, or didn't plan to. It was a bit unnerving on a level, looking at the logo and name on the monitor. \"Perhaps we could reschedule to a better time,\" Cliffdiver proposed. \"There is no need. I should be able to initiate any handover the PRT or Protectorate requests without bothering Taylor.\" Did she see the cautious looks spreading through the other's screens? It really could be quite unnerving. A meeting with a disembodied voice was not new, but with Dragon it had never felt that way. Objectively, it was but also wasn't the same thing. All that really changed was his understanding. The things people knew often changed their reactions, especially in light of the things they didn't know. \"Very well,\" Seneca decided before anyone could protest. \"Given the circumstances, the PRT does not believe it is in either of our interests for Celestial Being to continue executing Dragon's contracts.\" \"We agree,\" Veda answered. \"Celestial Being is prepared to waive any potential damages or interests pertaining to early cancellation or transfer of these contracts. If I may suggest, I could hand the management of these systems to the Kansas City Protectorate at this time.",
398 "startIndex": 672,
399 "endIndex": 692,
431 "chapterTitle": "A Side Ws",
432 "chapterNumber": 1,
433 "content": "Was that a threat? Going after her maker wouldn't mean anything because the creation no longer needed the creator? \"We haven't discussed any response to your existence at this time,\" Ramba answered. Not that they wouldn't. Kamil expected many meetings running late into the night in his future—much like those they'd had concerning Nilbog, the Blasphemies, and the Machine Army. That Veda was now a publicly-known AI only complicated matters further, as well as her nominal status as a hero. \"I see.\" Veda's screen watched the room with no flicker or sign of reaction. Very unnerving. \"In that case, I request the right to defend my existence at a later date should the PRT choose to debate its potential responses.\" \"Defend?\" Kamil asked. \"In what way?\" \"I am willing to answer questions as to how and why I am. By my observations, a great many problems in the world could be avoided if people simply sat down and talked to each other.\" \"We did offer to speak with you four days ago,\" Chevalier noted. \"You declined to answer specific questions.\" \"I declined to answer further questions about the incident with Dragon, given that my involvement is fairly straightforward.\" She tried to stop a program built into Dragon from killing Dragon. As she recounted, that little battle involved being attacked by other programs and systems that created an effective running battle through the Internet. A battle that did result in several deaths and a great deal of damage and panic.",
434 "startIndex": 735,
435 "endIndex": 755,

egoBoostermain.tsx3 matches

@stevekrouse•Updated 8 months ago
5 * and server-sent events for real-time streaming of compliments.
6 */
7/** @jsxImportSource https://esm.sh/react */
8import React, { useState, useEffect, useRef } from "https://esm.sh/react";
9import { createRoot } from "https://esm.sh/react-dom/client";
10import { marked } from "https://esm.sh/marked";
11

VALLErunmain.tsx31 matches

@cofsana•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2
3import valleGetValsContextWindow from "https://esm.town/v/janpaul123/valleGetValsContextWindow";
14import { Hono } from "npm:hono@3";
15import _ from "npm:lodash@4";
16import { renderToString } from "npm:react-dom/server";
17
18function parseSearchReplaceBlocks(content: string): Array<{ searchStart: string; searchEnd: string; replace: string }> {
232 executed on every HTTP request.
233 The val should return a valid HTML website, don't make JUST a backend unless explicitly asked for.
234 You can use React but you don't have to.
235 `.replace("\n", " ");
236
246 const changesMessages = function({ currentCode, userprompt }: { currentCode: string; userprompt: string }) {
247 if (!currentCode) {
248 currentCode = `/** @jsxImportSource https://esm.sh/react */
249
250import React from "npm:react";
251import { renderToString } from "npm:react-dom/server";
252
253const Example = () => (<html></html>);
293executed on every HTTP request.
294The val should return a valid HTML website, don't make JUST a backend unless explicitly asked for.
295You can use React but you don't have to.
296Take requests for changes to the supplied code.
297If the request is ambiguous, ask questions.
407 code as possible, only changing things that are strictly necessary to change.
408 \`\`\`ts
409/** @jsxImportSource https://esm.sh/react */
410
411import React from "npm:react";
412import { renderToString } from "npm:react-dom/server";
413
414const Example = () => (<html></html>);
431\`\`\`ts
432[SEARCH_START_SINGLE_LINE]
433import React from "npm:react";
434[/SEARCH_START_SINGLE_LINE]
435[SEARCH_END_SINGLE_LINE]
436[/SEARCH_END_SINGLE_LINE]
437[REPLACE]
438// This val creates a simple "Hello World" page using React.
439// We'll use React and ReactDOMServer for server-side rendering.
440// The approach is straightforward: create a React component and render it to HTML.
441
442import React from "npm:react";
443[/REPLACE]
444\`\`\`
479 code as possible, only changing things that are strictly necessary to change.
480 \`\`\`ts
481/** @jsxImportSource https://esm.sh/react */
482
483// This val creates a simple "Hello World" page using React.
484// We'll use React and ReactDOMServer for server-side rendering.
485// The approach is straightforward: create a React component and render it to HTML.
486
487import React from "npm:react";
488import { renderToString } from "npm:react-dom/server";
489
490const HelloWorld = () => (
516\`\`\`ts
517[SEARCH_START_SINGLE_LINE]
518// The approach is straightforward: create a React component and render it to HTML.
519[/SEARCH_START_SINGLE_LINE]
520[SEARCH_END_SINGLE_LINE]
521[/SEARCH_END_SINGLE_LINE]
522[REPLACE]
523// The approach is straightforward: create a React component and render it to HTML.
524// We import Tailwind CSS and apply classes to our React elements to style the page.
525[/REPLACE]
526\`\`\`
560 code as possible, only changing things that are strictly necessary to change.
561 \`\`\`ts
562/** @jsxImportSource https://esm.sh/react */
563
564// This val creates a simple Hacker News clone using React, Tailwind CSS, and blob storage.
565// We'll use React and ReactDOMServer for server-side rendering, Tailwind for styling,
566// and blob storage to persist and retrieve posts.
567
568import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
569import { blob } from "https://esm.town/v/std/blob";
570import React from "npm:react";
571import { renderToString } from "npm:react-dom/server";
572
573const { name } = extractValInfo(import.meta.url);
611 const initialPosts: Post[] = [
612 { id: 1, title: "Deno 1.0 Released", url: "https://deno.land/", score: 100 },
613 { id: 2, title: "React 18 Announced", url: "https://reactjs.org/", score: 80 },
614 { id: 3, title: "Tailwind CSS v3.0", url: "https://tailwindcss.com/", score: 60 },
615 ];
764 role: "user",
765 content:
766 `For all requests below, use React and Tailwind for the frontend, and blob storage for the backend, unless otherwise specified.`,
767 },
768 {

linkInBioTemplatemain.tsx2 matches

@n8lenahan•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {

vt-discord4 file matches

@boucher•Updated 3 days ago
Starter template with client-side React & Hono server

diceRollerUI1 file match

@dcm31•Updated 3 days ago
A web-based dice roller using React on Val Town
effector
Write business logic with ease Meet the new standard for modern TypeScript development. Type-safe, reactive, framework-agnostic library to manage your business logic.
officialrajdeepsingh
Follow me if you learn more about JavaScript | TypeScript | React.js | Next.js | Linux | NixOS | Frontend Developer | https://linktr.ee/officialrajdeepsingh