❌

Reading view

I built Detent, an open-source React wheel picker with spring physics, morphing text, and rolling numbers

I’ve just released Detent, a React wheel picker that grew into a much bigger exploration of interaction details.

The wheel has its own momentum and spring physics. I spent a lot of time tuning mouse wheel input alongside trackpads, including the awkward cases where a physical scroll wheel keeps spinning after you let go.

It also includes two separate components:

  • Detent Text: matching letters stay while the changed parts roll.
  • Detent Number: locale-aware formatting with digits that roll through intermediate values.

The examples range from practical time and date pickers to an arc menu, a zoom ring, and some more experimental visual treatments.

There’s a headless hook, separate imports for text and numbers, keyboard support, reduced motion, and no additional runtime dependencies beyond React and React DOM.

Demos and playground: https://detent.hayder.sh
Intro: https://x.com/kghayder/status/2118373654010466733?a=PzCQRSXhM5m8KUTdHk8&s=20

I’d especially appreciate feedback on how the wheel feels with your mouse or trackpad, and whether the API makes sense for something you’d actually build.

submitted by /u/hayderkg to r/reactjs
[link] [comments]
  •  

Jonas Schmedtmann vs Maximilian Schwarzmüller for react?

I've taken Jonas Schmedtmann's HTML + CSS and JavaScript course and am soon going to start learning react and I am wondering if I should just stick with Jonas or try Maximilian. If you've taken any of these courses or both I'd really love to hear your opinion on it and how they differ and who they are for!

submitted by /u/2TB_NVME to r/reactjs
[link] [comments]
  •  

I made a fintech hero where the balance rolls like an odometer when a payment lands (React + Framer Motion)

How it works, since people usually ask:

  • The odometer: each digit is its own reel of 0–9 stacked vertically, and it slides to y = −digit × 10% with a 0.9s ease-out. Commas and the $ sign never move, only digits roll. Screen readers get the plain value through an sr-only span.
  • The balance and the feed share one tick (every 3.4s): a new transaction slides in at the top of the feed and the balance is recomputed from the ledger, so the two can never disagree.
  • The payout is a tiny state machine: Sent → Converted → Arrived, 1.1s per step, then it holds 2.6s and starts over.
  • On wide screens it's a staggered bento that runs off the fold, on tablets 2×2, on phones a swipeable row. With reduced motion everything holds still.

Free to copy if it's useful: https://ui.deliverwebsite.com/components/hero-sections/fintech-hero-section-with-gradient-cards/

Feedback on the motion very welcome. I'm trying to make every animation say something about the product

submitted by /u/poojadeliverwebsite to r/reactjs
[link] [comments]
  •  

I made a portfolio where you type your startup idea and it builds it as you scroll

I'm a product engineer who builds MVPs for founders. A normal portfolio says "I build apps, websites, dashboards and AI features." I wanted mine to show it instead.

How it works:
- You type an idea in the hero ("a dog-walking app")
- It's handwritten onto a sticky note that unfolds into a 3D board
- As you scroll, the board builds the mobile app, the website, the admin dashboard, the AI features and the automations
- It ends on "Shipped." with your idea's name, and the contact section says "Let's ship Dog-Walking App."

Other bits:
- A "What goes in v1?" sorter: drag features into v1, later or cut, and a split-flap board shows the weeks to launch
- Testimonials shown as the messages they arrived in
- A live GitHub activity map
- A pixel pet that wanders around

Stack: Next.js, three.js, GSAP, Lenis, Tailwind. The 3D boards are drawn in canvas, not models.

Link in the comments. Roast it. What would you type in first?

submitted by /u/Upset_World953 to r/reactjs
[link] [comments]
  •  

Where do you store state in a multi-step React form: URL params, context, Zustand, or the form library?

Building a 5-step wizard with React Hook Form and Zod. I keep the step in the URL and drafts in a small store. What has held up in production for you, and how do you handle early-step changes that invalidate later steps?

submitted by /u/Big_Muffin8280 to r/reactjs
[link] [comments]
  •  

CupertinoUI: macOS-style components you install with the shadcn CLI

I built CupertinoUI, a macOS-style component registry for React and shadcn/ui.

It includes controls, menus, dialogs and windows, with CSS-variable theming and light/dark appearance. Components are copied into your project through the shadcn CLI so you can edit the source.

The core components are free under MIT. There are also paid Pro components and complete app-style blocks.

Try the interactive desktop: https://www.cupertino-ui.com/demo
Browse the components: https://www.cupertino-ui.com/docs/components

submitted by /u/Dependent_Common2109 to r/reactjs
[link] [comments]
  •  

How do you keep forms sane in large React apps?

Forms are still where most of my React bugs live: validation that disagrees with the backend, async defaults, conditional fields.

My current stack is React Hook Form with Zod schemas shared with the NestJS backend. It mostly works, but complex multi-step forms still get messy.

What's your setup? Anyone moved to server actions for most forms and been happy with it?

submitted by /u/No-Task-4473 to r/reactjs
[link] [comments]
  •  

I made a React component that opens and edits DOCX / XLSX / PPTX in the browser. 300k-row sheet in ~300ms, no server, MIT

Repo: https://github.com/p10node/office-engine

Demo (drag your own file in): https://p10node.github.io/office-engine/demo/

Why: I needed "customer uploads an XLSX, fix a few cells, save it back" inside a React app. OnlyOffice / Collabora mean running a document server in Docker and an iframe talking to it, and a big sheet still sits on a spinner while the server converts it. docx-preview / SheetJS + a grid are view-only or block the main thread on a 20 MB file. Nothing in between, so I built it.

Usage:

import { DocViewer } from '@p10node/office-engine' <DocViewer src={file} style={{ height: 600 }} /> <DocViewer src="https://cdn.example.com/report.xlsx" /> <DocViewer src={file} editable onSave={(blob, name) => upload(blob, name)} /> 

src takes File / Blob / ArrayBuffer / URL. CSS is auto-injected, the container just needs a height. There's also a useDocument hook if you want to render your own UI, a vanilla mount(), an <office-viewer> web component, and a single script build.

What makes it not choke on big files:

  • ZIP read lazily, HTTP Range requests from a URL, so first rows show before the file finishes downloading
  • Streaming XML parser in a Web Worker, main thread only gets rows / paragraphs / slides as they arrive
  • Only visible pages, cells, slides are in the DOM
  • Save patches the original file instead of re-exporting it, so anything the engine doesn't understand is kept byte for byte

Bundle (gzip): main ~93 KB, worker ~155 KB (loads off the main thread), collab +17 KB optional. The standalone script with React bundled is ~307 KB.

Editing: DOCX text / styles / lists / images / tables, XLSX cells / formulas (134 functions) / formats / rows / columns / sheets, PPTX text / shapes / images / slides. Google Docs style toolbar. Optional real-time collab with cursors; that's the only part needing a backend (a small WebSocket hub, Bun script included).

Not there yet: XLSX charts / pivots / conditional formatting editing, DOCX headers / footers read-only, no PPTX animations. It needs the DOM and a Worker, so in Next.js use a client component / dynamic import with ssr: false.

Fair warning: it's a few days old and a lot of it was written with Claude Code, with me doing architecture, review and the bug hunting on real files. If you throw a file at it and it breaks, open an issue with the file, that's the fastest way it gets fixed.

submitted by /u/pierreneter to r/reactjs
[link] [comments]
  •  

