Headless React components, and the first UI library that is Async React-native.

The star flips at once, the button shows a spinner while the fake save runs, and a second click while it is pending wins. The code is one Toggle with an async action.
"use client";
import { Toggle } from "@funstack/ui/toggle";
import { fakeSave } from "./fake-api.js";
// Uncontrolled Toggle with an async action. The star flips at once (optimistic), the button
// carries data-pending for the 800 ms the save takes, and a second click while pending wins.
export function ToggleFavorite() {
return (
<Toggle className="demo-toggle" pressedChangeAction={(next) => fakeSave(`favorite=${next}`)}>
{({ pressed, pending }) => (
<>
{pending ? (
<span className="demo-spinner" aria-hidden />
) : (
<span aria-hidden>{pressed ? "★" : "☆"}</span>
)}
Favorite
</>
)}
</Toggle>
);
}/* Toggle: data attributes carry library state; :hover / :focus-visible come from the platform. */
.demo-toggle {
display: inline-flex;
align-items: center;
gap: 0.4em;
padding: 0.4em 0.9em;
border: 1px solid var(--color-border);
border-radius: 999px;
background: var(--color-bg);
color: var(--color-text);
font: inherit;
cursor: pointer;
/* The optimistic flip is a sync commit, so it animates with a plain CSS transition. */
transition:
background-color 120ms,
color 120ms,
border-color 120ms;
}
.demo-toggle[data-pressed] {
background: var(--color-primary);
border-color: var(--color-primary);
color: var(--color-on-primary);
}
.demo-toggle[data-pending] {
cursor: progress;
}
.demo-toggle[data-disabled] {
opacity: 0.5;
cursor: not-allowed;
}
.demo-toggle:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.demo-toggle {
transition: none;
}
}The components are headless: accessible HTML with data attributes, no styles. You bring the CSS. Why FUNSTACK UI shows what this saves you.
Content that suspends is the normal case. The old content stays on screen while the new content loads.
Every state change the library makes is a React transition. You do not opt in.
Pass an async function (pressedChangeAction, valueChangeAction); the component shows the new value at once and data-pending until it is done.
Give a part a transition prop and its changes animate with React's <ViewTransition>.
Popover API, <dialog>, CSS Anchor Positioning, <details>, native form controls. Where HTML can do the job, it does.
Components follow the WAI-ARIA Authoring Practices and are tested for keyboard and assistive-technology behaviour.
npm install @funstack/uiReact 19.3 or later. Supported browsers: the latest stable Blink, WebKit and Gecko. No fallbacks. Platform features not yet in all three are opt-in experimental props.
Components: Button, Toggle, ToggleGroup, Toolbar, Tabs, Accordion, Collapsible, NavigationMenu, Tooltip, HoverCard, Popover, Dialog, AlertDialog, Drawer, Menu, Context menu (Menu), Menubar (Menu), Toast, Field and Form, Checkbox, CheckboxGroup, RadioGroup, Switch, Select, Combobox, MultiSelect, Slider, NumberField, OTPField, TextField, Progress, Meter, Avatar, Separator and Scroll areas (recipe). More are coming; see the roadmap.
FUNSTACK UI is part of the FUNSTACK family, which aims to be the most modern React stack: