corbel

React components styled with Tailwind CSS v4, themed entirely from your own @theme block.
- Your theme, no provider. Components use theme tokens (
bg-primary, text-text-secondary, …). Set the token in your CSS and every component follows.
- Override anything.
className is merged last with tailwind-merge, so className="bg-success" replaces the default instead of fighting it. Multi-part components also take classNames.
- Data in, events out. No component fetches data, uses a router or shows toasts. Pass arrays and callbacks, and wire your own API layer (RTK Query, React Query, fetch …).
- TypeScript and JavaScript. Written in TypeScript and shipped as plain ES modules with type definitions. TypeScript apps get full types, JavaScript apps just import.
- Accessible. Labelled fields,
aria-invalid/aria-describedby errors, focus-trapped dialogs, keyboard-operable tabs, lists and pickers.
- React 18 and 19 · Next.js App Router ready (
"use client") · tree-shakeable.
Installation
npm install corbel
Peer requirements: react 18 or 19, react-dom, and tailwindcss v4.
Setup
Add one line to your main CSS file, after Tailwind:
@import "tailwindcss";
@import "corbel/styles.css";
That import tells Tailwind to scan corbel's components and registers the default tokens. There's no config file and no provider.
Usage
import { Button, Input, Modal } from "corbel";
export function InviteUser() {
const [open, setOpen] = useState(false);
const [email, setEmail] = useState("");
return (
<>
<Button onClick={() => setOpen(true)}>Invite</Button>
<Modal
open={open}
onClose={() => setOpen(false)}
title="Invite a teammate"
footer={
<>
<Button variant="outline" onClick={() => setOpen(false)}>Cancel</Button>
<Button onClick={send}>Send invite</Button>
</>
}
>
<Input label="Email" type="email" required value={email} onChange={(e) => setEmail(e.target.value)} />
</Modal>
</>
);
}
Theming
Declare any token in your own @theme and it replaces corbel's default:
@import "tailwindcss";
@import "corbel/styles.css";
@theme {
--color-primary: #1b4f98;
--color-primary-dark: #163f7a;
--color-error: #e11d48;
}
To restyle one component, pass classes:
<Button className="rounded-full">Pill button</Button>
<Modal classNames={{ header: "bg-primary text-primary-contrast" }} />
See docs/theming.md for the full token list, dark mode, and how to map an existing theme.
Components
| Category |
Components |
| Inputs |
Button · Input · TextArea · Checkbox · Switch · RadioGroup · OtpInput · SearchBar · SegmentedControl · FileUploader · FormField & Label |
| Pickers & selection |
Dropdown · DatePicker · TimePicker · SearchSelectList · MultiSelectList |
| Data display |
Card · Avatar · Badge & StatusBadge · StatTile · Accordion · PhotoThumb |
| Tables & lists |
DataTable · Pagination · CardListView · InfiniteList · SortableList |
| Navigation |
PageHeader · BackLink · Tabs · SideTabs |
| Overlays |
Modal · Drawer · ConfirmDialog · Menu · Tooltip |
| Feedback |
Alert · Spinner, EmptyState, ErrorState · PageLoader, InlineLoader, LoadingDots · Skeleton · ErrorPage · ErrorBoundary |
| Rich text |
TextEditor (separate entry: corbel/editor) |
Rich-text editor
The editor is built on Tiptap and lives in its own entry point, so apps that don't use it never install Tiptap:
npm install @tiptap/react @tiptap/starter-kit @tiptap/extension-image @tiptap/extension-placeholder @tiptap/extension-text-align
import { TextEditor } from "corbel/editor";
Connecting your data
Components never call APIs, so they work with any data layer. A typical RTK Query page:
const [page, setPage] = useState(1);
const { data, isFetching, error, refetch } = useGetOrdersQuery({ page, limit: 20 });
<DataTable
columns={columns}
rows={data?.items ?? []}
getRowKey={(o) => o.id}
loading={isFetching}
error={error ? "Couldn't load orders." : undefined}
onRetry={refetch}
pagination={{ page, pageSize: 20, total: data?.total ?? 0, onPageChange: setPage }}
/>
Uploads work the same way: FileUploader calls your onUpload(file, { onProgress, signal }) and stores whatever it returns.
Forms
Field components forward refs and accept label, hint, error, required and optional, so they work with react-hook-form, Formik or plain state:
<Input label="Email" error={errors.email?.message} {...register("email")} />
Migrating from in-app components
Moving an app's own components/common folder onto corbel? See docs/migration.md for every renamed prop.
Versioning
corbel follows semantic versioning: patch for fixes, minor for new components and props, major for any breaking change.
Every release is listed in CHANGELOG.md.
Contributing
See CONTRIBUTING.md for setup, component conventions and the release process.
License
MIT