r/reactjs • • May 08 '26

Discussion Best way to manage global modals/dialogs?

3 Upvotes

Like the title says what is the best or most escalable way to do this? I know there are some libraries like nice modal or that one that dude made it was shadcn modal manager I think, or I could even do my own global modal with a bit of context or zustand, but I was wondering what is the best way to this, I mostly need this so I don't want to repeat myself wrapping every form I make in a modal component, but I am wondering how to scaffold it, also should my form component have a onSuccess optional function, should the cancel and submit buttons live in each form or in the modal abstraction?


r/reactjs • • May 08 '26

Show /r/reactjs frontend architecture + UI

Thumbnail
vercel.com
2 Upvotes

Been experimenting with the idea of making competitive programming feel more like esports instead of isolated coding challenges.

Built an MVP called Killswitch:
a live coding battle arena where developers compete head-to-head while viewers vote on modifiers and AI explains the match live.

Still early, but the current build includes:
• battle HUD
• audience voting
• tournament pages
• replay flows
• mobile spectator UI

Mostly testing whether coding can become an actual spectator experience instead of just a practice tool.


r/reactjs • • May 08 '26

Show /r/reactjs I built a headless React library for multi-panel tabbed layouts — the kind you see in VS Code, Cursor, and GreatFrontend

18 Upvotes

I've built a react-splitkit — a headless React library for building multi-panel, tabbed, resizable layouts. Think VS Code's panel system or Cursor's IDE layout, but you bring your own styles.

Why I built it:
Every time I needed this kind of UI, my options were:

  • Wire it up myself — doable, but resize math, tab state, ARIA, and keyboard nav adds up fast
  • Use react-resizable-panels — great for pure resize, but no tabs
  • Use Mosaic or GoldenLayout — heavy, opinionated, fights your design system (like more than I needed, and may tend to fight your design system)

So I built the headless version — zero CSS, zero opinions on markup.

What it does:

  • Tabbed panels — add, close, reorder at runtime
  • Split any panel horizontally or vertically, programmatically
  • Collapse and maximize out of the box
  • Layout is plain JSON — one onChange to save, one initialLayout to restore
  • Full keyboard nav + ARIA (tablist, separator with aria-value*, modal on maximize)

Three live demos to see it in action:

Note: Still early and there's more to build, but the core is working. Would love brutal feedback on the API design — especially if something feels awkward or you'd have built it differently. If this is useful or you'd build something with it, a ⭐ on GitHub goes a long way

LayoutLightDark
Cursor stylehttps://github.com/amareshsm/react-splitkit/blob/main/cursor-layout-light.pnghttps://github.com/amareshsm/react-splitkit/blob/main/cursor-layout-dark.png
Great frontend stylehttps://github.com/amareshsm/react-splitkit/blob/main/gfe-layout-light.pnghttps://github.com/amareshsm/react-splitkit/blob/main/gfe-layout-dark.png

Docs - https://react-splitkit.vercel.app/docs

Demos - https://react-splitkit.vercel.app/#examples

Github - https://github.com/amareshsm/react-splitkit


r/reactjs • • May 09 '26

Discussion Tell me why my approach is wrong

0 Upvotes

[EDIT 3 months later — two of the four issues raised in the comments are now solved. Details at the bottom.]

I couldn't tolerate the runtime merging of CSS Modules and tailwind-merge, so I wrote a compiler that uses ASTs to create lookup tables for all patterns. The result is zero runtime, zero bundle size CSS-in-JS. The documentation is here (https://plumeria.dev), and the design philosophy is in this article — in Japanese — (https://zenn.dev/refirst11/articles/db47880cdfe443), but what do you think are the pitfalls of this approach? Is there something fundamentally wrong with eliminating the runtime entirely?


EDIT (3 months later). The top comment found four holes. Two are closed, one I'd failed to answer, one is still real. Since the original post linked out instead of showing anything, here's the actual shape of it:

const styles = css.create({
  text: { fontSize: 12 },
  cond: { background: 'navy' },
  scale: (value) => ({ scale: value }),
});

<div classStyle={[styles.text, cond && styles.cond, styles.scale(scale)]} />

compiles to:

<div
  className={'xhrr6ses ' + (cond ? 'xj00ajs1' : '') + ' xnoo1byz'}
  style={{ '--scale-value': scale }}
/>

Static styles become class names at build time; only genuinely dynamic values survive as CSS variables. Details in the replies below.


r/reactjs • • May 08 '26

News uiGrid - 1.0.0 massive update - MIT license

1 Upvotes

hey guys i wanted to let you know that i just finished porting over every advanced feature from my original grid to the remastered version.

https://github.com/orneryd/uiGrid/releases/v1.0.0

on top of everything else i already shipped (grouping, expansion, tree views, theming, etc…) i’ve added a lot more…

the shared grid runtime now ships row selection, keyboard cell navigation, infinite scroll, row edit workflows, cell validation, CSV/JSON import, CSV/Excel/PDF export, pagination, richer i18n coverage, and custom component/template integration across the web hosts.

