# Squonk UI > Accessible React 19 components, a theme and patterns, in light and dark, built on React Aria and ready for coding agents. Documentation, live examples and design guides: https://ui.squonkstack.io/ Source: https://github.com/squonkstack/ui npm: `@squonkstack/ui` and `@squonkstack/ui-mcp`, released together under the MIT licence. Interactive components are built on React Aria Components. Styles are CSS Modules compiled into one static stylesheet (`@squonkstack/ui/styles.css`), with no CSS-in-JS runtime, so server rendering and the Next.js App Router need no style registry. Entry points keep their `"use client"` directive. Import each component from its own entry (`@squonkstack/ui/button`). Forms use TanStack Form and validate with Zod, which the app installs. Tables use TanStack Table. Light and dark are both built in, and any subtree can switch. ## Install React and React DOM 19.2 or later, within 19.x. ```sh npm install @squonkstack/ui ``` The components run in the browser and in your framework's server render. They do not require a Node.js version. The setup command (`npx @squonkstack/ui`) and the MCP server (`@squonkstack/ui-mcp`) run on Node and need Node 20.12 or later. Working on this repository needs the version in `.nvmrc`. Publishing uses semantic-release, which needs Node `^22.14.0 || >=24.10.0`; that range is release tooling, not a requirement for apps. At the app root, load the fonts and the stylesheet once and mount the provider: ```tsx import { Button } from "@squonkstack/ui/button"; import "@squonkstack/ui/fonts.css"; import "@squonkstack/ui/styles.css"; import { SquonkThemeProvider } from "@squonkstack/ui/theme-provider"; export function App() { return ( ); } ``` `withGlobalStyles` sets the body background, text colour and font. Omit it when the app owns those styles. ## Coding agents The installed package is the source of truth for the version the app has: ```sh node -p "require.resolve('@squonkstack/ui/skill')" node -p "require.resolve('@squonkstack/ui/catalog.json')" ``` `npx @squonkstack/ui` installs the library and, unless you pass `--no-mcp`, runs `npx @squonkstack/ui-mcp init` at the same version. That registers the `squonk-ui` MCP server for Claude Code, Codex, VS Code and Cursor, and adds an `@squonkstack/ui` section to `AGENTS.md`. `--yes` accepts the defaults. Claude Desktop's settings are user-wide, so they change only when you pick that agent or pass `--agents claude-desktop`. MCP tools: `find_components`, `get_component`, `find_guidance`, `get_guide`, `list_stories`, `get_theme`, `preview_story` (the library's stories with live controls, rendered from the app's installed components). Resources use the `squonk-ui://` scheme (`catalog`, `components/{id}`, `guides`, `guides/{id}`). Full text of the guides and component guidance: https://ui.squonkstack.io/llms-full.txt ## Guides - [Accessibility](https://ui.squonkstack.io/?path=/docs/foundations-accessibility--docs): Every interactive component is built on React Aria, which implements the WAI-ARIA patterns and is tested across browsers and screen readers. - [Colour](https://ui.squonkstack.io/?path=/docs/foundations-colour--docs): Colour carries meaning, so it is used sparingly: a calm neutral page, Squonk blue for the thing to act on, and status colours only when something has a status. - [Icons](https://ui.squonkstack.io/?path=/docs/foundations-icons--docs): The library exports a curated set of icons named for their meaning (AddIcon, CloseIcon, WarningIcon), not their drawing. - [Motion](https://ui.squonkstack.io/?path=/docs/foundations-motion--docs): Motion is small and purposeful. - [Overview](https://ui.squonkstack.io/?path=/docs/foundations-overview--docs): SquonkUI is a small set of decisions applied the same way everywhere: one type family, one spacing scale, a handful of named shapes and colours, and components that already behave correctly for keyboards, screen readers and narrow screens. - [Purpose tokens](https://ui.squonkstack.io/?path=/docs/foundations-purpose-tokens--docs): A purpose token names why a value is there: "the gap between a label and its field", "the fill behind the current page in a nav list". - [Shape and elevation](https://ui.squonkstack.io/?path=/docs/foundations-shape-and-elevation--docs): Corners and shadows are named by role, so every control shares one shape and every floating panel one depth. - [Space and layout](https://ui.squonkstack.io/?path=/docs/foundations-space-and-layout--docs): Space comes from one scale built on an 8px step (the spacingPx primitive). - [Theme](https://ui.squonkstack.io/?path=/docs/foundations-theme--docs): The theme has three layers: - [Typography](https://ui.squonkstack.io/?path=/docs/foundations-typography--docs): One family, Inter, carries every heading and label. - [Getting started](https://ui.squonkstack.io/?path=/docs/get-started-getting-started--docs): Set up an app in one command, then build your first screen. - [Working with your agent](https://ui.squonkstack.io/?path=/docs/get-started-working-with-your-agent--docs): Coding agents build better UI when they know the library as well as you do. - [App navigation](https://ui.squonkstack.io/?path=/docs/patterns-app-navigation--docs): The frame around a signed-in app: where you are, where you can go, and how to get back. - [Cards and landing sections](https://ui.squonkstack.io/?path=/docs/patterns-cards-and-landing-sections--docs): A card is a surface that groups one thing. - [Choosing a selection control](https://ui.squonkstack.io/?path=/docs/patterns-choosing-a-selection-control--docs): RadioGroup keeps every option visible, so people can compare them without opening anything. - [Choosing components](https://ui.squonkstack.io/?path=/docs/patterns-choosing-components--docs): Which component should you use? - [Dashboards and summaries](https://ui.squonkstack.io/?path=/docs/patterns-dashboards-and-summaries--docs): An overview screen answers "what needs my attention, and how are things going?" in that order. - [Data visualization](https://ui.squonkstack.io/?path=/docs/patterns-data-visualization--docs): Start from the question people are asking of the data, then pick the form that answers it. - [Density and registers](https://ui.squonkstack.io/?path=/docs/patterns-density-and-registers--docs): A staff work queue and a public landing page need different sizes of the same controls. - [Destructive actions](https://ui.squonkstack.io/?path=/docs/patterns-destructive-actions--docs): When the action is permanent, or affects other people, ask first with ConfirmModal: - [Empty and error states](https://ui.squonkstack.io/?path=/docs/patterns-empty-and-error-states--docs): An empty screen is a message. - [Focus management](https://ui.squonkstack.io/?path=/docs/patterns-focus-management--docs): Keyboard and screen-reader users follow focus. - [Conditional and repeating fields](https://ui.squonkstack.io/?path=/docs/patterns-forms-conditional-and-repeating-fields--docs): Show follow-up questions with form.Subscribe, which re-renders only when the value it selects changes. - [Custom fields](https://ui.squonkstack.io/?path=/docs/patterns-forms-custom-fields--docs): For money, use the library's field.CurrencyField (CurrencyField); this page uses a whole-dollar amount only to show the technique. - [Multi-step forms](https://ui.squonkstack.io/?path=/docs/patterns-forms-multi-step-forms--docs): Split a long form when the steps are separate topics, or when a later step depends on an earlier answer. - [Overview](https://ui.squonkstack.io/?path=/docs/patterns-forms-overview--docs): Most of what we build is forms, so every form works the same way. - [Server errors](https://ui.squonkstack.io/?path=/docs/patterns-forms-server-errors--docs): Return the API's answer from validators.onSubmitAsync: - [The basics](https://ui.squonkstack.io/?path=/docs/patterns-forms-the-basics--docs): A form is a schema, a useAppForm call, and the fields inside form.AppForm: - [Validation](https://ui.squonkstack.io/?path=/docs/patterns-forms-validation--docs): A confirmation that must match, or an end date after a start date, is a rule on the whole object. - [Illustrations, icons and images](https://ui.squonkstack.io/?path=/docs/patterns-illustrations-icons-and-images--docs): Icons, illustrations and photographs do different jobs. - [Labels: Badge or Tag](https://ui.squonkstack.io/?path=/docs/patterns-labels-badge-or-tag--docs): Both are small labels, so they are easy to confuse. - [Labels, help and validation](https://ui.squonkstack.io/?path=/docs/patterns-labels-help-and-validation--docs): Give every TextField, Select, Checkbox and RadioGroup a visible label (or legend). - [Lists, tables and cards](https://ui.squonkstack.io/?path=/docs/patterns-lists-tables-and-cards--docs): The same records can be shown as a table, a list or a grid of cards. - [Loading and progress](https://ui.squonkstack.io/?path=/docs/patterns-loading-and-progress--docs): Waiting is part of every screen. - [Menus and commands](https://ui.squonkstack.io/?path=/docs/patterns-menus-and-commands--docs): A DropdownMenu holds a short list of things to **do** with an item. - [Onboarding and first run](https://ui.squonkstack.io/?path=/docs/patterns-onboarding-and-first-run--docs): The first visit is the screen with the least in it and the most riding on it. - [Overlays and disclosures](https://ui.squonkstack.io/?path=/docs/patterns-overlays-and-disclosures--docs): Pick the lightest surface that does the job. - [Overview](https://ui.squonkstack.io/?path=/docs/patterns-overview--docs): Patterns are the decisions that sit above a single component: which control to use, how a message should reach someone, what an empty screen should say. - [Page layouts and app shells](https://ui.squonkstack.io/?path=/docs/patterns-page-layouts-and-app-shells--docs): Most screens are one of a few shapes: a signed-in app with navigation, a page of content to read, a landing page made of bands, or a workspace of panels. - [Printing](https://ui.squonkstack.io/?path=/docs/patterns-printing--docs): Some pages are printed: statements, receipts, sighting reports, newsletters, a plan to sign. - [QR handoff](https://ui.squonkstack.io/?path=/docs/patterns-qr-handoff--docs): Use QrCode to move someone from a screen to their phone. - [Search, filtering and sorting](https://ui.squonkstack.io/?path=/docs/patterns-search-filtering-and-sorting--docs): People find things in three ways: they type what they know (search), they narrow a list by what it is (filter), or they put it in an order (sort). - [Settings and preferences](https://ui.squonkstack.io/?path=/docs/patterns-settings-and-preferences--docs): A settings page is a set of small, separate decisions that people come back to rarely and want to get right. - [Switches, checkboxes and saving](https://ui.squonkstack.io/?path=/docs/patterns-switches-checkboxes-and-saving--docs): A Switch turns something **on or off**. - [Tables and grids](https://ui.squonkstack.io/?path=/docs/patterns-tables-and-grids--docs): Table has two modes. - [Toasts, alerts and dialogs](https://ui.squonkstack.io/?path=/docs/patterns-toasts-alerts-and-dialogs--docs): A toast disappears, may appear far from where the user is looking, and is easy to miss with a screen magnifier. - [Writing for the interface](https://ui.squonkstack.io/?path=/docs/patterns-writing-for-the-interface--docs): The words are part of the design. ## Components - [Accordion](https://ui.squonkstack.io/?path=/docs/functional-accordion--docs) (`@squonkstack/ui/accordion`): Accordion stacks sections that open and close under their titles. - [Alert](https://ui.squonkstack.io/?path=/docs/functional-alert--docs) (`@squonkstack/ui/alert`): Alert surfaces a status message tied to a recent action or system state. - [AreaChart](https://ui.squonkstack.io/?path=/docs/functional-area-chart--docs) (`@squonkstack/ui/area-chart`): AreaChart shows a volume over an ordered axis, usually time: sightings logged per week, dues collected per month. - [AspectRatio](https://ui.squonkstack.io/?path=/docs/layout-primitives-aspectratio--docs) (`@squonkstack/ui/aspect-ratio`): AspectRatio locks its content to a fixed width-to-height ratio. - [Avatar](https://ui.squonkstack.io/?path=/docs/functional-avatar--docs) (`@squonkstack/ui/avatar`): Avatar represents a person — preferring a photo when available, falling back to initials when not. - [Badge](https://ui.squonkstack.io/?path=/docs/functional-badge--docs) (`@squonkstack/ui/badge`): Badge reports the state or count of the thing beside it: "Overdue", "Paid", "3". - [BarChart](https://ui.squonkstack.io/?path=/docs/functional-bar-chart--docs) (`@squonkstack/ui/bar-chart`): BarChart compares magnitudes across categories: dues invoiced by quarter, sightings logged by chapter, sightings under review by sighting type. - [Block](https://ui.squonkstack.io/?path=/docs/layout-primitives-block--docs) (`@squonkstack/ui/block`): Block is the universal styling primitive — a polymorphic
with theme-driven props for padding, background, radius, width, and border. - [Breadcrumb](https://ui.squonkstack.io/?path=/docs/functional-breadcrumb--docs) (`@squonkstack/ui/breadcrumb`): Breadcrumb shows where the current page sits in the site's hierarchy and links back up it. - [Button](https://ui.squonkstack.io/?path=/docs/functional-button--docs) (`@squonkstack/ui/button`): Button is the canonical action element — every click that mutates state, confirms a flow, or navigates the user should be a Button (or a Button with as="a" for navigation). - [Card](https://ui.squonkstack.io/?path=/docs/layout-card--docs) (`@squonkstack/ui/card`): Card is a themed visual container — background, border, radius, and shadow driven by variant. - [Centered](https://ui.squonkstack.io/?path=/docs/layout-primitives-centered--docs) (`@squonkstack/ui/centered`): Centered centers its children on both axes inside a flex container. - [Checkbox](https://ui.squonkstack.io/?path=/docs/functional-checkbox--docs) (`@squonkstack/ui/checkbox`): Checkbox is a controlled boolean input that styles a hidden native — you keep full keyboard and screen-reader behavior, plus a tick / dash visual that matches the rest of the library. - [CheckboxGroup](https://ui.squonkstack.io/?path=/docs/functional-checkboxgroup--docs) (`@squonkstack/ui/checkbox-group`): CheckboxGroup asks one question with several independent answers: "Which accounts do you want to set up?". - [Cluster](https://ui.squonkstack.io/?path=/docs/layout-cluster--docs) (`@squonkstack/ui/cluster`): Cluster is a wrapping horizontal flow for a group of small related items — tags, chips, breadcrumbs, button rows, badge sets. - [Code](https://ui.squonkstack.io/?path=/docs/functional-primitives-code--docs) (`@squonkstack/ui/code`): Code renders monospace text — inline by default for command names, file paths, and identifiers; or as a horizontally-scrolling block with block for code samples. - [Container](https://ui.squonkstack.io/?path=/docs/layout-primitives-container--docs) (`@squonkstack/ui/container`): Container caps content width and centers it horizontally. - [Currency](https://ui.squonkstack.io/?path=/docs/components-data-display-currency--docs) (`@squonkstack/ui/currency`): Currency shows an amount of money, formatted for its currency and locale with the currency's own decimal places: $1,234.50, £1,234.50, 1.234,50 €, ¥1,235. - [CurrencyField](https://ui.squonkstack.io/?path=/docs/components-inputs-currency-field--docs) (`@squonkstack/ui/currency-field`): CurrencyField is the input for an amount of money: a payment, a price, a figure on a dues statement. - [Divider](https://ui.squonkstack.io/?path=/docs/layout-primitives-divider--docs) (`@squonkstack/ui/divider`): A semantic separator between sibling content. - [DonutChart](https://ui.squonkstack.io/?path=/docs/functional-donut-chart--docs) (`@squonkstack/ui/donut-chart`): DonutChart shows how one whole splits into a few parts, as a ring with the total in the middle: dues collected by type, sightings verified against still under review. - [Drawer](https://ui.squonkstack.io/?path=/docs/functional-drawer--docs) (`@squonkstack/ui/drawer`): Drawer slides a panel in from the edge of the screen for a task or detail that needs more room than a Popover, while keeping the page beside it in view: editing a record from a list, a case's details, filters on a phone. - [DropdownMenu](https://ui.squonkstack.io/?path=/docs/functional-dropdown-menu--docs) (`@squonkstack/ui/dropdown-menu`): DropdownMenu is a trigger button with an attached menu of actions — the primitive behind user menus, row-action menus, and "…" overflow menus. - [EmptyState](https://ui.squonkstack.io/?path=/docs/layout-empty-state--docs) (`@squonkstack/ui/empty-state`): EmptyState is the centered "no data yet" composition: an optional illustration, a title, optional sub-copy, and an optional call-to-action. - [Fieldset](https://ui.squonkstack.io/?path=/docs/functional-fieldset--docs) (`@squonkstack/ui/fieldset`): Fieldset groups related fields under a legend: an address, contact details, a section of a long form. - [Footer](https://ui.squonkstack.io/?path=/docs/layout-footer--docs) (`@squonkstack/ui/footer`): Footer renders the bottom landmark of a page — semantic