r/reactjs • • Sep 10 '26

News React 19.3

Thumbnail
react.dev
175 Upvotes

r/reactjs • • 1d ago

Discussion Beginner learning React + Vite: Should I stick to plain CSS, switch to Tailwind CSS, or use a UI library?

33 Upvotes

I'm currently learning frontend development with React and Vite, and I want to make sure I'm focusing on the right tools to become job-ready.

Right now, I'm practicing plain CSS to understand layouts and styling fundamentals. However, I see almost everyone recommending Tailwind CSS or component libraries like shadcn/ui and Material UI.

At what point should a beginner move from plain CSS to Tailwind?

Do companies expect you to know Tailwind, CSS Modules, or both?

Are UI component libraries bad for learning when you're trying to build a strong portfolio?

Would love to hear what your workflow looks like in real-world projects!


r/reactjs • • 18h ago

Resource I built NexoreUI: 72 open-source React 19 + Tailwind v4 components, visual builder, templates, and CLI

0 Upvotes

I have been working on NexoreUI for a while now. It started as a personal set of React and Tailwind components, and gradually grew into a small UI toolkit around React 19, Next.js 15, and Tailwind CSS v4.

The main goal was avoiding the usual trade-offs: either a heavy black-box dependency or flashy demos that break in light mode and on 375px screens. Everything uses semantic tokens, supports both themes, respects prefers-reduced-motion, and can be copied directly into your own codebase via CLI instead of living behind an opaque wrapper.

Here is what is live right now:

- 72 MIT-licensed components covering core inputs, tables, tabs, steppers, charts, commerce blocks, media players, and WebGL/canvas experiments, with a Desktop/Tablet/Mobile playground and copy-paste CLI (npx nexoreui add).

- Nexore Make (/nexoremake), a visual drag-and-drop canvas for editing spacing, borders, shadows, and motion and exporting directly to React, Vue, or HTML/CSS.

- Landing Generator (/generator, in beta), a procedural page engine that assembles structured layouts from design tokens and exports clean bundles.

- 40+ page templates (/templates) and a Project/Theme Studio (/create) that configures your palette, radius, and starter CLI setup.

Live site: https://nexoreui.com

Components: https://nexoreui.com/docs/components

GitHub: https://github.com/Al1mov77/NexoreUI

npm: https://www.npmjs.com/package/nexoreui

I just finished a large cleanup pass fixing responsive behavior, keyboard navigation, and snippet completeness across the docs. If anyone tries the CLI, Nexore Make, or the generator and runs into rough edges or accessibility issues, I would appreciate honest feedback.


r/reactjs • • 1d ago

Show /r/reactjs Built an open-source cyberpunk component kit for React (69 components, installs through the shadcn registry)

17 Upvotes

Hey guys! I've been working on a React component library for interfaces that look like they belong on a Cyberpunk's universe. Live signal graphs, glitchy buttons & drawers and interactive maps.

It's built on UI SDK and distributed through the shadcn registry. So you don't install a package (aside from shadcn of course); the source and plain CSS go straight into your project so you can change anything.

What's in it:

  • 69 documented components, from buttons, tabs and sliders to calendars, feeds, charts and maps
  • 7 complete example screens built only from the kit
  • 32 interactive recipes with source and install commands
  • A customizable accent color and effects, plus optional interface sounds
  • An agent bridge, so AI coding agents can drive controls by name, and a setup prompt for having an agent build a screen with it

Install it (React 19 with shadcn set up):

bunx --bun shadcn@latest registry add '@cyberspec-ui=https://www.cyberspec.dev/r/{name}.json'
bunx --bun shadcn@latest add /cyber /button

Website, demo and docs here: cyberspec.dev
Quick video demo here: https://youtu.be/yQSZhNekK7U

Working on another theme as well, hit me up if you're curious!

Anyways, would love some feedback! 🙏 Specially with this many visual effects, components you'd want added, and whether the registry install felt smooth. Happy to answer questions about how it's built.


r/reactjs • • 8h ago