MIT licensed.

all features all free this will never be monetized. enjoy!


r/reactjs • • May 08 '26

Show /r/reactjs I built react-tree-grid – open-source Grid, Tree and TreeGrid for React 18+ (zero dependencies)

Thumbnail github.com
4 Upvotes

I built react-tree-grid, a zero-dependency Grid, Tree and TreeGrid

component library for React 18+.

Key features:

- Virtual scrolling (100k+ rows)

- Inline editing, sorting, filtering, drag-and-drop

- Frozen columns, rowspan/colspan

- Full TypeScript support

Would love feedback from the community!


r/reactjs • • May 09 '26

Show /r/reactjs Built a Chrome extension that auto-generates React Query hooks from any real network request in DevTools

0 Upvotes

When building React apps, I kept doing this:

  1. See an API call in DevTools
  2. Manually write a useQuery or useMutation hook for it
  3. Get the URL, headers, and body right by trial and error

Built ReqConvert — it captures the live request and generates the complete React Query hook for you:

- useQuery for GET requests (with correct queryKey)

- useMutation for POST/PUT/DELETE (with onSuccess invalidation)

- Includes all headers automatically

Also generates: cURL, fetch, Axios, Python, TypeScript, httpx, Postman

Chrome Web Store (free to install):

https://chromewebstore.google.com/detail/fkbfidogphlmlplcnlkoncdofmcjbhjp

What's the most annoying part of wiring up API calls in your React projects?


r/reactjs • • May 08 '26

Who should be responsible for if (!notes)?

0 Upvotes

Hey,

I have a question.
When I reach something similar to this:
I have:
- page.tsx
-- Notes.tsx
--- Note.tsx

If I don't have notes, who should be responsible to output the right message? (e.g paragraph with "no notes yet"
And why?
What if I don't want to even show something if there are no notes?


r/reactjs • • May 07 '26

Show /r/reactjs I rewrote my React drag-and-drop table library to handle 2D virtualization at 60fps

16 Upvotes

Hey r/reactjs,

I just released v2.0 of react-table-dnd. I originally built this because trying to drag both rows and columns inside a fully virtualized grid is usually a nightmare—most libraries either cause massive layout thrashing or the drop zones completely break when virtual columns unmount.

To fix this, I had to bypass React's render cycle almost entirely for the drag engine:

  • O(1) updates: I ripped out React Context and moved to a vanilla store with useSyncExternalStore.
  • Native cloning: Swapped React.cloneElement for native cloneNode(true).
  • Direct DOM mutations: Drag movements happen outside React via style.transform in a requestAnimationFrame loop.
  • O(1) Map caching: This tracks the DOM geometry.

I put together a docs site with interactive demos, specifically showing off the 2D virtualized grid:

What's Next (Future Plans)

  • Fully Headless API: Moving toward a completely headless architecture. Since the drag logic and state are already decoupled from the UI, the goal is to provide raw hooks and primitives so you can bring your own markup.

r/reactjs • • May 08 '26

Released our UI framework, tell us what you think

0 Upvotes

Announcing our UI framework: Coneto. Good for making web and desktop, take a look please, and let me know what do you think. Browse all the components here.


r/reactjs • • May 07 '26

Resource Server-Driven UI in ReactJS

Thumbnail
neciudan.dev
7 Upvotes

I shared this before, i built it a couple of times in different frameworks but here is how it looks like in React


r/reactjs • • May 07 '26

Discussion Emotion CSS: Use the css prop or @emotion/styled, but not both

Thumbnail emotion.sh
2 Upvotes

Currently reading Emotion’s official best practices and I don’t really understand why should I not use both the css and styled approach. The docs say they CAN coexist but also they say “don’t mix them”. I am trying to understand why, other than potential readability issues.

In my app I am mixing them, since sometimes the css approach is enough and I don’t really need to create a full styled component just for a symple div style. Am I wrong in doing this?


r/reactjs • • May 07 '26

Show /r/reactjs I built an open-source calendar component inspired by macOS Calendar

15 Upvotes

Hi guys 👋

I’d like to share DayFlow, an open-source full-calendar component for modern web apps that I’ve been building over the past year.

As a heavy macOS Calendar user, I was looking for a clean, modern calendar UI on GitHub — something flexible, extensible, and not locked into a specific design system. I couldn’t quite find what I wanted, so I decided to build one.

What DayFlow focuses on:

  • Clean, modern UI inspired by macOS Calendar
  • Framework support: React, Svelte, Vue, and Angular
  • Modular architecture (views, events, panels are customizable)
  • Designed for extensibility and custom event rendering
  • Actively improving i18n support

The project is fully open source and still evolving. I’d really appreciate:

  • Feedback on API & architecture
  • Feature suggestions
  • Bug reports
  • PRs if you're interested in contributing

GitHub: https://github.com/dayflow-js/calendar

Demo: https://calendar.dayflow.studio