Do you find CSR (Client Side Rendering) SSR (Server Side Rendering or CSG (Client Side Generation) of pages expensive in 2026?

One of the issues I am facing currently, we have a website with over 10,000 pages and since we built it with CSR (Client Side Rendering) and CSG (Client Side Generation) it is relatively very expensive with the CDN cost. Purely did this because of the SEO and caching issue.

Do you have a solution for this or is this still how everyone doing this bearing the cost of scale as we are?
I find this an expensive deployment for us. I appreciate your thoughts.

submitted by /u/JuniorIndication3295 to r/reactjs
[link] [comments]
  •  

[Open Source] Building a React component system that animates "on twos" (12fps stepped hooks, ResizeObserver SVG polygon frames, and a static design-grammar linter)

I’ve been exploring what happens when a React component library drops floating cards, soft shadows, and 60fps spring physics in favor of production mechanics from sequential print layout and traditional cel animation.

The result is FRAME/12 (GitHub (MIT) · Live Motion Studio), a zero-dependency copy-in React + TypeScript registry (shadcn-compatible) and AI agent skill.

Here are the four most interesting React & DOM problems we had to solve while building it:

1. Quantizing an easing curve "on twos" (useOnTwos)

In hand-drawn animation, most movement is shot "on twos"—each drawing is held for two frames at 24fps (83.33ms per pose, 12 poses per second). Simply applying CSS steps(4) with linear timing feels robotic because every jump covers the exact same distance.

Instead, useOnTwos samples a cubic ease-out spacing chart inside requestAnimationFrame, bucketed into 83.33ms (1000 / 12) intervals. You get a wide initial jump and tight settling poses, while still holding each discrete pose cleanly:

export const FRAME_MS = 1000 / 12; // 83.333ms ("on twos")

const easeOut = (t: number) => 1 - Math.pow(1 - t, 3);

// Inside requestAnimationFrame loop:

const elapsed = now - t0;

const k = Math.min(frames, Math.floor(elapsed / FRAME_MS) + 1);

setProgress(easeOut(k / frames));

We also strict-split what gets stepped:

  • Discrete state changes (SegmentedControl cell jumps, Metric count-ups, ToneAreaChart clip-path wipes, Badge 2-frame SVG impact bursts) run on twos (12fps).
  • Direct manipulation (hover states, scrolling, typing, chart pointer/keyboard crosshairs) stays at 0ms immediate latency.
  • Initial mount (useChanged): A custom hook tracks whether a key has changed after first mount so entrance animations never fire on initial page load.
  • Accessibility: prefers-reduced-motion: reduce automatically switches all hooks and CSS classes to 'cut' (0ms hard cuts).

2. Non-warping diagonal panel frames with ResizeObserver

In PanelPair, two vertically paired KPI panels are separated by a 12px gutter with a 16px diagonal slant (slant-bottom over slant-top). If you use CSS clip-path: polygon(...), CSS borders get clipped off along the diagonal edge; if you scale a fixed-viewBox <svg> with preserveAspectRatio="none", the 2.5px ink stroke stretches unevenly.

Our Panel component attaches a ResizeObserver to measure the panel's exact width × height in pixels and computes mitered <polygon> points inset by half the stroke width (1.25px), keeping the 2.5px ink border uniform at any aspect ratio.

3. Zero-dependency SVG screentone charts with built-in keyboard & table fallbacks

Instead of pulling in recharts or d3 and rendering translucent gradient fills, ToneAreaChart renders a <pattern id="..." patternTransform="rotate(45)"> of halftone dots (var(--f-tone)), an inked 2.5px polyline, a marker-yellow peak dot, and a speech-balloon SVG annotation (Balloon) that flips direction near the right edge of the viewBox.

Every chart is focusable (tabIndex={0}), supports ArrowLeft / ArrowRight / Home / End / Escape to inspect data points via an aria-live readout, and includes a collapsible <details className="tbl"> semantic HTML <table>.

4. Linting UI structure so AI coding agents don't drift

When AI agents generate React UI, they quickly drift toward arbitrary Tailwind gaps (gap-4, gap-6), hex literals, or unstyled primitives. Because FRAME/12's rules are structural, we wrote scripts/check-frame12.mjs (plus skills/frame12/SKILL.md and an ESLint flat-config plugin) to enforce:

  1. color-literal: Zero hex/RGB/HSL literals outside frame12.css
  2. illegal-gutter: Only 12px (pair), 20px (scene), and 32px (change) gutters allowed
  3. marker-misuse: Marker yellow (--f-marker, #ffd60a) only allowed as a background paired with --f-marker-ink (#121212) text
  4. cut-order: Every <Panel cut="C-01"> must increment sequentially (C-01, C-02, C-03…) in DOM and reading order
  5. raw-shadcn-import: Forbids raw u/radix-ui/* or external chart/animation libraries where a u/frame12/registry component or adapter exists

You can install the full kit or individual components via the shadcn CLI:

npx shadcn@latest add https://frame12.dev/r/frame12.json

Would love feedback from folks here on the hook ergonomics and the static UI grammar linter!

submitted by /u/iamlonewolf_ to r/reactjs
[link] [comments]
  •  

Built a lightweight, client-side developer utility suite using React 19, Vite, and Tailwind CSS

Hi everyone,

As a side project to explore React 19 and client-side processing workflows, I put together a small developer utility suite calledFixCode.

Technical Details:

  • Frontend: React 19, Vite, Tailwind CSS
  • State & Security: All transformations (JWT decoding, chmod calculations, Docker YAML generation) run entirely on the client side using pure JavaScript algorithms. No data is sent to external servers.
  • Routing & SEO: Dynamic metadata handled via react-helmet-async for indexation across single-page routes.

Just wanted to share the approach for fast, client-side utility tools with zero server overhead

submitted by /u/Fine_Culture4472 to r/reactjs
[link] [comments]
  •  

React developers, what are some real-world performance bottlenecks you've encountered, and how did you debug them?

Hey everyone!

A friend and I are planning a React learning session this weekend. Instead of just going through documentation and building another basic project, we want to explore some of the interesting problems React developers encounter in real-world applications.

I'd love to hear from experienced React developers, senior frontend engineers, and anyone who has worked on performance-critical React applications.

I'm particularly interested in problems that aren't immediately obvious and require some actual investigation to solve.

For example:

- Unnecessary re-renders: How do you identify which components are re-rendering unnecessarily, and how do you determine the actual root cause?

- State management issues: Have you encountered performance problems caused by poorly placed state, Context API, or excessive state updates? How did you restructure things?

- Expensive rendering: What happens when a component renders a large list, processes complex data, or performs expensive calculations? How do you identify whether the bottleneck is React, JavaScript, or the browser?

- Memory leaks and stale closures: What are some subtle bugs involving "useEffect", event listeners, subscriptions, or closures that you've encountered in production?

- Memoization gone wrong: Have you ever made an application slower by overusing "useMemo", "useCallback", or "React.memo"? How did you figure that out?

- Network and rendering bottlenecks: How do you investigate slow API-driven interfaces, waterfalls, unnecessary requests, or components that feel sluggish despite fast API responses?

- Large-scale component architecture: Have you encountered performance problems that required changing component boundaries or the way an application was structured rather than simply optimizing individual components?

I'm not just looking for a list of best practices. I'd really appreciate hearing about the actual debugging process.

For instance:

  1. What symptoms or user reports made you suspect a performance problem?

  2. Which tools did you use to investigate it?

  3. How did you identify the actual root cause?

  4. What changes did you make to fix it?

  5. How did you measure the improvement and verify that the fix worked?

If you have a small code example, a production incident, a particularly tricky bug, or even a mistake you made while trying to optimize something, I'd love to hear about it.

Also, if there are any React performance problems that you think every developer should learn to diagnose early in their career, please share those.

We're hoping to use your experiences as a starting point for practical experiments rather than just memorizing optimization techniques.

Thanks!

submitted by /u/Mysterious_Food_5124 to r/reactjs
[link] [comments]
  •  

react-context-typesafe: missing context providers as lint errors instead of runtime crashes

You know the pattern: createContext<User | null>(null), then a useAuth() hook that throws "useAuth must be used within AuthProvider", and every consumer either trusts that or null-checks. A missing provider is a runtime error you find when that screen renders, or when a test does.

I wanted it to be a lint error instead, so I built an oxlint plugin that checks it across the whole program:

``` const AuthContext = createContext<User | null>(null);

function Children() { const user = use(AuthContext); return <p>{user?.name}</p>; }

root.render( <AuthContext value={user}> <Children /> {/* ok */} </AuthContext>, );

