@fldr/ui
v0.3.18
Published
fldr's design system: Cloudflare Kumo with a theme authoring API and PandaCSS preset
Maintainers
Readme
@fldr/ui
fldr's React UI kit: accessible components, page-level blocks, and TanStack integrations, themed to fldr out of the box.
Kitchen sink →: every component, block and integration, live, with theme and dark-mode switches.
Built on Cloudflare Kumo (MIT): Base UI primitives for keyboard, focus and ARIA handling, styled with Tailwind v4 and semantic tokens.
Install
pnpm add @fldr/ui @phosphor-icons/reactReact 18 or 19 is required. Optional peers, only if you use their entry points: @tanstack/react-query (@fldr/ui/query), @tanstack/react-router (@fldr/ui/router), zod (schema validation in forms).
Set up
Load the styles once, then set the theme on <html>:
import "@fldr/ui/styles/standalone"; // precompiled CSS, no Tailwind needed
// or, if your app runs Tailwind v4: @import "@fldr/ui/styles"; in your CSS<html data-theme="fldr">
<!-- follows the system light/dark setting; add data-mode="light" or "dark" to force one -->
<body>
<div id="root" class="isolate"></div>
</body>
</html>Put data-theme and data-mode on <html>: popups portal to <body> and inherit them, and page-level styles (the body background, the Panda preset's tokens) resolve against them. Give your app root isolation: isolate.
What's in the box
| Import | What you get |
|---|---|
| @fldr/ui | Components: Button, Input, Select, Combobox, Checkbox, Switch, Tabs, LayerDialog, DropdownMenu, Popover, Tooltip, Toast, Table, Sidebar, DatePicker, CommandPalette and more |
| @fldr/ui/blocks | Pages and sections: LoginPage, DashboardPage, ErrorPage, AppShell, FileTable, FolderGrid, UploadDropzone, ShareDialog, ActivityFeed, StatGrid, SettingsSection, AuthCard, OnboardingChecklist |
| @fldr/ui/table | DataTable on TanStack Table + Virtual: sorting, selection with a bulk bar, column visibility, search, paging or virtual scrolling |
| @fldr/ui/form | useAppForm on TanStack Form, with fields pre-wired to fldr inputs and Standard Schema (zod) validation |
| @fldr/ui/query | QueryState (skeleton / error + retry / empty / data), useToastMutation, createFldrQueryClient for TanStack Query |
| @fldr/ui/router | Typed TanStack Router links styled as fldr links, buttons, sidebar items and breadcrumbs |
| @fldr/ui/hotkeys | TanStack Hotkeys plus Kbd, useShortcut, ⌘K for the command palette, and a ? shortcuts dialog |
| @fldr/ui/brands | Official full-colour company logos from svgl (Google, Apple, Microsoft, GitHub, Slack…). Apple, GitHub and X follow dark mode. Phosphor's redrawn *LogoIcon marks are banned by lint |
| @fldr/ui/stickers | InsideSticker: "fldr inside" badge stickers from eight generations that roll onto the page, with holographic foil and a pointer-following sheen |
| @fldr/ui/skeleton | skullet skeletons that measure your real component, themed to fldr |
| @fldr/ui/code | CodeHighlighted and highlightCode on TanStack Highlight, server or client |
| @fldr/ui/theming | defineTheme, extendTheme, generateThemeCSS and the built-in fldr themes |
| @fldr/ui/panda | A PandaCSS preset mapping fldr tokens to Panda semantic tokens |
Examples
import { Button, LayerDialog } from "@fldr/ui";
import { FileTable } from "@fldr/ui/blocks";
import { QueryState } from "@fldr/ui/query";
const files = useQuery({ queryKey: ["files", folderId], queryFn: fetchFiles });
<QueryState query={files} sample={SAMPLE_FILES}>
{(files) => (
<FileTable
items={files}
onOpen={(file) => navigate(file.id)}
actions={[{ label: "Delete", variant: "danger", onSelect: remove }]}
bulkActions={(ids) => <Button size="sm" onClick={() => share(ids)}>Share</Button>}
/>
)}
</QueryState>import { useAppForm } from "@fldr/ui/form";
import { z } from "zod";
const form = useAppForm({
defaultValues: { name: "", email: "" },
validators: { onChange: z.object({ name: z.string().min(1), email: z.email() }) },
onSubmit: ({ value }) => invite(value),
});Every block takes data and callbacks; none of them fetch. Labels can be overridden for translation through a labels prop.
Themes
Six built-in themes ship in the stylesheet: fldr (Kumo blue on warm graphite) and the accents fldr-violet, fldr-green, fldr-orange, fldr-rose and fldr-ink. Kumo's own kumo and fedramp themes are still there.
Make your own with defineTheme() or extendTheme(), then generate CSS in code or with the CLI (pnpm exec kumo theme my-theme.ts -o my-theme.css). See THEMING.md.
Component reference
pnpm exec kumo ls # list components and blocks
pnpm exec kumo doc Button # props and examples for one component
pnpm exec kumo add file-table # copy a block's source into your app to customiseKumo's documentation at kumo-ui.com covers the shared components in depth.
Versioning
Every push to main that touches the package publishes the next patch. Breaking changes are called out in the changelog.
License
MIT. Based on Cloudflare Kumo, also MIT.
