# Zen > React components in dark glass: translucent surfaces, hairline borders that catch a pointer light, one accent colour. Tailwind v4, no runtime dependencies. ## Installation ```sh pnpm add @rinzai/zen ``` React 19 is the only peer dependency. **Using Tailwind CSS v4?** Add Zen's theme after Tailwind in your stylesheet. Your one Tailwind build then generates everything Zen's components use: ```css @import 'tailwindcss'; @import '@rinzai/zen/tailwind.css'; ``` **Not using Tailwind?** Import the complete stylesheet once, near the root of your app. It includes the default theme: ```js import '@rinzai/zen/css'; ``` Zen never styles your own elements. For its page setup (the background showing through), heading scale, inline code and quiet scrollbars, also add the optional base: ```css @import '@rinzai/zen/base.css'; ``` The look is set in [Geist](https://vercel.com/font); load it however you like. ## Usage ```tsx import { Backdrop, Button, Card, CardHeader, CardTitle } from '@rinzai/zen'; export default function App() { return ( <> Budget ); } ``` ## Props Every component takes `className`, and a class you pass always overrides the component's default. Other props (`id`, `aria-*`, `data-*`, handlers) and `ref` reach its element, and parts that render a link or button take `asChild` to use your own (a router's Link, say). Zen exports no icons. Use any icon set (the examples use [Heroicons](https://heroicons.com)) and pass icons in as elements, such as `icon={}`. ## Values and forms Controls report changes with `onValueChange` (`onCheckedChange` for Checkbox and Toggle). Pass `value` to control one, or `defaultValue` to let it keep its own. Give a control a `name` and it's submitted with its form, the custom ones (Combobox, the date pickers, MoneyInput, ColorPicker, TagInput…) included, and goes back to its first value when the form is reset. ## Languages and right to left ```tsx import { LocaleProvider } from '@rinzai/zen'; ; ``` The locale formats dates, numbers and money, and sets the week's first day. `messages` replaces any of the words Zen shows or announces (`ENGLISH` lists them all); the rest stay English. With `dir="rtl"` on the page or any element above, layout, arrow keys and chevrons mirror. ## Theming Dark is the default. Add the `light` class (or `data-theme="light"`) for the light palette. Colours are OKLCH `L C H` triplets; override any token in your own CSS: ```css :root { --primary: 0.72 0.13 200; /* teal instead of violet */ --glow: 0.7 0.13 200; } ``` Or generate a whole theme at runtime: ```ts import { applyPreset, applyTheme, DEFAULT_THEME } from '@rinzai/zen'; applyTheme(applyPreset(DEFAULT_THEME, 'ocean')); ``` ## Overlays For a page composited over something else, such as an OBS browser source, which never gets a pointer: ```html ``` `data-zen-glow="ambient"` sends the edge light round each glowing border by itself (on any element, it does so for what's inside). `data-zen-page="transparent"` paints nothing behind the content; it needs the base stylesheet. ## Browser support Chrome and Edge 114+, Safari 17+ and Firefox 128+: the versions with the native Popover API that popups, menus and toasts are built on, and with what Tailwind v4 needs. - **Popups** are placed with CSS anchor positioning where the browser has it (Chrome 129+, Safari 26+, recent Firefox). Elsewhere Zen places them itself, the same way. - **Glass** is blurred live where there's a GPU and a mouse. On touch screens, without hardware acceleration, and with the OS's "reduce transparency", surfaces are solid instead. - **Motion** such as entry animations is left out where a browser lacks it, and for anyone who prefers reduced motion. In a project with Zen installed, the same pages are in node_modules/@rinzai/zen/dist/docs, for the installed version. All of them in one file: https://zen.rinzai.dev/llms-full.txt. Showcase apps: a budget app at https://zen.rinzai.dev/showcase/ and a music player at https://zen.rinzai.dev/showcase/music/. ## Components - [Accordion](https://zen.rinzai.dev/docs/accordion.md): Sections under headings that open one at a time, or several: questions and answers, or groups of settings. - [Alert](https://zen.rinzai.dev/docs/alert.md): A notice, warning or failure beside what it is about: a tinted box, or a plain line in a form or card. - [Animated Number](https://zen.rinzai.dev/docs/animated-number.md): Numbers and amounts that count smoothly to each new value. - [Avatar](https://zen.rinzai.dev/docs/avatar.md): A round picture, or the name's initial on the glowing accent. With an in-browser crop for uploads. - [Backdrop](https://zen.rinzai.dev/docs/backdrop.md): The page background: aurora glows over contours or dots, and a light that follows the pointer and catches card edges, or drifts round them by itself on pages with no pointer. - [Badge](https://zen.rinzai.dev/docs/badge.md): A small label for status, counts and tags. - [Breadcrumbs](https://zen.rinzai.dev/docs/breadcrumbs.md): Where a page sits: its parents as links, then the page itself. Works with any router. - [Button](https://zen.rinzai.dev/docs/button.md): Actions, from the one glowing primary action to quiet ghost buttons. - [Button Group](https://zen.rinzai.dev/docs/button-group.md): Buttons joined into one, rounded only at the ends: a split button, or Previous, Today and Next. - [Calendar](https://zen.rinzai.dev/docs/calendar.md): A month grid to pick a date or a range, fully keyboard-driven, with limits, blocked days and a year view to jump far. - [Calendar Heatmap](https://zen.rinzai.dev/docs/calendar-heatmap.md): A month of days shaded by their value, like spending per day. - [Canvas](https://zen.rinzai.dev/docs/canvas.md): A fixed-size surface where items sit anywhere, like the cards of a stream overlay: drag, resize and select several, by pointer, touch or keyboard, with snapping, a grid, undo and a fit-to-width scale. - [Card](https://zen.rinzai.dev/docs/card.md): Glass panels for grouping content, and stats for single figures. - [Carousel](https://zen.rinzai.dev/docs/carousel.md): Slides in a row that snap as you swipe or scroll, with glass buttons and dots that light the current one beneath, and the arrow keys. Native scrolling, so it follows the finger exactly. - [Chart](https://zen.rinzai.dev/docs/chart.md): Areas, lines and bars on one axis, a donut and an allocation bar: plain SVG that draws itself in, with a crosshair tooltip, keyboard reading, a legend and a table for screen readers. - [Checkbox](https://zen.rinzai.dev/docs/checkbox.md): A native checkbox whose tick draws itself in, with a label, a description and a mixed state. - [Chip](https://zen.rinzai.dev/docs/chip.md): Small pressable buttons for quick picks beside a field, like common tenures. - [Code Block](https://zen.rinzai.dev/docs/code-block.md): Code with a copy button; bring your own highlighter for colours. The copy button runs on useCopyToClipboard, which you can use for copy buttons anywhere. - [Code Input](https://zen.rinzai.dev/docs/code-input.md): A one-time code, a box per character, that types, pastes and autofills from a text message like any field. - [Collapse](https://zen.rinzai.dev/docs/collapse.md): Shows as many items as fit on one line, and the rest behind "+N". - [Color Picker](https://zen.rinzai.dev/docs/color-picker.md): Pick a colour by eye or by hex: a saturation and brightness area, hue and opacity, and your own swatches. With hexToOklch to give a colour to the theme engine. - [Combobox](https://zen.rinzai.dev/docs/combobox.md): Search and pick one or several items of any shape, composed from parts: field, panel, search, a virtualized list, empty and create rows. - [Command Palette](https://zen.rinzai.dev/docs/command-palette.md): Search everything and act on it from the keyboard: a field over a list that narrows as you type, opened with ⌘K. - [Date Picker](https://zen.rinzai.dev/docs/date-picker.md): A field that opens a calendar: one date, or a range previewed as you point. Dates are "YYYY-MM-DD" strings, so they never shift with time zones. - [Dialog](https://zen.rinzai.dev/docs/dialog.md): Modal dialogs on the native element, sheets that slide in from an edge, and a confirmation for destructive actions. - [Disclosure](https://zen.rinzai.dev/docs/disclosure.md): A button that shows and hides a section, like finished goals under a list. - [Editable Cell](https://zen.rinzai.dev/docs/editable-cell.md): A value edited in place: shows the value, swaps in any editor on click or Enter. - [Empty State](https://zen.rinzai.dev/docs/empty-state.md): What a list or page shows when there's nothing in it yet, and the action that fills it. - [Field](https://zen.rinzai.dev/docs/field.md): A label, hint and error wired to their control for screen readers, and messages for a whole form. - [File Drop](https://zen.rinzai.dev/docs/file-drop.md): Somewhere to drop files, or click to choose them, that lights up as files are dragged over it. - [Filter Bar](https://zen.rinzai.dev/docs/filter-bar.md): The filters in effect, each removed with its ×, and Clear all. - [Header](https://zen.rinzai.dev/docs/header.md): A sticky glass bar across the top of the page. - [Hover Card](https://zen.rinzai.dev/docs/hover-card.md): A preview of what a link points to, like a person or an account: a glass card once the pointer rests on the link, or while it has keyboard focus. - [Icon Picker](https://zen.rinzai.dev/docs/icon-picker.md): An icon and a colour for something, like a spending category, from a grid in a popover. - [Input](https://zen.rinzai.dev/docs/input.md): Text fields in faint glass that glow on focus. - [Input Group](https://zen.rinzai.dev/docs/input-group.md): A field with slots: put symbols, icons, units, buttons or menus before and after the input. - [Inset](https://zen.rinzai.dev/docs/inset.md): A faint box set into a card: a tile for one figure, or a bordered panel for a result, tinted for good or bad news. - [Kbd](https://zen.rinzai.dev/docs/kbd.md): Keys on the keyboard, for shortcuts in hints and tooltips. - [Keypad](https://zen.rinzai.dev/docs/keypad.md): A number pad for typing an amount on a phone. - [Load More](https://zen.rinzai.dev/docs/load-more.md): The end of a long list that has more: loads the next page when it scrolls into view, or on a press. - [Locale Provider](https://zen.rinzai.dev/docs/locale-provider.md): The language for everything inside: how dates, numbers and money read, and every word components show or announce. Without it, "en-US" and English. - [Marquee](https://zen.rinzai.dev/docs/marquee.md): One line of text cut off with an ellipsis, that scrolls to show the rest on hover or focus (of itself or of its row), or all the time. Only text that doesn't fit moves. - [Menu](https://zen.rinzai.dev/docs/menu.md): A button that opens a menu, or a context menu from a right-click or long press, with your own trigger, a header, icons, groups, destructive items, checkbox and radio items, submenus, a bottom sheet on phones, and a menubar of menus. - [Meter](https://zen.rinzai.dev/docs/meter.md): A measure against a limit, like spend against a budget: warm near it, red past it. - [Money Input](https://zen.rinzai.dev/docs/money-input.md): Amounts in any currency and locale, with shorthand like 1.5L or 10k and sums like 120+45.50, exact to the paisa, and typed in other currencies, converted at your rates. Built on Input Group. - [Month Picker](https://zen.rinzai.dev/docs/month-picker.md): A field showing a month that opens a year and a 12-month grid, with optional limits and clearing. - [Navigation Menu](https://zen.rinzai.dev/docs/navigation-menu.md): A site’s navigation: links, and labels that open glass panels of links on hover or click, switching at once between them; works with any router. - [Number Field](https://zen.rinzai.dev/docs/number-field.md): A number to type or step with − and +, the arrow keys and Page Up and Down: shown the locale’s way, as a percentage or a unit, and kept within bounds. Each change says whether it was a step (and by how much) or typed, and onValueCommit fires once it’s finished. - [Page Header](https://zen.rinzai.dev/docs/page-header.md): Eyebrow, aurora title and lead paragraph for the top of a page. - [Page Transition](https://zen.rinzai.dev/docs/page-transition.md): The old page fades out as the new one rises in, when your router changes page in a view transition. - [Pagination](https://zen.rinzai.dev/docs/pagination.md): The pages a long list is split into, as buttons or links for your router. - [Pills](https://zen.rinzai.dev/docs/pills.md): A glass track with a glowing pill that slides to the current page. In a nav, it is site navigation; works with any router. - [Player Bar](https://zen.rinzai.dev/docs/player-bar.md): What's playing, along the bottom of the screen, sitting on a TabBar on phones. useMediaPlayer drives your own