root.render(<Children />); // ^ react-context(require-provider): <Children> needs AuthContext // (use(AuthContext) at Children.tsx:4), but no <AuthContext> provider is above it. ```

Children needs no annotations. Requirements are inferred from use, useContext, <Ctx.Consumer> and static contextType. They're passed up through components, custom hooks, HOCs, memo/forwardRef/lazy, children and render props, and React Router outlets, until a provider meets them or a root gets them. Roots are createRoot().render, testing-library's render, Storybook stories, and framework pages you list in a setting. Wrapper components like <AuthProvider>{children}</AuthProvider> count as providers because they render children inside one.

There's also a tiny optional runtime: createRequiredContext<User>() gives you a context where use() is typed User instead of User | null, because the lint rule now guarantees the provider. It returns a plain React context, so nothing else changes.

Why not types? That was the first thing I tried. JSX erases element types: <Children /> and <span /> are both just JSX.Element, so a requirement can't travel from a child up to its provider through the type system. Forking @types/react doesn't help, and TypeScript 7.1's new APIs didn't open a way either. The only version that type-checked used generator components and h() calls instead of JSX, which nobody wants.

As for the speed, it's a whole program so it costs more than a normal lint rule. On excalidraw (709 files), oxlint alone takes 0.07 s, oxlint with the rule 0.8 s, and the standalone CLI 0.5 s. In the editor (oxlint's language server), a keystroke costs about 50 ms because only the edited file is re-parsed. The README suggests a separate oxlint config so that your everyday oxlint stays as fast as before, while the editor uses the config with the rule and CI runs react-context-check as its own step. Not on oxlint? The CLI runs the same check without it.

