The repo moved from a local Gitea to a public one at git.openkhalix.com, renamed ui-showcase to tansy-ui. Add the repository and bugs fields so the npm page links to the source and its issue tracker, and record it under Unreleased for 0.4.1.
Tansy UI
A themeable, accessible React component kit by OpenKhalix, built on Base UI and Tailwind CSS v4.
- 38 components: forms with floating labels, selects and comboboxes, dialogs, drawers, menus, tabs, toasts, tables and more.
- Accessible: keyboard support and screen-reader wiring from Base UI, visible focus rings, and every story checked with axe in light and dark mode.
- Themeable: seven palettes switchable at runtime, class-based dark mode, and one semantic token set.
- One API:
color,variantandsizeon everything;label,descriptionanderroron every field; controlled or uncontrolled values.
Docs and live examples: https://ui.openkhalix.com/docs/
Install
npm install @openkhalix/tansy-ui
Needs React 19. @base-ui/react, lucide-react, clsx and tailwind-merge install with it.
Add the styles
Pick one of the two setups.
With Tailwind CSS v4 (recommended)
Import the tokens after Tailwind, and let Tailwind scan the package for the classes it uses:
/* app.css */
@import "tailwindcss";
@import "@openkhalix/tansy-ui/tokens.css";
@source "../node_modules/@openkhalix/tansy-ui/dist";
Your own Tailwind utilities can then use the same tokens (bg-surface, text-fg, bg-primary-500).
Without Tailwind
Import the prebuilt stylesheet once, for example in your entry file:
import '@openkhalix/tansy-ui/styles.css'
It contains the tokens, only the utilities the components use, and a modern CSS reset (Tailwind's
preflight), which the components rely on, much as MUI relies on CssBaseline. The reset normalises
margins, borders and form controls across your app. If you already use Tailwind, use the setup above
instead.
Use
import { Mail } from 'lucide-react'
import { Button, FeaturedInput, Select, Switch } from '@openkhalix/tansy-ui'
export function InviteForm() {
return (
<form className="grid max-w-sm gap-5">
<FeaturedInput label="Work email" type="email" startIcon={<Mail />} required />
<Select
label="Team"
options={[
{ value: 'design', label: 'Design' },
{ value: 'engineering', label: 'Engineering' },
]}
/>
<Switch label="Send a welcome email" defaultChecked />
<Button type="submit">Send invite</Button>
</form>
)
}
Next.js
Components are marked "use client", so you can import them straight into Server Components. Helpers such
as cn and applyPalette stay server-safe.
Dark mode and palettes
import { applyPalette } from '@openkhalix/tansy-ui'
document.documentElement.classList.toggle('dark', true) // dark mode
applyPalette(document.documentElement, 'emerald') // classicBlue, emerald, violet, amber, crimson, slate, teal
Apply a palette to <html> so popups, which render in a portal, pick it up too.
Components
| Group | Components |
|---|---|
| Actions | Button, IconButton, LinkButton, ToggleGroup, Toggle |
| Forms | Field, Input, FeaturedInput, TextArea, FeaturedTextArea, NumberInput, Select, FeaturedSelect, Combobox, NativeSelect, Checkbox, CheckboxGroup, Radio, Switch, Slider |
| Overlays | Dialog (Modal), AlertDialog, Drawer (Sheet), Popover, Tooltip, InfoTip, DropdownMenu |
| Navigation | Tabs, Accordion, Breadcrumb, Pagination |
| Feedback | Alert, Toast (Toaster, useToast), Spinner, Progress, Meter, Skeleton |
| Display | Badge, CountBadge, Avatar, AvatarGroup, Kbd, Table |
| Layout | Card, Separator |
Every component has a Storybook page with its props, controls and a story for each state: https://ui.openkhalix.com/docs/
Licence and credit
MIT © OpenKhalix. Use it, fork it, and ship it in commercial products, free. The licence's only condition is that you keep the copyright notice in copies of the code.
If Tansy UI helps you, a visible credit such as "UI by Tansy UI" in your README or site footer is much appreciated. It isn't required.