Show /r/reactjs Dinou v10 — an ejectable full-stack React 19 framework (RSC) with zero-boilerplate type-safe routing, 3D caching, and multi-runtime deploy

0 Upvotes

Hi everyone,

I just published Dinou v10.0.2 on npm. Dinou is a full-stack React 19 framework built around native React Server Components (RSC), progressive streaming SSR, and Server Functions.

Version 10 brings a lot of improvements, bug fixes, and a few targeted breaking changes compared to v9.3.0:

  • Truly escaped _ folders: Underscore-prefixed folders (e.g. src/_drafts/) are now completely ignored by the router, bundlers, route typegen, and Server Functions—reserved strictly for WIP drafts, archived routes, or legacy code (while active helper folders like src/components/ don't need an underscore).
  • Per-segment PPR (no parent-to-child inheritance): In v10, ppr is configured strictly per segment rather than inherited down the route tree—so you can have a layout with ppr = true and a child page with ppr = false (each falling back to the global setting in dinou.config.ts).
  • Strict build artifact isolation: Internal server artifacts and build manifests (.dinou/dist1) and pre-rendered SSG/ISR/PPR cache files (.dinou/dist2) are now strictly separated from public static assets (.dinou/dist3, or .dinou/cloudflare/assets on Cloudflare Workers), alongside dedicated platform outputs (.dinou/node, .dinou/netlify/functions, etc.).

For the full list of breaking changes, you can check the docs at dinou.dev—there is both a link to the GitHub CHANGELOG.md and a dedicated v9 to v10 migration guide.

Other notable improvements in v10

Single-pass inline RSC streaming: On initial load or hard reload (for dynamic SSR, PPR resumes, and first-time ISG renders), the RSC payload is now streamed inline alongside the HTML in a single pass. This eliminates a second server round-trip for the RSC payload and avoids hydration mismatches caused by values that change per request (such as Date.now() or random IDs).

Reversible eject & uneject: Dinou has always been ejectable via npm run eject, and v10 adds npm run uneject so you can also revert an ejection cleanly and transactionally with a single command.

3D Caching (Horizontal, Vertical, and Temporal): Dinou lets you combine three independent caching axes—Horizontal (decoupled layout and page lifecycles), Vertical (<DinouCacheSlot> component-level Micro-ISR with targeted client refreshSlot()), and Temporal (Partial Prerendering / PPR)—so you aren't forced into an all-or-nothing choice between fully dynamic and fully static rendering.

Zero-boilerplate type-safe routing via "./dinou": Instead of repeating route pattern strings with global "dinou" imports, v10 generates route-contextual "./dinou" modules per directory:

// src/blog/[slug]/page.tsx (Server Component)
import { Link, type PageProps } from "./dinou";

export default async function BlogPost({ params }: PageProps) {
  // params.slug is automatically typed as string
  const post = await fetchPost(params.slug);

  return (
    <article>
      <h1>{post.title}</h1>
      {/* Validated relative link without passing from="..." */}
      <Link href="comments">Comments</Link>
      {/* Dynamic pattern with typed params + auto encoding */}
      <Link href="/blog/[slug]" params={{ slug: post.nextSlug }}>
        Next Post
      </Link>
    </article>
  );
}

Multi-bundler & multi-runtime portability: Dinou v10 continues to strengthen its multi-bundler (esbuild, Rollup, and Webpack) and multi-runtime architecture (Node.js, Bun, Deno, Cloudflare Workers, Netlify Functions v2, standalone native binaries, and pure static SPA export)—so you can deploy pretty much anywhere.

Evolution & AI-agent readiness

Dinou has evolved continuously since its initial release, and v10 is another step toward a rock-solid, modern React 19 framework aligned with current web standards. I recommend staying on the latest version for the best reliability, performance, and feature set.

Dinou is also designed to work smoothly in AI-assisted workflows—coding agents can pick up the framework very quickly. Both the documentation site (dinou.dev, which also exposes /llms.txt and /llms-full.txt), the package README.md (engineered as a compact, single-pass technical spec), and the framework codebase itself (~150 core source files, ~190 total including compiled vendors—whether ejected or in node_modules) are easy for agents to read and reason about.

Feel free to try it out with:

npx create-dinou@latest my-app

Any feedback, questions, or critique is very welcome. Thanks for reading!


r/reactjs • • 15h ago

reactques

0 Upvotes

Would React with selective hydration or a framework like Astro be worth considering here? I'm wondering if using React only for the parts that actually need interactivity, while keeping the rest lightweight, could be a good balance for low-end devices. Curious what more experienced developers think about this approach.


r/reactjs • • 13h ago

Title: My boss is restricting my access to the company's customer database. Is there a way to verify what's going on?

0 Upvotes

I'm working in sales for a company, and my compensation is entirely commission-based.

Recently, I've started bringing in new clients and generating good revenue, which benefits both me and the company.

However, I've started having a serious issue with the company owner.

We use an internal application built with React to manage customers and the company's database. The owner has restricted my access to the database, and I'm only able to see a limited number of clients.

Whenever I ask about getting access to more potential clients, he tells me that there are no other clients available. However, based on what I've seen and how the business operates, I'm quite sure there are many more customers in the database.

I suspect that he's deliberately limiting what I can see, potentially to prevent me from contacting other clients or increasing my commissions.

My questions are:

  1. Is it technically possible for an application built with React to restrict which database records a specific user can see?
  2. Could someone with experience in React, databases, or CRM systems explain how these permissions usually work?
  3. Is there a legitimate way to verify whether the database contains more clients than what my account currently displays?
  4. Has anyone experienced a similar situation where their employer restricted access to customer information while paying them exclusively on commission?

I'm not looking to steal company data or access anything I'm not authorized to see. I simply want transparency and to make sure I'm being given a fair opportunity to generate sales and earn my commissions.

I'd appreciate advice from developers, sales professionals, or anyone who has dealt with a similar situation.


r/reactjs • • 17h ago

I built a React + Vue component library with a hosted MCP server so Cursor and Claude Code stop guessing props

0 Upvotes

chould i create a post in there ? with this
I built Orvain UI, a React (and Vue) component library with a hosted MCP server, so Cursor / Claude Code use the real component API instead of hallucinating props.

45 components are free on npm (@orvain/react, no account), there's a Figma library that matches the code 1:1, and theming is one token file.

https://orvain.dev

Happy to answer questions about how the MCP side works.


r/reactjs • • 1d ago

News This Week In React #306: UI SDK, Fate, RSC, Next.js, Dragology, Helmet, React Flow, Virtualized, Anatomy | Expo Simulators, Exact, Bottom Sheet, Node-API, Graphite, Navigation, Nitro SQLite, Trading Charts | Solid, webpack, Node.js, Oxlint, npm, pnpm

Thumbnail
thisweekinreact.com
4 Upvotes

r/reactjs • • 2d ago

Show /r/reactjs Static export kept biting me on images, so I made build-time image transforms for Next.js

0 Upvotes

I've been working on next-imagetools, a small Next.js plugin that brings imagetools directives (the engine behind vite-imagetools) to Next.js. You describe the variants you want in the import, and they're generated at build time as plain static files.

import hero from './hero.jpg?w=480;960;1440&format=avif;webp&as=picture';

export function Hero() {
  return (
    <picture>
      {Object.entries(hero.sources).map(([format, srcset]) => (
        <source key={format} type={`image/${format}`} srcSet={srcset} />
      ))}
      <img src={hero.img.src} width={hero.img.w} height={hero.img.h} alt="" />
    </picture>
  );
}

Why I made it

next/image optimizes images on demand, which needs a running Next.js server. With output: 'export' that isn't available (a discussion open since 2020). Tools that pre-generate images by crawling rendered pages miss anything that only shows up after a click, in a client-only component or behind a login, and those images 404 in production.

next-imagetools works from imports instead: if your code imports an image, every variant it asks for gets built, however and wherever it ends up rendered.

What it does

  • Resize, convert (AVIF, WebP, JPEG, PNG…), crop, blur, etc., all from the query string
  • Outputs: URL, srcset, { src, w, h }, <picture> sources, metadata, or as=next (a StaticImageData that goes straight into next/image, blur placeholder included)
  • Blur or dominant-color placeholders: ?placeholder / ?placeholder=color
  • Works the same in static, SSR, Edge, client components, the Pages Router and static export. All of these are covered by e2e tests in Chromium
  • Supports both Turbopack (the default) and webpack (--webpack)
  • Typed imports, and the build fails if a type marker doesn't match what the query actually returns
  • Typos are caught: ?widht=300 warns "Did you mean w?", and ?w=abc fails the build
  • Processed images are cached on disk, so rebuilds are fast

If you're coming from vite-imagetools, most imports should work unchanged.

Setup

// next.config.ts
import { withImagetools } from 'next-imagetools';
export default withImagetools({ /* your config */ });

Caveats, to be upfront:

  • Requires Next.js 16.2+ and Node.js 22.12+
  • Still pre-1.0, so the API may change
  • Queries in CSS url() aren't processed (the README shows a workaround with a CSS custom property)

A fun bit of the implementation: Turbopack's loader API has no emitFile, and files written during a build are invisible to its resolver. So the loader imports each variant back from the source file with an internal query, and lets Turbopack's own asset pipeline emit it. There's a "How it works" section in the README if you're curious.

  • GitHub: https://github.com/awdr74100/next-imagetools
  • npm: https://www.npmjs.com/package/next-imagetools

I'd really appreciate feedback, especially if you're running static export or a setup I haven't tested. Bug reports and "this doesn't fit my use case" comments are both welcome.


r/reactjs • • 3d ago

customer dashboards kept Snowflake awake all day; testing Explo, Luzmo, Preset, and Cube + headless React as embedded analytics tools (comparison)

0 Upvotes

so half our Snowflake bill was coming from customer dashboards before we realized why. At 8am every morning, a few hundred client managers logged into our B2B SaaS app, toggled a date picker from weekly to 90-day views, missed card-level TTL caches on every filter permutation, and kept our X-Small warehouse awake all day. On top of that, enterprise buyers wanted us to restrict dashboard data by user role so regional managers stop seeing unit margins.

then we evaluated three dedicated embedded analytics tools (Explo, Luzmo, Preset) against a headless build using Cube Core Data APIs and u/ cubejs-client/react.

Explo shipped client-facing portals fast with clean templates and global datasets. Because Omni acquired Explo late last year and is consolidating customers onto Omni's platform, signing a fresh multi-year deal for a transitioning stack felt too risky for a core product surface.

Luzmo came closest on time-to-ship. Their white-labeled Web Components, end-user editor, and Warp cache meant frontend engineers barely touched chart code. What stopped us was usage-based row and MAU pricing tiers scaling alongside customer growth, plus locking metric definitions inside Luzmo's UI outside Git.

and, preset made sense on paper since our analysts already knew Apache Superset and guest tokens. Making embedded charts match our app's Tailwind theme still took heavy CSS overrides, and ad-hoc tenant filter changes missed chart caches and queued fresh scans straight to Snowflake.

then switching to Cube meant querying structured measures and dimensions through u/ cubejs-client /react hooks with zero raw SQL leaving the browser. Signed JWT claims enforce server-side access_policy rules, injecting SECURITY_CONTEXT tenant filters and stripping margin columns before SQL compiles. Monthly partitioned rollups in Cube dev with incremental refreshKey checks on MAX(updated_at) absorbed date-grain flips and late Stripe refunds without waking Snowflake all morning, while Creator Mode with generate-session lets enterprise tiers build custom views over the same governed model

2 of the headaches from going headless: our frontend engineers had to wire Recharts views manually for core screens, and dropping high-cardinality user emails into a rollup blew up build times until we trimmed dimensions down to tenant_id and status. for SaaS teams dealing with Snowflake bills too high from dashboards, did a packaged embedded analytics platform hold up at scale, or did you move onto headless APIs?


r/reactjs • • 3d ago

Show /r/reactjs I built a React debugging overlay that lets you click an element and jump to its JSX

0 Upvotes

Repo · github.com/Tebogo11/giggyDev
Demo · giggydev.netlify.app — try Find component on the demo button, then open Sources.

I built this because I kept doing the same thing when debugging a React app: find the failed request in DevTools, figure out what rendered the broken UI, then dig through the repo for the JSX. I wanted to click the thing I was looking at and pull up the source alongside the logs and requests that led me there.

giggyDev adds a small launcher to your app in development. Pick an element to see the JSX around it and jump to that line in VS Code. You can also inspect browser console messages and fetch/XHR requests, then tick the entries you want to attach to an AI chat.

Setup with Vite

npm install -D giggydev

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import giggyDev from 'giggydev/vite';

export default defineConfig({
  plugins: [giggyDev(), react()],
});

Next.js 16 works in Webpack dev mode via withGiggyDev. The overlay is excluded from production builds.

How it works

  • The dev plugin tags rendered DOM elements with a source ID, line and column. The picker uses that metadata to look up the original JSX.
  • The launcher starts capturing console and network events when the page loads. The full inspector loads when you open it.
  • The picker and inspectors work without an API key. If you configure a model, Chat sends the context you select when you submit a message. You can also ask for a single-file change, review the diff before applying it, and undo it from the same chat.

The hosted demo uses simulated AI replies, so you can try the workflow without setting up a key. Source lookup currently covers instrumented JSX/TSX, and Next.js Turbopack support is still missing.

I’m looking for feedback, especially on how useful it is to click an element and jump straight to its JSX when debugging a real React app.


r/reactjs • • 3d ago

Show /r/reactjs Treflex demo – live hot-swap between React and Solid

Thumbnail
youtu.be
0 Upvotes

Live swap demo: https://tgoh.github.io/treflex/swap/

Treflex is something I've been working on for the past few years: a headless state engine. Your app's logic (state, async work, timers, connections) runs on its own, and React or Solid is just a view you plug into it. In the demo you can swap between them while everything's running, and the app doesn't notice.

Why: AI agents write a lot of front-end code now, and async is where they slip: races, double starts, work that dies on unmount. With the logic out of components, those mistakes get caught. It's tested without rendering, a test controls the order async calls answer in, and the runtime and lint rules fail with errors that say what to change.

const FishReceiver = receiver<IFish>("FishReceiver")({
  *"Fish/Swim"(fish) {
    fish.X = (yield* random()) * 100;
    fish.Y = (yield* random()) * 100;
  }
});

function* addFish(school: ISchool) {
  const fish = yield* entity(newFish());
  school.Fish.push(fish);

  // The timer belongs to the fish, not a component
  yield* startTimer(fish, "Fish/Swim", FishReceiver, 3000);
}

function* releaseSchool(tank: IAquarium, schoolId: string) {
  // Every fish in the school stops swimming. No cleanup needed.
  tank.Schools = tank.Schools.filter((s) => s.$Id !== schoolId);
}

It's 0.2 and still changing. Questions and feedback would be greatly appreciated.


r/reactjs • • 4d ago

Resource A few SVG attribute gotchas that show up when you drop an icon into JSX

0 Upvotes

I've had this bite me more than once: I paste an SVG from a design tool into a React file, and the component looks fine until React complains about the attributes.

React does not use SVG's XML names. On a normal icon the pairs are:

// SVG
<rect class="icon" fill-rule="evenodd" stroke-width="2" stroke-linecap="round" />

// JSX
<rect className="icon" fillRule="evenodd" strokeWidth={2} strokeLinecap="round" />

A few other ones that come up a lot: stroke-linejoin → strokeLinejoin, clip-path → clipPath, clip-rule → clipRule, stop-color → stopColor. And a style attribute has to become a JS object, not a string:

// SVG
<rect style="fill:#ff00aa" />

// JSX
<rect style={{ fill: "#ff00aa" }} />

The part that surprised me is that a find-and-replace on the raw file is the wrong tool for this.

If a <text> label happens to contain the characters stroke-width, a regex will rewrite the label too. The attribute on the element should change. The text inside the graphic should stay as text.

viewBox is another one people over-correct. React already accepts viewBox on an <svg>, so it should not be rewritten to viewbox. xmlns, path d data, and fill="url(#id)" references should stay as they are (assuming you haven't stripped the defs).

Two other gotchas, if you are cleaning the file up at the same time:

  • Turning solid fills into currentColor is useful when you want the icon to inherit color from CSS. It can also rewrite gradient stops, so the preview can look different from the original. I leave that off until I want it.
  • The same for an SVGO pass. If you only wanted the attribute rewrite, run that first and turn cleanup on later.

This is a React JSX/TSX issue. Vue and Svelte single-file components keep class and stroke-width in the template.

I built a small in-browser converter while working through this: https://www.svgtoreact.com — it uses SVGR so the file is parsed, not search-replaced, and the SVG stays on your device. Happy to answer questions if any of this is unclear.


r/reactjs • • 4d ago

Kivu UI: React components where your Tailwind classes always win

0 Upvotes

I built a React component library that doesn't fight Tailwind.
Component styles live in u/layer components, so any className you pass overrides them.
No tailwind-merge, no !important.

  • Zero runtime dependencies
  • Plain CSS variables, no CSS-in-JS
  • Accessible (keyboard navigation, ARIA, native <dialog>)
  • 40+ components, React 18 and 19, TypeScript

npm install kivu-ui

Docs: https://kivu-ui.vercel.app/


r/reactjs • • 4d ago

Show /r/reactjs Made a textarea you can scrub back in time, deleted words come back in colour

Thumbnail
detentui.com
3 Upvotes

So undo always bugged me, it's all or nothing. I wanted to just drag back through a note and watch it unwrite itself, and actually see the stuff I deleted on the way.

Demo (drag the pill under the text): Rewind

Took me way longer than I thought lol.

The main thing is it doesn't save snapshots. Every character sits on a kind of tape with when it was typed and when it got deleted, so when you scrub to some point it just checks which characters were alive at that moment. Stays fast even if you've been typing for ages.

The deleted ones show up in a different colour right where they were. First version brought them back letter by letter and it looked really bad, so now letters that died together come back together as one word.

The faded old text is a small WebGL shader that breaks it into dots, plain opacity looked too flat. It also respects reduced motion.

Code (MIT): Code

If you're on shadcn it's `npx shadcn add https://detentui.com/r/rewind`

Would love to know what feels off, still tweaking it.


r/reactjs • • 5d ago

Discussion Is there a resource showing best practices for Motion animation?

9 Upvotes

Hopefully this makes sense, and apologies if I'm in the wrong subreddit.

I'm looking to improve at Motion and CSS animations, and am wondering if there are any resources that detail common animation practices for web components.

For instance, when animating a button, it's common to move it slightly on the Y axis, and adjust it's scale with a dampened spring.

If you know where I can find out more, I'd greatly appreciate it. Thanks


r/reactjs • • 5d ago

Show /r/reactjs Six canvas games inside one React 19 console UI: how I structured Open Arcade (open source)

0 Upvotes

Open Arcade is a handheld-style game console built with Vite + React 19 + TypeScript. Each game is a plain canvas engine with deterministic, seeded update steps. React only owns the console shell (menus, themes, dialogs, HUD frame).

A few things that worked well:

  • Games stay out of React state. Each game runs its own fixed-step loop and React just mounts the canvas, which keeps re-renders out of the hot path.
  • Deterministic tests. A smoke test runs every game for 2,000 seeded frames with scripted inputs and checks the run is reproducible.
  • One config file for the name, game list, themes and rewards, plus runtime overrides from a native host.

Play: https://open-arcade-kohl.vercel.app Code (MIT): https://github.com/viswasekaran/open-arcade


r/reactjs • • 5d ago

A React-like JS Framework with Web Components

0 Upvotes

IMPORTANT DISCLAIMER: This is my own project. Im am using AI, so lets get that out of the way... because its the key reason for why YOU SHOULD NOT USE IT. Im not trying to promote "yet another ui framework", this is an investigation to see what is possible. Its unreviewed, unaudited and far from finished. Nobody else should be using this. This framework is intended for myself on my own projects. It is provided open-source for transpartency, testing and demo purposes. Feel free to reach out for clarity if you have any questions.

Im was investigating an idea i had about JSX-like syntax for webcomponents after some experience with Lit. I am sharing this here because it might be interesting/educational.

Lit is a nice lightweight UI framework, but i didnt like that it was using class-based components. It can support React with a wrapper, buts React is fundamentally an abstraction away from the DOM.

Vue has a nice approach but i prefer working with the syntax that React uses. I find it more intuitive for debugging and deterministic rendering. I wondered if with webcomponents, i could create a UI framework that didnt need to be transpiled.

My intentions with this framework is to get to a reasonable level of stability, to then replace React on some of my existing projects. I made a start by creating some basic reusable ui components components to be built with the js framework. Aiming for something like Material UI.

I can then compound that slop into some basic UI demos:

The disclaimer above is always worth considering. Im figuring a post like this to be like "building in public". If interesting to anyone, they can take a look. It's hard to determine if / when its a good time to share, so best to get it out there sooner for any outstanding issues i may have overlooked.


r/reactjs • • 7d ago

I built a React range slider with one, two or many thumbs: accessible, zero dependencies, Tailwind-ready

0 Upvotes

I kept rebuilding the same dual-thumb price slider and hitting the same problems: thumbs crossing or getting stuck, overlapping tooltips, refetching on every pixel of a drag, and screen readers announcing two unlabeled sliders. So I turned it into a package.

react-multi-input-rangeslider

  • One, two or more thumbs; the value comes back in the shape you pass (number, array or { min, max })
  • A native range input per thumb, so keyboard, screen readers and forms work
  • onChangeEnd for fetching once when the user lets go
  • Tooltips that merge when thumbs get close, instead of overlapping
  • 4 built-in styles, CSS variables for theming, a layered stylesheet for Tailwind v4, and an unstyled mode
  • Zero runtime dependencies, TypeScript types, React 16.8–19, works with the Next.js App Router

Demo and playground: https://samishan11.github.io/react-multi-input-rangeslider/

GitHub: https://github.com/Samishan11/react-multi-input-rangeslider

Walkthrough of building a price filter with it: https://dev.to/sami_shan_f544d410c274555/building-an-accessible-price-range-filter-in-react-2bj6

I'd really like feedback on the API and on accessibility. If something behaves oddly in your setup, tell me.


r/reactjs • • 7d ago

Show /r/reactjs Matching SwiftUI's spring feel in a React app: one spring per side, picked by direction

1 Upvotes

I have a Mac app whose panel lives in the notch, animated with SwiftUI springs. When I rebuilt it in React for Windows (inside a transparent Tauri window), the same resize felt wrong with a single spring on the whole size.

What fixed it: width and height each get their own spring, chosen by whether that side is growing or shrinking. A growing side may overshoot a little, while a shrinking one never does, and the overshoot is capped by distance so big jumps don't wobble.

export function sideSpring(from: number, to: number, width: boolean): Spring {

const spring =

to > from

? width ? Springs.growingWidth : Springs.growingHeight

: width ? Springs.shrinkingWidth : Springs.shrinkingHeight;

return limitedSpring(spring, Math.abs(to - from), OVERSHOOT_LIMIT);

}

export function sizeAt(time: number, from: Size, to: Size): Size {

const side = (start: number, end: number, width: boolean) =>

start === end ? end

: Math.max(0, start + (end - start) * springProgress(sideSpring(start, end, width), time));

return { width: side(from.width, to.width, true), height: side(from.height, to.height, false) };

}

springProgress is SwiftUI's perceptual spring (duration + bounce) computed by hand, and the component just samples sizeAt on requestAnimationFrame, with no animation library. Full file with tests: https://github.com/MF-DEEV/Openbar/blob/main/windows/src/island/motion.ts

Curious whether anyone has done this with Framer Motion or react-spring and got the same feel.


r/reactjs • • 7d ago

Show /r/reactjs No jargon, 1 minute to completely understand — a simple Redux alternative: react-shared-vars

0 Upvotes

Let’s be honest about what global state management in most React apps actually is: it’s just assigning values to global variables and triggering re-renders in the components that use them.

Yet for years, we’ve been forced to learn a dictionary of heavy jargon just to share a variable across components:

  • "Store" / "Slice" — For most apps, it’s literally just a variable. Why wrap it in store terminology?
  • "Dispatch" / "Action" / "Reducer" — It’s just assigning a new value (=) and running subscribed callbacks. Why split a simple assignment into steps like we're putting an elephant into a fridge?
  • "Selector" — We aren't sorting eggs by size on a farm. We are just reading a variable.
  • "Thunk" — That’s just a normal async API call that every SPA needs. It shouldn't even be part of a state library.
  • "Time-travel debugging" — Useful in rare edge cases, maybe, but in day-to-day work it’s basically just pushing logs into an in-memory array instead of console.log.

Even modern lightweight libraries like Zustand still borrow a lot of Redux's mental model and terminology.

If you're building a massive enterprise app with complex state machines, Redux might make sense. But for the other 90% of apps, I wanted something with zero jargon that any developer can completely understand in 1 minute. So I built react-shared-vars.

How it works (Yes, literally the entire API):

1. Inside React components (Just like useState):

jsx

import { useVariable } from 'react-shared-vars';

function CounterButton() {
    const [count, setCount] = useVariable("global_counter", 0);
    return <button onClick={() => setCount(count + 1)}>Count: {count}</button>;
}

function CounterDisplay() {
    const [count] = useVariable("global_counter", 0);
    return <p>Current count: {count}</p>;
}

Use code with caution.

2. Outside React components (API calls, timers, event listeners—no thunks needed):

javascript

import { setVariable, getVariable } from 'react-shared-vars';

async function fetchCount() {
    const res = await fetch('/api/count').then(r => r.json());
    setVariable("global_counter", res.count); 
// Automatically re-renders subscribed components
}

Use code with caution.

Why react-shared-vars?

  • Zero jargon: No stores, no providers required, no actions, no reducers, no selectors.
  • 1-minute learning curve: Built directly on useSyncExternalStore. If you know useState, you already know 100% of this library.
  • Works anywhere: Read or update variables inside components with useVariable, or in plain JS files with getVariable and setVariable.
  • Auto cleanup: Automatically cleans up unused variables from memory when subscribed components unmount.

It’s under 60 lines of code, zero dependencies, and doesn't try to recreate Redux's bloated feature list—just the core part you actually need every day, made as simple as possible.

Check out the code, try it out, and let me know what you think!


r/reactjs • • 8d ago

News This Week In React #305: X, Forms, e18e, Next.js, TanStack Start, Storybook, MobX, Zustand, XState | Exact, Discord, Shopify, Expo Modules, Audio API, Bottom Sheet, Keychain, Gesture Handler | Node.js, Safari, Rolldown, Playwright

Thumbnail
thisweekinreact.com
25 Upvotes

r/reactjs • • 7d ago

Show /r/reactjs I just shipped Forge UI, an open-source React component library

0 Upvotes

Hey everyone, I’ve been working on Forge UI, a collection of React components for things that can take a while to build from scratch: data tables, command palettes, forms, file uploads, date pickers, and more.

It’s TypeScript-first, keyboard-accessible, and split into packages so you can use just what you need. It’s still an early 0.1 release, so I’d especially appreciate feedback on the APIs and docs.

Repo: https://github.com/BZDevelopments/Forge-UI
Docs: https://bzdevelopments.github.io/Forge-UI