As for limitations, it's syntactic and not type-aware. For code it can't see (node_modules, dynamic tags, useContext(cond ? A : B)) it makes certain assumptions. A provider hidden in such code shows up as a false positive, which you silence with @context-provided. A null-default context that your code actually treats as optional needs a // @context-optional comment. On excalidraw, that one comment was the difference between 337 reports and zero.

It's not on npm yet:

npm i -D github:TmLev/react-context-typesafe oxlint

Repo: https://github.com/TmLev/react-context-typesafe

Reports of wrong diagnostics are the most useful feedback right now. A few lines of code that reproduce one are enough.

submitted by /u/TmLev to r/reactjs
[link] [comments]
  •  

Built a multi-pane financial charting terminal with React 19, TypeScript, and HTML5 Canvas 2D primitives (Open-Source)

Hey r/reactjs,

I recently open-sourced OrderCraft, a local-first multi-chart technical analysis terminal built with React 19, TypeScript, Vite, and lightweight-charts (backed by a local Go WebSocket server).

Interesting frontend challenges we solved:

  • Custom HTML5 Canvas 2D Drawing Engine (ISeriesPrimitive): lightweight-charts renders candlesticks quickly on Canvas, but doesn't ship with interactive drawing tools. We built a custom Canvas 2D primitive engine from scratch in TypeScript supporting interactive Trendlines, Fibonacci Retracements, Parallel Channels, Rectangles, and Long/Short Position calculators with drag handles and OHLC magnet snapping.
  • High-Frequency WebSocket State Without Re-Render Storms: Streaming live ticks across 4 synchronized split-screen chart panes (1x1, 2V, 2H, 3, 4 layouts) with synced crosshairs, symbols, and timeframes without triggering full React component tree re-renders on every tick.
  • Single-Binary Embedding + PWA Standalone Mode: The Vite production bundle is embedded into a single ~14MB Go executable and includes a Web App Manifest so launching with --app-mode opens a native frameless desktop window.

GitHub Repo: https://github.com/ordercraft-hq/terminal

Would love any feedback from fellow React/TypeScript devs on the frontend architecture and Canvas primitive implementation!

submitted by /u/Big-Presence-2561 to r/reactjs
[link] [comments]
  •  

Built my second project after learning React for 2–3 months – Feedback appreciated!

Hey everyone!

I've been learning React for the past 2–3 months, and I've recently built my second project, GameVault, using my own knowledge and what I've learned so far.

GameVault is a gaming e-commerce website where users can explore games and browse a gaming store.

Project Links:

I'm still learning and improving my development skills, so I'd really appreciate honest feedback from experienced developers and the community.

I'd love to know:

  1. What do you think about the overall UI/UX?
  2. Is my React code structure and component organization good?
  3. What should I improve in terms of performance and best practices?
  4. Does this project demonstrate enough skills for a React/frontend developer internship?

I'm open to constructive criticism and suggestions. I want to learn from my mistakes and become a better developer.

Thanks for taking the time to check out my project!

submitted by /u/TurbulentTicket339 to r/reactjs
[link] [comments]
  •  
❌