# Zenos documentation
> The complete text of the published Zenos docs, including code samples.
Index: https://zenos-ui.pages.dev/llms.txt
# Zenos
Install accessible React components and copy editable recipes into your app.
The published documentation starts with installation, foundations, components, layout, hooks, and recipes. Coding agents should read Working with AI, then use the installed `zenos component` and `zenos docs` commands for the version an application depends on.
Source: https://zenos-ui.pages.dev/
---
# Introduction
Meet Zenos, a React UI kit for building dashboards, forms, and product interfaces.
Zenos UI and CLI are public npm packages under the `@zentara-co` scope. Installation does not require repository access or a token.
Zenos gives you ready-made React components for product interfaces: buttons, forms, dialogs, navigation, tables, and responsive layouts. They share the same styles and interaction patterns, so you can build a consistent app without starting every control from scratch.
It is a good fit for dashboards, admin tools, and internal applications. You need a React 19 project to use it.
What goes into your app:
Start with the UI package. Add recipes when you need them.
1. **Zenos UI.** `Buttons, forms, dialogs, layouts, and styles`. Import ready-made components from @zentara-co/zenos-ui.
2. **Optional recipes.** `Date pickers, charts, file uploads, and more`. The CLI copies files into your app and installs their extra dependencies.
3. **Your application.** `Pages, data, validation, and save actions`. Combine the pieces and connect them to your product's behavior.
## Start with one package
Install `@zentara-co/zenos-ui` and load its stylesheet. Components, layout helpers, and hooks all come from the same import:
```tsx
import { Button, Stack, Text } from "@zentara-co/zenos-ui";
export function Welcome() {
return (
Your next project
);
}
```
[Follow Installation](/getting-started/installation/) to install the packages, add the styles, and render your first button. Already installed? [Build the Quick Start form](/getting-started/quick-start/).
## What you can build
- **Forms and settings:** combine [Field](/components/field/), [Input](/components/input/), [Select](/components/select/), and [Button](/components/button/).
- **Application pages:** arrange content with [Stack](/layout/stack/), [Grid](/layout/grid/), and [AppShell](/layout/app-shell/).
- **Interactive flows:** use [Dialog](/components/dialog/), [DropdownMenu](/components/dropdown-menu/), and [Toast](/components/toast/).
- **Specialized features:** add a [Calendar](/recipes/calendar/), [Chart](/recipes/chart/), or [Data Table](/recipes/data-table/) recipe when you need one.
A **recipe** is editable source copied into your app by the [CLI](/getting-started/cli/). It installs the extra library that feature needs. Regular components come from the UI package; recipes come from your local files after installation.
## Make it fit your app
Use component props for common choices, such as `variant="primary"` or `size="sm"`. Use layout props for spacing and alignment. For your brand's colors, fonts, and corners, change the [theme tokens](/foundations/tokens/), which are named CSS variables shared by the components.
You can also use `className`, `style`, and native HTML attributes for local changes. Zenos includes compiled CSS, so Tailwind is optional in your app.
## Your app still owns the behavior
Zenos supplies controls, layout, styling, and keyboard and focus behavior for its interactive components. Your app supplies the data and decides what happens when someone saves a form or opens a page.
For example, `Field` connects a label and error message to an `Input`. You decide which values are valid and how to save them. Provide meaningful labels and test the complete flow with a keyboard.
Useful API conventions as you learn
- `value`, `defaultValue`, and `onValueChange` manage value state where supported.
- `open`, `defaultOpen`, and `onOpenChange` manage dialogs and other overlays.
- `as` changes the HTML element rendered by a layout component.
- `render` composes a control with a Base UI-backed component, such as `Field.Control`.
- `disabled`, `required`, and `invalid` describe control state where supported.
- `data-slot` identifies rendered parts for inspection.
Use `defaultValue` when a component can manage its own value. Use `value` and `onValueChange` when your app needs to manage it. Each component's documentation lists the props it supports.
Complex interactions build on Base UI and native HTML behavior. Import Zenos components through `@zentara-co/zenos-ui`; the package's internal files are not a supported API.
## Choose your next step
1. **New project:** [Installation](/getting-started/installation/) gets your first component on screen.
2. **Ready to build:** [Quick Start](/getting-started/quick-start/) gives you a form to copy and adapt.
3. **Using an AI assistant:** [Working with AI](/getting-started/working-with-ai/) sets up the instructions it needs.
For deeper configuration, see [Project Setup](/getting-started/project-setup/) and [Foundations](/foundations/).
Source: https://zenos-ui.pages.dev/getting-started/introduction/
---
# Installation
Create an app from the Zenos starter template, or install Zenos in an existing React app.
Create a new app from the Zenos starter template, or add Zenos to an existing React 19 app using the manual installation steps below.
## Create an app from the starter template
Run the starter executable with Bun or npm:
```sh title="Bun"
bunx @zentara-co/create-zenos-app@latest
```
```sh title="npm"
npx @zentara-co/create-zenos-app@latest
```
For an existing app, follow the installation steps below.
From install to your first button:
Check the requirements, install the tools, then check your React app.
1. **Check your setup.** `React 19 + an ESM bundler`. Install from public npm without a token or repository access.
2. **Install the UI and CLI.** `@zentara-co/zenos-ui + @zentara-co/zenos-cli`. Add the UI to dependencies and the CLI to development dependencies.
3. **Style and check your app.** `@import → index.css → your app`. Import Zenos CSS in index.css, load that file once, then check a button and its keyboard focus.
## Before you begin
Zenos UI and CLI are public npm packages under the `@zentara-co` scope. Installation does not require repository access or a token.
You need React and React DOM `19.x`, plus a framework or bundler that supports ESM and CSS imports. Vite, Next.js, Astro with React, React Router, and TanStack Start are supported setups. TypeScript `5.x` is recommended.
## 1. Install the UI
Install directly from the public npm registry. No login or token is needed.
Run this in the folder containing your app's `package.json`. Choose the package manager your project uses:
```bash
pnpm add @zentara-co/zenos-ui
npm install @zentara-co/zenos-ui
yarn add @zentara-co/zenos-ui
bun add @zentara-co/zenos-ui
```
In a monorepo, install it in the package that renders React. Zenos includes its component dependencies; you do not need to install Base UI separately.
Run the CLI directly with `bunx`, `npx`, `pnpm dlx`, or `yarn dlx`, without installing it in your project (Node.js 20 or newer is required):
```bash
pnpm dlx @zentara-co/zenos-cli --help
npx @zentara-co/zenos-cli --help
yarn dlx @zentara-co/zenos-cli --help
bunx @zentara-co/zenos-cli --help
```
The CLI provides component lookups, AI instructions, and recipe installation. See the [CLI guide](/getting-started/cli/) for commands.
Migrating from GitHub Packages?
If you previously installed Zenos from GitHub Packages, remove its `@zentara-co` registry mapping and token line from your project's and user-level `.npmrc`. If you use a custom default registry, add this scope mapping:
```ini title=".npmrc"
@zentara-co:registry=https://registry.npmjs.org
```
Update existing lockfile entries that still resolve Zenos packages from GitHub Packages.
## 2. Load the styles
Put Zenos stylesheet imports in your application's global `index.css`. Import that local CSS file once from your framework entry or root layout. Keep package CSS imports out of component and `.tsx` files.
For a Tailwind CSS v4 application, put these imports at the top of `index.css`, before your own rules:
```css title="src/index.css"
@import "tailwindcss";
@import "@zentara-co/zenos-ui/tailwind.css";
```
This CSS entrypoint exposes Zenos theme utilities and custom variants to Tailwind CSS IntelliSense. The compiled `styles.css` entrypoint supplies runtime styles but does not register Zenos' Tailwind design metadata with the editor. Use `tailwind.css` for Tailwind projects, and load it through CSS rather than importing it directly from JavaScript or TypeScript.
Tailwind must already be installed and configured for your framework. No Zenos package source scanning or additional Tailwind configuration is required. If suggestions are missing, follow [Troubleshoot IntelliSense](/getting-started/project-setup/#troubleshoot-intellisense).
My app does not use Tailwind CSS
Use the compiled stylesheet in `index.css` instead:
```css title="src/index.css"
@import "@zentara-co/zenos-ui/styles.css";
```
Add your own CSS rules below the import. This stylesheet includes the component styles, layout helpers, and theme tokens without requiring Tailwind.
Choose one setup. Do not import `styles.css` together with `tailwind.css`, and remove any separate package CSS import from `.tsx` files. Global CSS also styles menus and dialogs that render outside the component that opened them.
### Connect index.css to your framework
The examples below use `index.css` as the global stylesheet. Keep existing application code and move your shared CSS rules into that file when changing its name.
Vite — src/main.tsx
Put the CSS imports above in `src/index.css`, then load that file:
```tsx title="src/main.tsx"
import "./index.css";
```
The React app is already interactive. Keep the existing `createRoot` setup below this import.
Next.js — app/layout.tsx
Put the CSS imports above in `app/index.css`, then load that file:
```tsx title="app/layout.tsx"
import "./index.css";
```
Keep the root layout on the server. Put `"use client"` at the top of a component file when it owns state or event handlers, such as the form in Quick Start. For the Pages Router, load the same global stylesheet from `pages/_app.tsx` using its relative path.
Astro with React — your shared .astro layout
Put the CSS imports above in `src/styles/index.css`, then load that file in the layout's frontmatter:
```astro title="src/layouts/AppLayout.astro"
---
import "../styles/index.css";
---
```
Astro renders React components as HTML by default. To make a form or dialog interactive, import it into an Astro page and add `client:load`:
```astro title="src/pages/index.astro"
---
import AppLayout from "../layouts/AppLayout.astro";
import ProjectForm from "../components/ProjectForm";
---
```
This assumes your shared layout renders a `` and the [React integration](https://docs.astro.build/en/guides/integrations-guide/react/) is installed. Keep static content unhydrated; use `client:idle` or `client:visible` for interactions that can wait.
React Router Framework Mode — app/root.tsx
Put the CSS imports above in `app/index.css`, then load that file:
```tsx title="app/root.tsx"
import "./index.css";
```
Keep your existing document, ``, ``, and ``. The root route loads these styles for every page. See the [React Router styling guide](https://reactrouter.com/explanation/styling) for route stylesheet links.
TanStack Start — src/routes/__root.tsx
Put the CSS imports above in `src/index.css`, then load that file:
```tsx title="src/routes/__root.tsx"
import "../index.css";
```
Keep the root document's `` and ``. See the [TanStack Start styling guide](https://tanstack.com/start/latest/docs/framework/react/guide/css-styling) for stylesheet links when your setup requires them.
## 3. Check your first component
Render this component on a page in your app:
```tsx title="Welcome.tsx"
import { Button } from "@zentara-co/zenos-ui";
export default function Welcome() {
return ;
}
```
Start your app with its usual development command and open that page. You should see a styled primary button. Press Tab to check its visible focus outline. This button checks the installation; it has no click action yet.
Run your app's type check and production build before continuing to [Quick Start](/getting-started/quick-start/), where you will add a working form.
## Optional finishing touches
Match the fonts in the docs
Zenos uses SUSE, Albert Sans, and Geist Mono font stacks. The package does not download the fonts for you. Load them through your framework or self-host them; system fonts work as fallbacks.
See [Fonts](/foundations/fonts/) for setup and supported weights.
Add dark mode
Zenos supports `.dark` or `data-theme="dark"` on the document root. Use [ThemeToggleButton](/components/theme-toggle-button/) or [useTheme](/hooks/use-theme/) if Zenos should manage the preference.
For server-rendered apps, apply the saved theme before the page is painted. Use the same storage key everywhere (`theme` by default). If another provider owns the theme, share that key or disable Zenos persistence with `storageKey={null}`. See [Dark mode](/foundations/dark-mode/) for the full example.
Keep browser-only reads such as `localStorage` out of server rendering. The server and client should initially render the same content.
Add recipes or AI instructions
The CLI can copy recipes into your app and create instructions for your AI assistant. Start with the [CLI guide](/getting-started/cli/) or [Working with AI](/getting-started/working-with-ai/).
Calendar, Carousel, Chart, Data Table, and File Upload bring their extra dependencies only when you install those recipes.
## If something goes wrong
- **401, 403, or package not found:** check that the `@zentara-co` scope resolves to `https://registry.npmjs.org`, remove any old GitHub Packages mapping, and confirm the requested version exists on npm.
- **The button is unstyled:** check that your entry or root layout loads `index.css` and that its Zenos import appears before your own CSS rules.
- **Tailwind suggestions are missing:** use `@import "tailwindcss"` and `@import "@zentara-co/zenos-ui/tailwind.css"` in `index.css`, then check the [IntelliSense setup](/getting-started/project-setup/#troubleshoot-intellisense).
- **Menus or dialogs are unstyled:** load the stylesheet globally, so it also covers content rendered elsewhere in the document.
- **Astro controls do not respond:** add a client directive to the React component that owns the interaction.
- **A server-rendering or hydration error appears:** check the framework's client boundary and remove browser-only reads from server rendering.
Need application configuration next? Continue to [Project Setup](/getting-started/project-setup/).
Source: https://zenos-ui.pages.dev/getting-started/installation/
---
# Quick Start
Try a project form, copy its code, and adapt it to your app.
Build a project form with a name, region, notes, and a submit button. This example shows a confirmation message in the browser; it does not save to a server.
First, complete [Installation](/getting-started/installation/). You should already be able to render a styled Zenos button.
Try it, copy it, make it yours:
One working form takes you through the basics.
1. **Try the preview.** `Enter a name → submit → see confirmation`. Test the form below before changing anything.
2. **Copy the code.** `Code tab → ProjectForm.tsx → your page`. Use the same source that powers the preview.
3. **Connect your app.** `Your fields + validation + save action`. The demo confirms locally. Your app decides how to save real data.
## 1. Try the form
Enter a project name, choose a region, and select **Create project**. You should see “Project created locally.” without a page reload.
```tsx
import { Button, Field, FormLayout, Input, Select, Text, Textarea } from "@zentara-co/zenos-ui";
import { type SubmitEvent, useState } from "react";
function FormExample() {
const [created, setCreated] = useState(false);
return (
) => {
event.preventDefault();
setCreated(true);
}}
>
Project name}
/>
Use a name your team will recognize.RegionSingaporeFrankfurtNotes} />
{created ? "Project created locally." : ""}
);
}
```
The name is required. Try submitting with it empty, then use Tab and the arrow keys to move through the form and select a region.
## 2. Add it to your app
Open **Code** in the preview and copy the example into a component file, such as `src/ProjectForm.tsx`. The displayed code comes from the same source as the working preview.
Add this line at the end of the copied file so another file can import it:
```tsx
export default FormExample;
```
Then render it from your page. For a Vite app, your `src/App.tsx` could be:
```tsx title="src/App.tsx"
import ProjectForm from "./ProjectForm";
export default function App() {
return ;
}
```
In Next.js, add `"use client"` at the top of the form file because it uses React state. In Astro, render the form with `client:load`. The [framework setup examples](/getting-started/installation/#2-load-the-styles) show where styles and client boundaries belong.
## 3. Make it yours
Start with the labels, placeholders, and region choices. Then replace the example's `setCreated(true)` with your app's save operation, including loading and error states.
The form is built from a few pieces:
- **FormLayout** arranges the fields in one column, then two from the `md` breakpoint.
- **Field** connects a label, input, description, and any error message.
- **Input, Select, and Textarea** let people enter and choose values.
- **Button** submits the form. **Text** announces the local confirmation.
How does a label connect to an input?
Keep the control inside its `Field.Root`. `Field.Control` passes the field's ID, required state, and accessible relationships to the `Input` through `render`:
```tsx
Project name} />
Use a name your team will recognize.
```
Add your application's validation rules when connecting a real save operation. Use `invalid` and `Field.Error` to display an error that explains how to fix the value. See [Field](/components/field/) for the full API.
How do I change the columns or spacing?
Change the layout props on the form:
```tsx
{/* Fields and actions */}
```
`base: 1` means one column on smaller screens. `md: 2` means two columns from the medium breakpoint. `gap="4"` uses the spacing scale.
The preview also uses a few Tailwind classes for width, alignment, and the Notes field's span. If your app does not use Tailwind, replace those classes with your own CSS. Zenos components and responsive layout props work with the package stylesheet alone.
See [FormLayout](/layout/form-layout/) and [Layout composition](/layout/composition/) for more layouts.
When should my app manage a field's value?
The example's Select uses `defaultValue="singapore"`, so it manages the selected region itself. Use `value` with `onValueChange` when your app needs to read, reset, or coordinate that selection. See the [controlled Select example](/components/select/).
Native inputs such as `Input` use their normal React props, including `value` and `onChange`. Keep your save logic and validation in your form or feature code.
## Check your version
Before connecting real data:
1. Submit a filled form and confirm it updates without reloading the page.
2. Use only the keyboard to enter values, choose a region, and submit.
3. Resize the page and check that fields remain readable and in the right order.
4. Check both themes if your app supports dark mode.
5. Run your app's tests, type check, and production build.
Next, try [Dialog](/components/dialog/) for an edit flow, [AppShell](/layout/app-shell/) for a full page, or [Working with AI](/getting-started/working-with-ai/) to give your assistant the Zenos context.
Source: https://zenos-ui.pages.dev/getting-started/quick-start/
---
# Project Setup
Set up shared styles, imports, and optional themes for your Zenos app.
Once your first component works, set up the defaults that every page will share. This guide covers where styles belong, how to import components, and what to check before building more screens.
Complete [Installation](/getting-started/installation/) first. Keep the files your framework created and add the settings you need below.
Set up once, use across your pages:
Start with shared styles and imports, then check them in your app.
1. **Load shared styles.** `Tailwind + Zenos CSS → index.css`. Load the package styles once, followed by your own rules.
2. **Use public imports.** `UI package → components, layouts, and hooks`. Use the package root. Installed recipes come from your local files.
3. **Check a real page.** `Styles + keyboard + theme + build`. Try the controls, check any theme changes, and build your app.
## 1. Keep styles in one place
Use `index.css` as the global stylesheet and keep all package CSS imports there. Your framework entry or root layout imports only this local file. The [Installation examples](/getting-started/installation/#connect-indexcss-to-your-framework) show the path for each framework.
For Tailwind CSS v4, start `src/index.css` with these imports, then add shared rules and theme overrides:
```css title="src/index.css"
@import "tailwindcss";
@import "@zentara-co/zenos-ui/tailwind.css";
body {
margin: 0;
background: var(--background-default);
color: var(--text-default);
}
```
Load that file once from your application entry:
```tsx title="src/main.tsx (style import)"
import "./index.css";
```
Remove any direct Zenos CSS import from `.tsx` files. Loading CSS globally also styles menus and dialogs that appear outside the component that opened them.
My app does not use Tailwind CSS
Replace the two Tailwind imports with the compiled stylesheet import at the top of `index.css`:
```css title="src/index.css"
@import "@zentara-co/zenos-ui/styles.css";
```
Keep your shared rules below that import. Tailwind is optional with this setup.
### Troubleshoot IntelliSense
Tailwind CSS IntelliSense discovers a Tailwind v4 project through a CSS file that imports Tailwind. Zenos' `tailwind.css` entrypoint also exposes its theme and custom variants to the compiler and editor. Importing the compiled `styles.css` from a `.tsx` file does not provide that metadata.
If Zenos suggestions still do not appear:
1. Confirm that `tailwindcss` v4 is installed and configured in the application workspace, and the Tailwind CSS IntelliSense extension is enabled.
2. Confirm that `index.css` contains both `@import "tailwindcss"` and `@import "@zentara-co/zenos-ui/tailwind.css"`, and that your application entry loads this CSS file.
3. In VS Code or Cursor, run **Tailwind CSS: Show Output** and confirm that `index.css` was detected as the project entrypoint.
If automatic detection fails, set the CSS entrypoint explicitly:
```json title=".vscode/settings.json (setting to merge)"
{
"tailwindCSS.experimental.configFile": "src/index.css"
}
```
Use your framework's actual `index.css` path. For multiple entrypoints, follow the [Tailwind CSS IntelliSense configuration guide](https://github.com/tailwindlabs/tailwindcss-intellisense#tailwindcssexperimentalconfigfile). You do not need to add Zenos package source to Tailwind's scan paths. Do not load the compiled `styles.css` and Tailwind-native `tailwind.css` entrypoints together.
## 2. Use the public imports
Components, layout helpers, hooks, and types come from the package root:
```tsx
import { Button, Stack, type ButtonProps } from "@zentara-co/zenos-ui";
```
Your editor can suggest props and report mistakes using the included TypeScript declarations. Use the component's docs to see its supported props. Package `src` paths and repository files are private implementation details.
Recipes, such as Calendar or Data Table, are different: the CLI copies their source into your app. Import a recipe from the local path printed by the installer. See the [CLI guide](/getting-started/cli/#add-a-recipe) when you need one.
### Bundle behavior
Zenos publishes unbundled ES modules so your bundler can remove components and utilities that your application does not import. The JavaScript modules are side-effect free. Use named imports from the package root:
```tsx
import { Button } from "@zentara-co/zenos-ui";
```
CSS files are intentionally marked as side effects so an explicit stylesheet import is preserved. Load either the compiled `@zentara-co/zenos-ui/styles.css` entrypoint or the Tailwind-native `@zentara-co/zenos-ui/tailwind.css` entrypoint once; do not load both. Importing a component does not inject styles or change global browser state.
Check my TypeScript settings
Keep your framework's generated configuration. In the config used by your app, enable strict checking if it is not already enabled:
```json title="tsconfig.json (setting to merge)"
{
"compilerOptions": {
"strict": true
}
}
```
Merge this setting into the existing file. Preserve its `extends`, JSX settings, environment types, aliases, plugins, and project references. Some projects keep app settings in `tsconfig.app.json` or an inherited config.
Use the React 19 types that match your React installation. Modern framework templates already configure module resolution and JSX; a Zenos-specific TypeScript preset is not needed.
Where should I put my own files?
For a small Vite app, start with the files you use:
```text
src/
├── App.tsx Your app's main component
├── components/ Components shared across pages
├── features/ Forms, data, and UI for each feature
├── index.css Global styles and theme overrides
└── main.tsx Existing React entry and index.css import
```
Keep your framework's route folders if it has them. Add folders when code needs a home; an empty folder for every possible concern is unnecessary.
In a monorepo, install Zenos in the app package that renders React. Keep feature-specific code beside that feature. See [File Organization](/getting-started/file-organization/) as your app grows.
## Optional: customize the theme
Zenos works with its default styles. Open the sections below if your app needs a theme switch or custom colors.
Add a light and dark theme switch
For a client-rendered React app, add this component to your header or settings page:
```tsx title="src/components/ThemeControl.tsx"
import { ThemeToggleButton } from "@zentara-co/zenos-ui";
export function ThemeControl() {
return ;
}
```
The button changes the document theme and saves the preference under the storage key `theme`. Switch it, reload the page, and confirm the selected theme stays active.
For server-rendered apps, keep the root layout on the server and put interactive controls inside the framework's client boundary. Apply the initial theme in the document head before the page is painted to avoid a flash. Follow [Dark mode](/foundations/dark-mode/#prevent-a-theme-flash) for the initialization script and [useTheme](/hooks/use-theme/) for server-rendering considerations.
Use the same storage key in that script and every theme control. If your app already has a theme provider, pass its `theme` and `onThemeChange` values to `ThemeToggleButton`. That provider should apply the theme to the document and manage persistence.
Change the app's colors
Add token overrides to the `index.css` file that loads after Zenos. A token is a named CSS variable used by multiple components:
```css title="src/index.css (add below imports)"
:root {
--background-default: #ffffff;
--text-default: #171717;
--border-default: rgb(23 23 23 / 10%);
}
:root.dark,
:root[data-theme="dark"] {
--background-default: #101010;
--text-default: #f5f5f5;
--border-default: rgb(255 255 255 / 12%);
}
```
These variables change the page colors used in step 1 and components that use those same roles. Other surfaces and button variants have their own tokens. See [Theme customization](/foundations/tokens/) and [Colors](/foundations/colors/) for the full set.
Use tokens for changes shared across your app, and `className` or `style` for a local adjustment. Check text, borders, and focus indicators in both themes after changing colors.
Add an editable recipe
Preview a Calendar installation from your app's folder. The [CLI](/getting-started/cli/#start-here) runs directly without a project installation:
```bash
pnpm dlx @zentara-co/zenos-cli add calendar --dry-run
npx @zentara-co/zenos-cli add calendar --dry-run
yarn dlx @zentara-co/zenos-cli add calendar --dry-run
bunx @zentara-co/zenos-cli add calendar --dry-run
```
The preview reports the planned changes without modifying your app. When the destination and dependencies look right, run:
```bash
pnpm dlx @zentara-co/zenos-cli add calendar
npx @zentara-co/zenos-cli add calendar
yarn dlx @zentara-co/zenos-cli add calendar
bunx @zentara-co/zenos-cli add calendar
```
The CLI copies editable source and installs the recipe's extra dependencies. Use the local import path in its output. See [Calendar](/recipes/calendar/) for examples and the [CLI guide](/getting-started/cli/) for destination and overwrite options.
## 3. Check a real page
Use the [Quick Start form](/getting-started/quick-start/) or a page you have already built:
1. **Open the page:** buttons, inputs, and page text should be styled.
2. **Use the keyboard:** Tab between controls and check that focus is visible. Open a Select or Dialog and confirm its popup is styled too.
3. **If you added dark mode:** switch themes and reload. The selected theme should remain active; check a second tab if you use shared persistence.
4. **Run your app's checks:** type-check and build with the scripts in your `package.json`. If you installed a recipe, render it from its local path too.
If styles are missing, check the global import first. If a theme resets, check the storage key and which provider owns it. If an import fails, check the package installation and the documented export.
Continue with [File Organization](/getting-started/file-organization/) to organize your feature code, or [Layout composition](/layout/composition/) to build your next screen.
Source: https://zenos-ui.pages.dev/getting-started/project-setup/
---
# File Organization
Decide where a file belongs, and let your AI follow the same rules.
Zenos works with your app's existing folders. Keep your framework's routes and naming conventions, then place new code beside the feature that uses it.
You do not need to set up a folder template before building. If you use a coding assistant, the optional [Zenos development skill](/getting-started/working-with-ai/#add-the-development-skill) guides it through inspecting, building, and checking a feature.
Where should this file go?:
Follow the framework first, then choose the smallest owner.
1. **A route or page entry?.** `app/ or routes/`. Keep routing files where your framework expects them.
2. **Used by one feature?.** `features/projects/`. Keep its UI, requests, hooks, and tests together.
3. **Shared across features?.** `components/, hooks/, or lib/`. Share code when multiple features need the same behavior.
## Start with one feature
For a new app without an established structure, a project-management feature could look like this:
```text
src/
├── routes/ Framework route files
├── features/
│ └── projects/
│ ├── _components/
│ │ ├── project-form.tsx
│ │ └── project-form.test.tsx
│ ├── _api/
│ │ └── create-project.ts
│ ├── _hooks/
│ │ └── use-create-project.ts
│ └── index.ts Exports used outside this feature
├── components/ UI shared across features
└── index.css Global styles and theme overrides
```
The route displays the page. The feature owns its form, save request, and related state. Shared components receive data and callbacks from the feature.
Add folders as the code needs them. A small form may start in one file. Keep your router's actual folder name, and use the naming convention already in your app. Underscores mark private intent; they do not prevent imports by themselves.
## Keep feature details local
For example, a route can import a feature's public entry:
```tsx
import { ProjectForm } from "~/features/projects";
```
That entry explicitly exports what other code may use:
```ts title="src/features/projects/index.ts"
export { ProjectForm } from "./_components/project-form";
```
Use your app's configured alias; `~/` works only when your TypeScript and bundler configuration define it. Inside the feature, use relative imports. Other features should use the public entry instead of importing private files.
Move a component into the shared `components` folder when multiple features need the same behavior. Two uses inside the Projects feature still belong to Projects. Keep API calls and project-specific types out of generic shared UI.
Zenos components come from `@zentara-co/zenos-ui`. Installed recipes stay at the local destination printed by the CLI, such as `src/components/ui`. Feature components can use both.
## Let your AI follow the workflow
Install the [development skill](/getting-started/working-with-ai/#add-the-development-skill), then give your assistant a concrete task:
```text
Use zenos-app-development to add a project creation form.
Inspect our existing routes and features first. Reuse our save API
and validation, keep project-only code together, and check the form's
keyboard behavior and the app's tests.
```
The skill reads relevant CLI guidance, including `zenos docs organization --dense`, when structure matters. It follows an existing app's conventions and uses feature folders as a starting point for a new app.
Keep team-specific decisions in your project's AI instructions, outside the generated Zenos block. For example: “Use our existing routes folder and keep project-only components under the projects feature.” The skill supplements those instructions.
## Before you finish
Check that each new file has a clear owner, shared UI receives data through props, and imports respect feature boundaries. Run the app's checks and try the changed flow. Instructions guide the AI; the working result is what you review.
Continue with [Working with AI](/getting-started/working-with-ai/) for setup, or [Project Setup](/getting-started/project-setup/) for global styles and themes.
Source: https://zenos-ui.pages.dev/getting-started/file-organization/
---
# CLI
Use the Zenos command-line tool to find components, set up AI, and add editable recipes.
The CLI is a tool you run in your terminal. Use it to find a component, help your AI use Zenos, or add a ready-made feature such as a date picker.
Choose what you want to do:
- **Find a component:** `zenos component Dialog` → Import path + docs. Read the answer in your terminal.
- **Set up your AI:** `zenos init --features agents` → AGENTS.md. Instructions your assistant can read.
- **Add a date picker:** `zenos add calendar` → Editable files in your app. Recipe source + its extra dependency.
## Start here
Open a terminal in your app's folder, where `package.json` lives. You need Node.js 20 or newer. For recipes, [install Zenos UI](/getting-started/installation/) first.
### Run the CLI directly
You can use the CLI without installing it in your project. Run `bunx @zentara-co/zenos-cli `, `npx @zentara-co/zenos-cli `, or use another package runner such as `pnpm dlx` or `yarn dlx`.
Choose your package manager below. Your selection applies to every command on this page.
```bash
pnpm dlx @zentara-co/zenos-cli component Dialog
npx @zentara-co/zenos-cli component Dialog
yarn dlx @zentara-co/zenos-cli component Dialog
bunx @zentara-co/zenos-cli component Dialog
```
You should see the component's import path and documentation link:
```text
Dialog (component)
Import: @zentara-co/zenos-ui
Docs path: /components/dialog/
```
The command also reminds you to check the installed types for exact props. Lookups print information; they do not change your app.
Prefer a local CLI installation?
You can optionally add the CLI to your development dependencies to pin its version:
```bash
pnpm add -D @zentara-co/zenos-cli
npm install -D @zentara-co/zenos-cli
yarn add -D @zentara-co/zenos-cli
bun add -d @zentara-co/zenos-cli
```
Commit `package.json` and your lockfile so your team uses the same version. Run the installed executable with `pnpm exec zenos `, `npm exec -- zenos `, `yarn exec zenos `, or `bunx --no-install zenos `.
The examples below run the published package directly.
## Find a component
List the catalog, then look up the component you need:
```bash
pnpm dlx @zentara-co/zenos-cli component --list
npx @zentara-co/zenos-cli component --list
yarn dlx @zentara-co/zenos-cli component --list
bunx @zentara-co/zenos-cli component --list
```
Names such as `Dialog`, `Stack`, `useTheme`, and `split-button` all work. A lookup gives you a public import path, a docs path, and any component-specific notes. Read the linked docs for examples and the installed TypeScript declarations for exact props.
For shorter output to give an AI, add `--dense`:
```bash
pnpm dlx @zentara-co/zenos-cli component Dialog --dense
npx @zentara-co/zenos-cli component Dialog --dense
yarn dlx @zentara-co/zenos-cli component Dialog --dense
bunx @zentara-co/zenos-cli component Dialog --dense
```
You can also look up a shared rule, such as the prop naming conventions:
```bash
pnpm dlx @zentara-co/zenos-cli docs api --dense
npx @zentara-co/zenos-cli docs api --dense
yarn dlx @zentara-co/zenos-cli docs api --dense
bunx @zentara-co/zenos-cli docs api --dense
```
All guidance topics and version details
Available topics: `accessibility`, `api`, `architecture`, `organization`, `react`, `recipes`, `security`, `styling`, `testing`, and `typescript`.
The catalog ships with the CLI. Keep your CLI and UI versions aligned; when they differ, the installed UI types determine which APIs you can use. The CLI does not inspect the UI package to build its catalog.
## Set up your AI
```bash
pnpm dlx @zentara-co/zenos-cli init --features agents
npx @zentara-co/zenos-cli init --features agents
yarn dlx @zentara-co/zenos-cli init --features agents
bunx @zentara-co/zenos-cli init --features agents
```
This creates or updates the Zenos instructions inside `AGENTS.md`. Your AI reads them to learn which commands and components to use. Your own instructions outside the Zenos block stay in place.
Continue to [Working with AI](/getting-started/working-with-ai/) to choose your tool and try your first prompt.
For an optional workflow that guides feature development, install the skill:
```bash
pnpm dlx @zentara-co/zenos-cli init --features skills
npx @zentara-co/zenos-cli init --features skills
yarn dlx @zentara-co/zenos-cli init --features skills
bunx @zentara-co/zenos-cli init --features skills
```
This writes `zenos-app-development` under `.agents/skills` for Codex and Cursor. Use `--agent claude` for `.claude/skills`, or `--agent all` for both locations. Add `--dry-run` to preview. Existing skill contents are preserved unless you explicitly use `--overwrite`.
See [Add the development skill](/getting-started/working-with-ai/#add-the-development-skill) for usage and updates.
## Add a recipe
A recipe is component source copied into your app. You can edit it. It also installs any extra library that the feature needs.
Try Calendar, which includes a calendar, date picker, and date-range picker:
### 1. Preview the changes
```bash
pnpm dlx @zentara-co/zenos-cli add calendar --dry-run
npx @zentara-co/zenos-cli add calendar --dry-run
yarn dlx @zentara-co/zenos-cli add calendar --dry-run
bunx @zentara-co/zenos-cli add calendar --dry-run
```
In an interactive terminal, the CLI first asks for a directory. Press Enter to accept the detected folder, or type another path. You will then see the destination files and any missing dependencies. `--dry-run` makes no changes to your project.
### 2. Install the files
```bash
pnpm dlx @zentara-co/zenos-cli add calendar
npx @zentara-co/zenos-cli add calendar
yarn dlx @zentara-co/zenos-cli add calendar
bunx @zentara-co/zenos-cli add calendar
```
The CLI installs `@daypicker/react` if needed and copies three files into your component folder:
```text
Your component folder/
├── calendar.tsx
├── date-picker.tsx
└── date-range-picker.tsx
```
### 3. Use the component
Check the paths printed by the command. For example, if it created `src/components/date-picker.tsx`, a file in `src/pages` can import it like this:
```tsx
import { DatePicker } from "../components/date-picker";
```
Follow the [Calendar examples](/recipes/calendar/) to render it, then run your app's checks. You own the copied files and can adjust their styling and behavior.
Other recipes you can add
- [animated-number](/recipes/animated-number/): `animated-number.tsx`, using `@number-flow/react`.
- [animated-label](/recipes/animated-label/): `animated-label.tsx`, using native browser animations with no extra dependency.
Replace `calendar` in the command with one of these names:
- [carousel](/recipes/carousel/): `carousel.tsx`, using `embla-carousel-react`.
- [chart](/recipes/chart/): `chart.tsx`, using `recharts`, plus missing chart theme tokens.
- [data-table](/recipes/data-table/): `data-table.tsx`, using `@tanstack/react-table`.
- [file-upload](/recipes/file-upload/): `file-upload.tsx`, using `react-dropzone`.
- [time-picker](/recipes/time-picker/): `time-picker.tsx`, `time-range-picker.tsx`, and `time-picker.css`, using `timepicker-ui-react` and `timepicker-ui`.
Only missing dependencies are installed.
## Options and troubleshooting
Where do files go? Which package manager runs?
The CLI starts at the nearest `package.json`. Choose a destination with `--dir`:
```bash
pnpm dlx @zentara-co/zenos-cli add calendar --dir src/_components/ui
npx @zentara-co/zenos-cli add calendar --dir src/_components/ui
yarn dlx @zentara-co/zenos-cli add calendar --dir src/_components/ui
bunx @zentara-co/zenos-cli add calendar --dir src/_components/ui
```
Relative paths are resolved from that project root, even when you run the command from a nested folder. Absolute paths are also accepted. A missing destination is created during installation; quote paths containing spaces. `--dir=src/_components/ui` is equivalent. Use the same option with `--dry-run` to preview files or `--overwrite` to replace recipe files at that destination. Adjust your recipe imports to match the selected folder.
Without `--dir`, an interactive terminal asks where to put the recipe files. Press Enter to accept the suggested directory or type a relative or absolute path. Ctrl+C or end-of-input cancels before dependencies are installed or files are copied. Passing `--dir` skips the prompt. Non-interactive runs, including piped commands, use the detected directory automatically.
The suggested directory comes from existing UI folders checked in this order:
```text
src/_components/ui → src/components/ui
src/app/_components/ui → src/app/components/ui
app/_components/ui → app/components/ui
_components/ui → components/ui
```
If none exists, it checks `_components` and `components` under the same roots and in the same order. Within a root, `_components` takes precedence. Only existing directories qualify; a file named `ui` is ignored. If no component directory exists, an alias pointing into `src` selects `src/components/ui`. Otherwise, it creates `src/components` when `src` exists, or `components` at the project root.
Lockfiles select the package manager: pnpm, Bun, Yarn, then npm, checked from the project directory upward. Without a lockfile, the CLI checks `packageManager` in `package.json`, then falls back to npm. Use `--dry-run` to see the detected manager and destination.
Recipe files already exist
The CLI stops before installing or copying anything. To keep your edits, leave the files in place. To replace all files in the recipe, review or commit your changes first, then run:
```bash
pnpm dlx @zentara-co/zenos-cli add calendar --overwrite
npx @zentara-co/zenos-cli add calendar --overwrite
yarn dlx @zentara-co/zenos-cli add calendar --overwrite
bunx @zentara-co/zenos-cli add calendar --overwrite
```
`--overwrite` replaces recipe source. It does not downgrade a dependency already declared by your app.
Chart tokens and missing stylesheets
Chart adds missing `--chart-1` through `--chart-5`, `--chart-grid`, `--chart-axis`, and `--chart-tooltip` tokens to the first recognized global stylesheet. Existing tokens stay unchanged.
If no stylesheet is found, the CLI reports it and the component uses its built-in fallback colors. See the [Chart guide](/recipes/chart/) for theme customization.
**No package.json found:** open the terminal in your app's folder.
**Zenos UI is missing:** follow [Installation](/getting-started/installation/) before adding a recipe.
**Command not found:** use the full package-runner command shown above, including `@zentara-co/zenos-cli`. Check that your chosen package runner is available.
For available commands and options:
```bash
pnpm dlx @zentara-co/zenos-cli --help
npx @zentara-co/zenos-cli --help
yarn dlx @zentara-co/zenos-cli --help
bunx @zentara-co/zenos-cli --help
```
Source: https://zenos-ui.pages.dev/getting-started/cli/
---
# Working with AI
Set up your coding assistant, give it a clear task, and check the result.
Give your AI a small instruction file so it knows how to find Zenos components and examples. Set it up once in your app, then describe what you want to build.
How a task becomes working UI:
After setup, your assistant follows this path.
1. **You describe the task.** `Add an Edit profile dialog`. Name the page and explain what should happen.
2. **The AI reads the references.** `Instructions → component docs → installed types`. It looks up the parts and props your app can use.
3. **Build, test, and review.** `Working UI + reported checks`. The AI edits and tests. You try the result.
Using **ChatGPT or Claude in a browser**? Skip to [Share a docs page](#share-a-docs-page). The setup below is for coding tools that can read and edit your project.
## Set up your coding assistant
Start in a React app with [Zenos UI installed](/getting-started/installation/). Open a terminal in the folder containing `package.json`.
Run the CLI directly with `bunx`, `npx`, `pnpm dlx`, or `yarn dlx`. You do not need to install it in your project. Choose your package manager in the command tabs below.
### 1. Create the instructions
For Codex or another tool that reads `AGENTS.md`, run:
```bash
pnpm dlx @zentara-co/zenos-cli init --features agents
npx @zentara-co/zenos-cli init --features agents
yarn dlx @zentara-co/zenos-cli init --features agents
bunx @zentara-co/zenos-cli init --features agents
```
You should now have an `AGENTS.md` file with a **Zenos UI agent context** section. If the file already exists, the command updates only the Zenos section.
Using Claude Code, Cursor, or several tools?
**Claude Code** writes `.claude/CLAUDE.md`:
```bash
pnpm dlx @zentara-co/zenos-cli init --features agents --agent claude
npx @zentara-co/zenos-cli init --features agents --agent claude
yarn dlx @zentara-co/zenos-cli init --features agents --agent claude
bunx @zentara-co/zenos-cli init --features agents --agent claude
```
**Cursor** writes `.cursor/rules/zenos.mdc`, an always-applied project rule:
```bash
pnpm dlx @zentara-co/zenos-cli init --features agents --agent cursor
npx @zentara-co/zenos-cli init --features agents --agent cursor
yarn dlx @zentara-co/zenos-cli init --features agents --agent cursor
bunx @zentara-co/zenos-cli init --features agents --agent cursor
```
**A team using several tools** can create all three files:
```bash
pnpm dlx @zentara-co/zenos-cli init --features agents --agent all
npx @zentara-co/zenos-cli init --features agents --agent all
yarn dlx @zentara-co/zenos-cli init --features agents --agent all
bunx @zentara-co/zenos-cli init --features agents --agent all
```
Choose the command for your tool. Every target contains the same Zenos instructions; you do not need to run them all.
Commit the generated file with your project. Ask your assistant to read it before starting a task.
### 2. Try your first task
Paste this into your coding assistant. Replace the page name with one in your app:
```text
Read this project's AI instructions, including the Zenos section.
On the settings page, add an “Edit profile” button that opens a Zenos
Dialog with a name input, a Save button, and a Cancel button.
Look up Button, Dialog, and Input before writing code. Check their
installed types and match the surrounding page's styling.
Keep the existing save logic. Check keyboard focus, Escape to close,
and the app's tests. Tell me what changed and what you checked.
```
Give the assistant a screenshot or an existing page to match when appearance matters. For a new feature, also explain what saving should do.
## Check that it worked
Review the changes and try the interface:
- The assistant imports components from `@zentara-co/zenos-ui`.
- It checks the docs and installed types before choosing unfamiliar props.
- You can open the dialog, use its controls with the keyboard, and close it.
- The assistant reports which checks passed and anything it could not verify.
If you want to check the setup before letting it edit, ask: “Read the Zenos instructions and look up Button and Dialog. Tell me their import path and available parts. Do not edit files.”
Instructions help the assistant make better choices. Tests and your review still verify the result.
## Add the development skill
The optional `zenos-app-development` skill gives your assistant a workflow for building a feature: inspect the app, look up Zenos APIs, place code with its owner, implement the interaction, and run the relevant checks. It respects existing project conventions and uses feature folders when a new app has no convention yet.
Run this from your app's folder:
```bash
pnpm dlx @zentara-co/zenos-cli init --features skills
npx @zentara-co/zenos-cli init --features skills
yarn dlx @zentara-co/zenos-cli init --features skills
bunx @zentara-co/zenos-cli init --features skills
```
This creates `.agents/skills/zenos-app-development/SKILL.md`, which Codex and Cursor can discover. For Claude Code, append `--agent claude` to write `.claude/skills/zenos-app-development/SKILL.md`. For a team using all three tools, use `--agent all`; Codex and Cursor share the `.agents` copy.
Commit the skill with your project. Start a new assistant session if it has not discovered the new file, then try:
```text
Use zenos-app-development to add a project creation form.
Follow our existing feature structure, reuse our save API and validation,
and check the interaction with the keyboard and the app's tests.
```
Project instructions still define the rules that apply throughout the app. The skill provides the development workflow; CLI topics and installed types provide detailed references. You can keep using the agent instructions without installing the skill.
Preview or update the skill
Add `--dry-run` to preview the destination without writing files. An identical installed skill is left unchanged. If its contents differ, the CLI stops so your edits remain intact.
After upgrading the CLI, review or commit your existing skill before replacing it. Use `--overwrite` to replace the whole `SKILL.md`, and include the same `--agent` target you used when installing. Combine `--overwrite --dry-run` to preview the replacement first.
See [File Organization](/getting-started/file-organization/) for the short visual reference. Skill discovery follows the tool's project directories: [Codex](https://developers.openai.com/codex/skills), [Claude Code](https://code.claude.com/docs/en/skills), and [Cursor](https://cursor.com/docs/skills).
## Share a docs page
For a question in ChatGPT, Claude, or another browser chat, use **Copy page** at the top of any docs page. Paste that Markdown with your question. The menu also offers **View as Markdown**, **Open in ChatGPT**, and **Open in Claude**.
For example:
```text
Read https://zenos-ui.pages.dev/components/dialog.md.
Show me a dialog with a name input and Save and Cancel buttons.
```
Use the smallest reference that answers your question:
- **One component:** its `.md` page, including examples and the API table.
- **Find the right page:** [/llms.txt](/llms.txt), the documentation index.
- **Whole-library research:** [/llms-full.txt](/llms-full.txt), the complete docs. This is a large file; it is usually unnecessary for a single UI task.
The website describes the published docs. Your installed UI types are the reference for the version in your app.
## Keep the instructions up to date
After upgrading Zenos, run the same `init` command you used during setup. Keep the CLI and UI versions aligned, then review and commit the updated instruction file.
To preview every supported target without changing files:
```bash
pnpm dlx @zentara-co/zenos-cli init --features agents --agent all --dry-run
npx @zentara-co/zenos-cli init --features agents --agent all --dry-run
yarn dlx @zentara-co/zenos-cli init --features agents --agent all --dry-run
bunx @zentara-co/zenos-cli init --features agents --agent all --dry-run
```
Where should I put my own project rules?
Keep them outside the generated markers. For example:
```md
# Project rules
- Match the existing settings pages.
- Keep our current form validation and save logic.
- Run the project's tests after making changes.
Zenos manages the instructions inside this block.
```
Rerunning `init` replaces only the marked section. Your app decides its architecture, naming, and testing conventions. Zenos adds component usage guidance.
What does the generated file teach the assistant?
It explains public imports, component lookup commands, recipe installation, prop naming, styling tokens, keyboard behavior, and accessibility. More detailed guidance stays in the CLI so the assistant can request it when needed:
```bash
pnpm dlx @zentara-co/zenos-cli component Dialog --dense
npx @zentara-co/zenos-cli component Dialog --dense
yarn dlx @zentara-co/zenos-cli component Dialog --dense
bunx @zentara-co/zenos-cli component Dialog --dense
```
```bash
pnpm dlx @zentara-co/zenos-cli docs api --dense
npx @zentara-co/zenos-cli docs api --dense
yarn dlx @zentara-co/zenos-cli docs api --dense
bunx @zentara-co/zenos-cli docs api --dense
```
`--dense` asks for shorter output. CLI lookups use the catalog shipped with the CLI; they do not inspect your installed UI version. Exact props and available parts come from the installed TypeScript declarations.
See the [CLI guide](/getting-started/cli/#find-a-component) for all lookup topics.
## If something goes wrong
**The assistant ignores Zenos:** ask it to read the generated file, then look up the components it plans to use. Check that you chose the target for your coding tool.
**It uses a prop that does not exist:** ask it to verify the prop against your installed UI types. Check that the CLI and UI versions match.
**The command reports invalid markers:** keep exactly one `zenos:agent-docs:start` and one `zenos:agent-docs:end`, in that order, then retry. The CLI leaves files unchanged when it finds malformed markers.
**You need help with the commands:** follow the [CLI quick start](/getting-started/cli/#start-here).
Source: https://zenos-ui.pages.dev/getting-started/working-with-ai/
---
# Design principles
The product and engineering decisions that keep Zenos coherent.
Zenos helps teams build dense, dependable product interfaces without hiding the platform beneath another layer of abstraction. Its components share one visual language and one public API, while remaining flexible enough for real application work.
The system separates responsibility deliberately. Native HTML supplies semantics, Base UI supplies complex interaction behavior, generated CSS applies the visual system, Zenos defines the public contract, and the consuming application owns product meaning and workflows.
## Core principles
**Clear before clever.** Names, states, and component anatomy should explain themselves at the call site. Familiar concepts use familiar vocabulary.
**Compose before abstracting.** Small public parts combine into real workflows. New abstractions earn their place through repeated product needs.
**Structure stays neutral.** Layout primitives control space and flow. Decoration remains an intentional choice made with semantic tokens.
**Behavior stays trustworthy.** Native and Base UI semantics survive styling, wrapping, polymorphism, and custom composition.
**Information leads.** Hierarchy, spacing, and contrast help people scan dense interfaces without unnecessary visual noise.
**Escape hatches remain useful.** Public components accept native props, `className`, `style`, ARIA attributes, and data attributes without exposing internals.
## Build from meaning
Use the element or component that matches the content's responsibility. A `Button` performs an action. A `Link` navigates. `Field` owns labels, descriptions, errors, and validation semantics. `InputGroup` only arranges related controls.
Visual similarity is not enough reason to merge responsibilities. Keeping boundaries narrow makes components easier to combine, test, and replace.
When a component starts to own data fetching, authorization, product copy, and several unrelated layouts, split it by responsibility rather than adding more configuration props.
## Prefer semantic decisions
Components use roles such as `background`, `surface`, `foreground`, `border`, and `primary`. They do not depend on a specific shade working in every theme. The same rule applies to spacing, elevation, typography, and status colors.
Primitive values remain available for theme authors. Product code should prefer semantic tokens so light mode, dark mode, and custom themes preserve the intended hierarchy.
Hardcoded values are appropriate only when they represent fixed content rather than a theme decision. A logo's authored color may be fixed; a success message should use the semantic success role.
## Reveal structure through composition
Compound components expose meaningful parts such as `Root`, `Trigger`, `Content`, `Item`, and `Indicator`. Consumers can arrange those parts around their content without depending on private wrappers.
```tsx
}>Review changes
Publish changes?The update will be visible to every member.Cancel
```
Layout uses the polymorphic `as` prop. Base UI-backed interactive parts use `render`. Keeping these mechanisms distinct makes their purpose predictable.
## Design for real content
Zenos components must continue to work with long labels, empty results, validation errors, narrow containers, increased browser zoom, [RTL content](/foundations/rtl/), and reduced motion. Responsive behavior should follow the available space rather than assume one ideal screen.
Truncation is reserved for content that can safely lose visual detail. Essential instructions, errors, and actions should wrap or remain otherwise available.
## Make density support comprehension
Dense product interfaces should reduce wasted space, not remove hierarchy. Use proximity to group related information, alignment to make comparison easier, and contrast to identify the next decision. Give primary actions and exceptional states more emphasis than persistent chrome.
Do not solve density by shrinking every control or muting every label. Touch targets, focus indicators, readable type, and error recovery remain usable at compact densities. Test scanning with realistic data, not only symmetrical placeholders.
## Design every interaction state
A component is not finished at its default appearance. Review hover, pressed, selected, focused, disabled, invalid, loading, empty, and destructive states where they apply. The state must remain understandable through more than color alone.
Loading should preserve enough structure to prevent avoidable layout shift. Empty states should explain what is absent and, when appropriate, how to proceed. Destructive actions should communicate consequence before commitment and recovery after failure.
[Motion](/foundations/motion/) should explain spatial or state change, not delay work. Keep transitions interruptible, avoid motion that competes with reading, and provide an equivalent reduced-motion treatment.
## Accessibility is shared work
Zenos preserves native HTML and Base UI behavior, including keyboard interaction, focus management, ARIA relationships, and disabled semantics. Consumers remain responsible for meaningful labels, useful error messages, logical workflows, and content order.
Automated checks catch common regressions. Keyboard testing, screen-reader review, zoom, contrast, motion, and real content remain part of the design process.
Accessibility is a constraint throughout design, implementation, and content—not a final audit. A visually elegant treatment that obscures a label, removes focus, breaks source order, or depends on pointer precision is not a valid system outcome.
## Keep specialized engines optional
Calendar, carousel, chart, and data-table behavior comes from focused third-party engines installed through recipes. These dependencies are added only when a product requests the corresponding recipe, and the generated source belongs to that product.
Core Zenos stays focused on general-purpose controls, layout, tokens, and interaction patterns.
## Public API contract
| Concern | Convention |
| ----------------------- | -------------------------------------------------------------- |
| Layout polymorphism | `as` |
| Interactive composition | `render` |
| Value state | `value`, `defaultValue`, `onValueChange` |
| Open state | `open`, `defaultOpen`, `onOpenChange` |
| Visual treatment | `variant` |
| Control sizing | `size="sm"`, `size="md"`, or `size="lg"` |
| Interaction orientation | `orientation="horizontal"` or `orientation="vertical"` |
| State semantics | `disabled`, `invalid`, `required` |
| DOM identification | `data-slot`, plus `data-size` and `data-variant` when relevant |
| Styling escape hatches | `className`, `style`, `aria-*`, and `data-*` |
Consistency is a product feature. A new API should reuse these conventions unless the underlying concept is genuinely different.
## Review a design-system change
Before accepting a new component, variant, token, or pattern, ask:
1. Does it have one clear owner and responsibility?
2. Can an existing public component or composition already express the need?
3. Does the API match established state, size, variant, and composition conventions?
4. Are native props, refs, keyboard behavior, focus, and ARIA relationships preserved?
5. Does it work with real content, responsive containers, themes, zoom, RTL, and reduced motion where relevant?
6. Are specialized dependencies isolated from the core package?
7. Do examples, types, tests, and rendered behavior prove the same public contract?
Prefer the smallest complete addition. A narrow primitive with a stable responsibility is easier to compose and maintain than a broad component that predicts every future product need.
Source: https://zenos-ui.pages.dev/foundations/
---
# Colors
Explore semantic color roles and primitive palettes for light and dark product surfaces.
Color starts with intent. Zenos components use semantic roles for surfaces, content, structure, and feedback, while primitive ramps provide the building blocks for a custom theme.
## Semantic roles
Use the role that describes the job a color performs, rather than the color it happens to render. Every swatch below uses the active theme value, so the same role adapts when you switch between light and dark mode.
The list focuses on the roles used most often in product interfaces. The public `@zentara-co/zenos-ui/colors.css` stylesheet also includes the complete accent ramps, interaction states, and chart permutations for specialist cases.
## Usage
Add package CSS imports to your global `index.css`: use `@zentara-co/zenos-ui/tailwind.css` after `tailwindcss` for Tailwind v4, `@zentara-co/zenos-ui/styles.css` without Tailwind, or `@zentara-co/zenos-ui/colors.css` when you only need the color tokens. Reference semantic variables in application styles:
```css
.product-card {
background: var(--background-neutral-card);
color: var(--text-default);
border: 1px solid var(--border-default);
}
.product-card__description {
color: var(--text-subtle);
}
.product-card__error {
background: var(--background-danger-subtlest-default);
color: var(--text-danger-default);
border-color: var(--border-danger-subtle);
}
```
Tailwind consumers can use the corresponding semantic utilities, such as `bg-background-neutral-card`, `text-text-default`, and `border-border-default`. The `--color-*` aliases connect these utilities to the same mode-aware semantic variables.
Set `data-theme="light"` or `data-theme="dark"` on a theme container to choose a mode explicitly. The `.dark` class also enables dark mode; without an explicit mode, the stylesheet follows the system preference.
## Primitive palettes
Primitive ramps are mode-independent building blocks for themes, data visualizations, and application-specific color roles. Each ramp is available as a CSS variable and a Tailwind color utility. Hover or focus a swatch to inspect its token name. The palette scrolls horizontally on narrow screens.
## Zentara brand colors
Primitive values stay the same between light and dark mode. Theme authors map them to semantic roles whose values can change by mode.
## Best practices
- Prefer semantic roles in components; reserve primitive ramps for theme definitions and application-specific color roles.
- Pair background, text, icon, and border tokens with matching intent and appropriate contrast. Strong fills may need a contrary foreground, including the dedicated warning-contrary roles.
- Use status colors only for their meaning, not as arbitrary decoration.
- Check contrast on the actual rendered surface in both modes, especially for alpha colors and low-emphasis text.
- Preserve focus indicators and communicate state with labels, icons, or patterns as well as color.
- Override semantic variables in a scoped theme rather than hardcoding light-mode colors in component styles.
Source: https://zenos-ui.pages.dev/foundations/colors/
---
# Fonts
The SUSE, Albert Sans, and Geist Mono typefaces behind Zenos typography.
Zenos uses three complementary typefaces. SUSE gives headings a distinct architectural voice, Albert Sans keeps interface text clear at compact sizes, and Geist Mono makes technical content easy to scan.
Foundation / Fonts
Structure, clarity, and precision.
Each family has a focused role. Their shared proportions keep product interfaces cohesive
without making every layer feel identical.
SUSE · HeadingAa Bb Cc Dd Ee Ff Gg
Build calm, capable interfaces.
Albert Sans · BodyAa Bb Cc Dd Ee Ff Gg Hh Ii Jj
The quick brown fox jumps over the lazy dog. 0123456789
Geist Mono · Codeconst status = "ready";
0123456789 !@#$%^&*()_+ {"{}"}[]
## Roles
| Typeface | Token | Primary use |
| ----------- | ---------------- | --------------------------------------------- |
| SUSE | `--font-heading` | Headings, emphasis, and high-signal metrics |
| Albert Sans | `--font-body` | Body copy, controls, labels, and descriptions |
| Geist Mono | `--font-code` | Code, keyboard input, and technical values |
## Load the fonts
Zenos defines the font stacks but does not download font files for consumer applications. Load the families through your framework, a self-hosted font pipeline, or a provider before importing Zenos styles.
```html
```
For production applications, self-hosting gives tighter control over caching, privacy, and font-display behavior.
## Semantic stacks
```css
:root {
--font-heading: "SUSE", ui-sans-serif, system-ui, sans-serif;
--font-body: "Albert Sans", ui-sans-serif, system-ui, sans-serif;
--font-code: "Geist Mono", ui-monospace, monospace;
}
```
Override these variables when your product has its own approved type family. Keep the semantic roles intact so headings, body text, and code continue to use the correct stack.
## Weights
Zenos uses a restrained range to keep hierarchy predictable:
- SUSE: `600–700` for headings and `600` for metrics
- Albert Sans: `400` for body copy, `500` for medium emphasis, and `600` for bold labels
- Geist Mono: `400` for code and technical text
Avoid synthetic bold and italic styles. Load every weight used by the application, and keep `font-display: swap` or an equivalent non-blocking strategy.
## Fallback behavior
Every stack includes system fallbacks. The interface remains readable before web fonts load and in environments where remote fonts are unavailable. Test narrow controls and dense tables with fallback fonts because character widths may change.
Source: https://zenos-ui.pages.dev/foundations/fonts/
---
# Typography
A restrained type hierarchy for dense product interfaces.
Zenos uses a compact semantic type system for product interfaces. Each role combines a family, size, line height, and weight so hierarchy remains consistent across controls, forms, dashboards, and long-form content.
The default stacks use [SUSE, Albert Sans, and Geist Mono](/foundations/fonts/). Consumers load the font files or override the family tokens; Zenos defines how each family is used.
## Type scale
Heading h1Build with clarity.32 / 36
Heading h2Build with clarity.28 / 32
Heading h3Build with clarity.24 / 28
Heading h4Build with clarity.20 / 24
Heading h5Build with clarity.16 / 20
Body large
Interfaces should remain readable under pressure.
16 / 24
Body medium
Interfaces should remain readable under pressure.
14 / 20
Body small
Interfaces should remain readable under pressure.
12 / 16
Emphasis24,86024 / 28
Codeconst status = "ready";12 / 20
Values are shown as font size / line height in pixels. The complete heading scale continues through `h6` and `h7` for dense labels and deeply nested sections.
## Roles
| Role | Family | Scale | Use |
| -------- | ----------- | ------------- | ------------------------------------------------------- |
| Heading | SUSE | `h1`–`h7` | Page titles, section headings, and structural hierarchy |
| Body | Albert Sans | `l`, `m`, `s` | Interface copy, labels, descriptions, and messages |
| Emphasis | SUSE | `l`, `m`, `s` | Metrics and short high-signal values |
| Code | Geist Mono | Fixed | Commands, identifiers, shortcuts, and technical values |
Choose a role by meaning before choosing a size. A metric and a heading can have similar dimensions while serving different reading patterns.
## Heading hierarchy
Headings establish the document outline. Keep levels sequential and use CSS or `Text` sizing when the visual scale needs to differ from the semantic element.
```tsx
Asset inventory
```
`h7` is a visual role rendered as a paragraph by default because HTML only defines six heading levels. Use `as` when another semantic element is required.
## Body copy
Use medium body text for most product UI. Large body text suits introductions and comfortable reading; small body text is reserved for supporting metadata where space is constrained.
Body text supports `regular`, `medium`, and `bold` weights. Prefer weight and spacing for hierarchy before reducing contrast. Long descriptions, errors, and instructions must be allowed to wrap.
## Emphasis and metrics
Emphasis styles are designed for concise values such as totals, percentages, or status counts. They use the heading family without becoming part of the page outline.
Use tabular numerals when values update in place or align in a column:
```tsx
24,860
```
Do not use emphasis for long sentences. Its tighter rhythm is intended for short, scannable information.
## Code and technical content
The code role uses Geist Mono with a slashed zero and disabled contextual alternates. Use it for machine-readable values, commands, keyboard input, and identifiers. Explanatory prose should remain body text.
## Color and contrast
Text colors describe hierarchy and meaning:
- `default` for primary content
- `subtle` for supporting content
- `subtlest` for low-priority metadata
- feedback roles for danger, warning, success, and information
- `contrary` for content on strong inverse surfaces
Color does not replace labels or status text. Ensure every role remains legible against its actual surface in light and dark themes.
## Line length and wrapping
Keep prose near 45–75 characters per line. Product labels may be shorter, but essential text should not be truncated simply to preserve a fixed-height layout.
Use `truncate` only when the full value remains available elsewhere. Use `maxLines` for bounded previews, and test both with long unbroken values, increased browser zoom, and translated content.
## Using Text
`Text` applies the semantic roles while preserving polymorphism, native attributes, refs, alignment, color, truncation, and line clamping.
```tsx
Recent activity
Updated five minutes ago
scan_01J8M2
```
Native headings and paragraphs remain appropriate when a Zenos-specific visual role is unnecessary. Typography should reinforce semantics rather than replace them.
Source: https://zenos-ui.pages.dev/foundations/typography/
---
# Icons
Phosphor by default, with the freedom to use any icon pack.
Zenos uses **Phosphor Icons by default** in its documentation and examples. This is a starting point, not a requirement: **you can use any icon pack you like**, or your own SVGs.
Icons are supplied by your application. Zenos does not require Phosphor as a core dependency or wrap icons in a pack-specific API.
## Default icon set
Phosphor provides a consistent visual language for navigation, actions, and feedback. These are a few of the icons used in product interfaces:
## Install Phosphor
Add the React package to your application if you want to use the default set:
```bash
pnpm add @phosphor-icons/react
npm install @phosphor-icons/react
yarn add @phosphor-icons/react
bun add @phosphor-icons/react
```
Import individual icon components and compose them with Zenos controls:
```tsx
import { PlusIcon, TrashIcon } from "@phosphor-icons/react";
import { Button, IconButton } from "@zentara-co/zenos-ui";
function ProjectActions() {
return (
<>
}>Create project
>
);
}
```
Use `startIcon` or `endIcon` for [Button](/components/button/) labels, and place the icon inside [IconButton](/components/icon-button/) for icon-only actions.
## Weights
Phosphor supports six weights. Start with `regular` for everyday interface icons and keep the treatment consistent across a feature. A filled icon can distinguish a selected or saved state, but should not be the only indication of that state.
```tsx
import { StarIcon } from "@phosphor-icons/react";
;
```
The same icon can use `thin`, `light`, `regular`, `bold`, `fill`, or `duotone`. Weight is an icon-library option, not a Zenos component prop.
## Use any icon pack
Replace the Phosphor component with an icon from your preferred library. The Zenos composition stays the same; only the icon import and any library-specific props change. You do not need to install Phosphor alongside another pack.
Custom SVG components work too:
```tsx
import type { SVGProps } from "react";
import { IconButton } from "@zentara-co/zenos-ui";
function AddIcon(props: SVGProps) {
return (
);
}
function AddAction() {
return (
);
}
```
## Size and color
- Let Zenos controls handle their icon sizing where possible; use your icon library's sizing props for standalone icons.
- Prefer `currentColor` so icons inherit the surrounding foreground, including hover, disabled, and dark-mode treatments.
- Use [semantic color roles](/foundations/colors/) such as `--icon-default`, `--icon-subtle`, or `--icon-danger` for standalone icons rather than fixed colors.
- Keep stroke weight, optical size, and alignment consistent. Different icon packs can have different view boxes and proportions.
## Accessibility
- Hide decorative icons with `aria-hidden="true"` when visible text already explains their meaning.
- Give every icon-only control an accessible name, such as `aria-label="Delete project"`, on the control rather than only on its icon.
- Pair status icons with text. Do not rely on an icon shape or color alone to communicate success, warning, or error.
- For a meaningful standalone SVG without accompanying text, provide `role="img"` and an accessible name.
- Mirror directional icons for right-to-left layouts only when their meaning is directional; do not mirror logos or universal symbols indiscriminately.
Source: https://zenos-ui.pages.dev/foundations/icons/
---
# File Icons
File-type illustrations for attachments, upload rows, and file cards.
File icons are the folded-sheet illustrations inside [File Card](/components/file-card/). Each icon stamps a short label on a paper sheet, and the label band takes its color from the file family. The same illustration is what an attachment list uses to tell a PDF from a spreadsheet at a glance.
```tsx
import { FileCard, Stack, Text } from "@zentara-co/zenos-ui";
const fileIconTypes = [
{ label: "PDF", type: "pdf" },
{ label: "Document", type: "document" },
{ label: "Spreadsheet", type: "spreadsheet" },
{ label: "Presentation", type: "presentation" },
{ label: "Archive", type: "archive" },
{ label: "Image", type: "image" },
{ label: "Video", type: "video" },
{ label: "Audio", type: "audio" },
{ label: "Code", type: "code" },
{ label: "Other", type: "default" },
] as const;
function FileIconCatalogExample() {
return (
{fileIconTypes.map((file) => (
{file.label}
))}
);
}
```
## Import
```tsx
import { FileCard, fileTypeFromName } from "@zentara-co/zenos-ui";
```
## Usage
Pass a family with `type`, or derive it from a filename. The icon is decorative: the filename beside it names the file. Pass `aria-label` only when the icon stands alone.
```tsx
```
`label` replaces the short stamp. Use it when a product-specific extension should read differently from the family default, such as `TSX` on a code file. Leave it unset for the family's own label.
## Categories
`fileTypeFromName` reads the extension, ignores letter case, and returns one of ten families. An unknown extension, or a name with no extension, returns `default`. Prefer a trusted MIME type when the filename may be incomplete.
| Family | Stamp | Tone | Extensions |
| -------------- | ----- | ------- | ---------------------------------------------------- |
| `pdf` | PDF | Red | pdf |
| `document` | DOC | Blue | doc, docx, odt, rtf, txt |
| `spreadsheet` | XLS | Green | csv, ods, xls, xlsx |
| `presentation` | PPT | Orange | key, odp, ppt, pptx |
| `archive` | ZIP | Yellow | 7z, gz, rar, tar, zip |
| `image` | IMG | Purple | gif, heic, jpeg, jpg, png, svg, webp |
| `video` | VID | Magenta | avi, mkv, mov, mp4, webm |
| `audio` | AUD | Teal | aac, flac, m4a, mp3, ogg, wav |
| `code` | CODE | Indigo | css, html, js, json, jsx, md, py, ts, tsx, yaml, yml |
| `default` | FILE | Gray | Anything else |
Tones use accent tokens, so they follow the active theme.
## In a file card
[File Card](/components/file-card/) places the icon at the start of a row or at the top of a tile. Pass the derived type and keep the real filename in `FileCard.Name`. The card page covers progress, upload state, and actions.
```tsx
import { FileCard, fileTypeFromName, Stack } from "@zentara-co/zenos-ui";
function FileIconContextExample() {
const files = [
{ meta: "PDF · 4.2 MB", name: "Brand guidelines.pdf" },
{ meta: "Spreadsheet · 860 KB", name: "Q3 revenue.xlsx" },
{ meta: "Video · 128 MB", name: "Launch film.mp4" },
] as const;
return (
{files.map((file) => (
{file.name}{file.meta}
))}
);
}
```
Inside a card, the icon size follows the card layout and density. A comfortable row uses the larger sheet; compact rows and tiles scale it with the card. Override the frame with `className` when the icon needs a different box outside that layout.
Source: https://zenos-ui.pages.dev/foundations/file-icons/
---
# Spacing
Consistent spacing for components and layout primitives.
Zenos uses a shared spacing scale to create rhythm within components and across page layouts. The scale follows a 4px base unit and provides enough range for dense controls, content groups, and large structural regions.
Layout primitives accept spacing keys instead of Tailwind utility strings. This keeps responsive props typed and makes spacing decisions consistent at every call site.
## Scale
| Range | Typical use |
| --------- | ---------------------------------------------------------------------- |
| `0`–`2` | Hairline separation, compact icon relationships, and dense controls |
| `3`–`5` | Form fields, component content, and closely related groups |
| `6`–`10` | Cards, panels, grids, and page-level content groups |
| `12`–`24` | Major sections, spacious page regions, and large responsive boundaries |
The ranges are guidance, not component defaults. Start from the relationship between elements and use the smallest value that communicates it clearly.
## Relationships before measurements
Spacing describes how strongly elements belong together. A label sits closer to its control than the field sits to the next field. A card title sits closer to its description than the card sits to neighboring cards.
Use consistent spacing for equivalent relationships. Avoid choosing a new value to solve every individual screen.
## Layout props
`Stack`, `Grid`, `Cluster`, and `FormLayout` expose `gap`. Grid-based primitives also support independent `rowGap` and `columnGap` where the two axes need different rhythm.
```tsx
```
Structural primitives such as `Stack`, `Section`, `Center`, and `Layout` expose typed padding props where they own the relevant boundary. Prefer those props when spacing is part of the component's structure.
```tsx
```
## Responsive spacing
Responsive values use the shared [`base`, `sm`, `md`, `lg`, `xl`, and `2xl` breakpoints](/foundations/breakpoints/). Increase space when more room improves hierarchy; do not expand every gap automatically at each breakpoint.
```tsx
{children}
```
Object values cascade upward. In this example, `3` applies from the base viewport until `md`, and `6` applies from `md` onward.
## Logical directions
Use logical padding props such as inline start, inline end, block start, and block end when direction matters. Logical spacing follows the document direction automatically and works more reliably for right-to-left interfaces than physical left and right values.
See [RTL](/foundations/rtl/) for application setup, directional icons, portals, keyboard behavior, and a complete testing checklist.
## Component and application spacing
Zenos components own the internal spacing needed for their anatomy and interaction states. Consumers should compose components with layout primitives rather than reaching into internal children with fragile selectors.
Application-specific spacing remains appropriate for unique page composition:
```tsx
```
Use `className` for isolated product needs. When the same relationship repeats, prefer a Zenos layout primitive with a spacing token.
## Guidance
- Use smaller values within a component and larger values between distinct regions.
- Let one parent own the gap between siblings; avoid stacking child margins.
- Prefer `gap` for sibling relationships and padding for container boundaries.
- Keep touch target size separate from visible spacing.
- Test narrow screens, 200% zoom, long labels, and translated content.
- Use `0` intentionally when another visual treatment already communicates grouping.
Spacing should make relationships easier to understand. It should not compensate for unclear hierarchy or unnecessary wrappers.
Source: https://zenos-ui.pages.dev/foundations/spacing/
---
# Density
Retune component spacing and default control sizes for comfortable or compact interfaces.
Density is a cross-component spacing preset. It tightens or relaxes padding, gaps, title scale, and default control heights without changing color, radius, or interaction behavior.
Zenos provides two values:
- `comfortable` is the default. It preserves the balanced spacing used by existing Zenos components.
- `compact` reduces whitespace for dashboards, data-heavy forms, side panels, and other application UI.
## Compare the presets
The same Card is rendered at both densities below. The compact version reduces its internal spacing and title scale while keeping the same semantic surface, border, and corner radius.
```tsx
import { Card, Stack } from "@zentara-co/zenos-ui";
function DensityComparisonExample() {
return (
{(["comfortable", "compact"] as const).map((density) => (
{density}
{density === "comfortable"
? "Balanced spacing for everyday product surfaces."
: "Tighter spacing for information-dense workflows."}
Radius and color stay the same.
))}
);
}
```
Use an explicit `density` prop when one component needs to differ from its surroundings:
```tsx
Recent activity{/* dense content */}
```
## Set density for a subtree
`DensityProvider` applies one density to every supported descendant. This is the preferred option for a dashboard, settings panel, or application shell because related components change together.
```tsx
import { Button, Card, DensityProvider, Input, Stack } from "@zentara-co/zenos-ui";
import { useState } from "react";
function DensityWorkspaceExample() {
const [density, setDensity] = useState<"comfortable" | "compact">("comfortable");
return (
{(["comfortable", "compact"] as const).map((value) => (
))}
Payout thresholdChoose when the next automatic payout is created.
);
}
```
```tsx
import { Button, Card, DensityProvider, Input } from "@zentara-co/zenos-ui";
export function Dashboard({ children }: { children: React.ReactNode }) {
return {children};
}
```
Density resolves from the most specific source:
1. An explicit component `density` prop.
2. The nearest `DensityProvider`.
3. The `comfortable` default.
For controls with a `size` prop, an explicit size remains authoritative. A compact provider changes an unsized Button or Input to `sm`, but it does not replace `size="lg"`.
## What changes
### Comfortable
- Card regions use the spacing-4 token (`p-4`, 16px) on every outer edge.
- Card titles use the body-large scale.
- Unsized Button and Input controls resolve to `md`.
### Compact
- Card regions use the spacing-3 token (`p-3`, 12px) on every outer edge.
- Card titles use the body-medium scale.
- Unsized Button and Input controls resolve to `sm`.
Density does not change semantic color roles, border radius, component variants, accessibility behavior, or touch-target decisions that a product applies explicitly.
## Supported components
The first density-aware surface is the Card family:
- `Card`
- `ClickableCard`
- `SelectableCard`
Because the interactive card components share Card parts, their headers, content, footers, and nested controls inherit the same density behavior. `Button` and `Input` also honor the provider when their `size` prop is omitted.
Components with intrinsic pixel dimensions, such as Avatar, do not inherit density. Continue to use their explicit `size` API.
## Choosing a density
Use `comfortable` for marketing surfaces, onboarding, editorial content, and focused tasks where scanning space is valuable. Use `compact` for repeated controls, dense configuration, data management, and constrained panels.
Keep one density across a coherent region. Mixing presets card by card creates uneven rhythm; use a local override only when the component has a genuinely different information-density requirement.
Source: https://zenos-ui.pages.dev/foundations/density/
---
# Breakpoints
Shared viewport thresholds and responsive patterns for Zenos layouts and applications.
Zenos uses a mobile-first breakpoint scale shared by layout props and Tailwind utilities. Start with the narrowest useful layout, then add a breakpoint only when the content needs more room or a different structure.
## Scale
The pixel values assume the browser's standard 16px root size and are shown as a convenient reference. Zenos consumes Tailwind's `rem`-based default breakpoints rather than maintaining a separate set of device-specific thresholds.
`base` is a responsive-prop key, not a Tailwind prefix. It produces unprefixed styles that apply everywhere until a larger breakpoint overrides them.
## Mobile-first behavior
Breakpoint rules use `min-width`. A value begins at its breakpoint and remains active at larger widths until another value overrides it.
```tsx
{children}
```
This grid has one column by default, two columns from `md`, and four columns from `xl`. Its gap changes from `3` to `6` at `lg`. Omitted breakpoints inherit the last applicable value through CSS.
Always provide a usable `base` layout when the value must change responsively. Do not use `sm` as shorthand for mobile: `sm` starts at 640px, while the unprefixed value covers widths below it.
## Responsive layout props
Zenos layout primitives accept either a direct value or a responsive object for the properties they own. The public `Responsive` type supports `base`, `sm`, `md`, `lg`, `xl`, and `2xl`.
```tsx
import { Container, Grid, GridSpan, Stack } from "@zentara-co/zenos-ui";
;
```
Prefer responsive props when a layout primitive owns the behavior. This keeps structure typed and makes the breakpoint decision visible at the call site.
## Tailwind utilities
Use the matching Tailwind prefixes for application-specific layout and decoration:
```tsx
{children}
```
Unprefixed utilities are the base treatment. Prefixes add overrides at their minimum width. Keep related responsive classes close together so the progression can be read without searching across files.
## Choose breakpoints from content
Use the first breakpoint where the current composition stops working, not a presumed phone, tablet, or desktop model.
- Let text wrap before increasing the viewport requirement.
- Add columns only when each column retains a useful readable width.
- Move actions inline when their labels fit without crowding or truncation.
- Keep dense data horizontally scrollable when collapsing it would hide meaning.
- Prefer a container query for a reusable component whose layout depends on its parent rather than the viewport.
- Avoid adding a different layout at every breakpoint. Most interfaces need only one or two meaningful transitions.
The same viewport can contain a full-width page, a narrow side panel, and an embedded card. Viewport breakpoints cannot describe all three component contexts reliably.
## CSS before JavaScript
Use responsive props, media queries, or utility prefixes for presentation. CSS responds before paint, works during server rendering, and avoids maintaining duplicate viewport state.
Use viewport hooks only when width must change behavior that CSS cannot express, such as selecting a different interaction model or coordinating imperative third-party code.
| API | Default range |
| ----------------------------- | ---------------------------------- |
| `useMobileMode()` | Below `md`, through `767px` |
| `useTabletMode().isPortrait` | Through `1023px`, including mobile |
| `useTabletMode().isLandscape` | `1024px` through `1279px` |
| `useTabletMode().isAnyTablet` | Through `1279px` |
```tsx
import { useMobileMode } from "@zentara-co/zenos-ui";
function ResultsInteraction() {
const isMobile = useMobileMode();
return isMobile ? : ;
}
```
The hooks read the visual viewport when available and subscribe to resize changes. Their server value is non-mobile, so the first client render may update after hydration. Do not use them merely to toggle CSS layout or hide presentational content. See [Hooks](/hooks/) for their complete APIs and SSR behavior.
## Show, hide, and reorder responsibly
Responsive presentation must preserve meaning and interaction:
- Do not hide essential actions, errors, or instructions at narrow widths.
- Avoid rendering duplicate interactive controls for different breakpoints unless the inactive copy is removed from both layout and the accessibility tree.
- Keep DOM order logical even when Grid or Flexbox changes visual placement.
- Preserve focus when changing between responsive interaction patterns.
- Prefer wrapping and reflow over truncating meaningful content.
## Test the transitions
Test around the boundary, not only at the named width. For an `md` change, verify at 767px, 768px, and a comfortably wider size.
Also test:
- browser zoom up to 200%
- increased default font size
- long and translated labels
- open menus, dialogs, and validation messages
- keyboard focus order after reflow
- horizontal overflow in tables, charts, and code examples
- resizing while temporary UI is open
Breakpoints organize available space; they do not replace resilient content, intrinsic sizing, or accessible reflow.
Source: https://zenos-ui.pages.dev/foundations/breakpoints/
---
# Radius
Shape roles across controls, surfaces, and overlays.
Zenos uses a restrained radius scale to communicate size, containment, and interaction. Smaller shapes belong to compact controls and nested elements; larger shapes define cards, panels, and application frames.
## Scale
Small--radius-sm
4px
Medium--radius-md
6px
Large--radius-lg
8px
Extra large--radius-xl
12px
| Token | Tailwind utility | Typical role |
| ------------- | ---------------- | ------------------------------------------------------------------- |
| `--radius-sm` | `rounded-sm` | Menu items, close controls, indicators, and compact nested elements |
| `--radius-md` | `rounded-md` | Buttons, inputs, tags, popovers, and standard controls |
| `--radius-lg` | `rounded-lg` | Accordions, previews, grouped controls, and medium surfaces |
| `--radius-xl` | `rounded-xl` | Cards, dialogs, side navigation, and application frames |
## Match radius to hierarchy
Radius should reinforce the relationship between a container and its children. An outer surface generally uses the same or a larger radius than the controls nested inside it.
```text
Application frame → extra large
Card or panel → large or extra large
Input or button → medium
Menu item or icon → small
```
Avoid mixing several radii within one compact component. A clear outer shape and one consistent nested shape are usually enough.
## Controls
Interactive controls use medium radius by default. It provides a visible shape without making dense interfaces feel soft or decorative. Small radius is useful for controls nested inside another rounded surface, such as menu items, tags, or close actions.
The radius does not determine the target size. A control can remain visually compact while preserving an adequate pointer and touch area.
## Surfaces and overlays
Cards and persistent panels generally use large or extra-large radius. Temporary overlays use a radius that matches their scale: a compact tooltip may use small radius, while a dialog can use extra large.
Sheets that meet a viewport edge may leave that edge square. Radius should describe the exposed boundary rather than force rounding where the surface continues beyond the viewport.
## Circular and pill shapes
Use a fully rounded shape when geometry carries meaning:
- circular avatars and status indicators
- icon-only controls designed as circles
- pills whose width changes with short, single-line content
Do not make every badge, input, or button pill-shaped. Full rounding creates a stronger visual voice than the core radius scale and should remain intentional.
## Focus and clipping
Focus indicators must follow the component shape and remain visible against nearby surfaces. Avoid clipping an outer focus ring with an overflow-hidden parent.
When a container must clip content, place the focusable element inside the clipping boundary or use an inset focus treatment with sufficient contrast.
## Customization
Override semantic radius tokens when adapting the complete Zenos theme:
```css
:root {
--radius-sm: 0.25rem;
--radius-md: 0.375rem;
--radius-lg: 0.5rem;
--radius-xl: 0.75rem;
}
```
Use `className` for an isolated product-specific shape. Repeated overrides usually indicate that the theme tokens should change instead.
Keep the scale ordered, subtle, and visually distinct. Radius supports hierarchy; it should not become the primary decoration.
Source: https://zenos-ui.pages.dev/foundations/radius/
---
# Elevation
Semantic surfaces and shadows for expressing depth and hierarchy.
Elevation describes how a surface relates to the content around it. Zenos pairs semantic surface colors with restrained shadows so the same hierarchy remains clear in light and dark themes.
```tsx
import { Box, Grid, Stack, Text } from "@zentara-co/zenos-ui";
function BoxElevationExample() {
const elevations = [
{ value: "sunken", level: "−1", description: "Recessed regions" },
{ value: "surface", level: "0", description: "Page surface" },
{ value: "container", level: "+1", description: "Grouped content" },
{ value: "raised", level: "+2", description: "Floating controls" },
{ value: "overlay", level: "+3", description: "Temporary layers" },
] as const;
return (
{elevations.map(({ value, level, description }) => (
Level {level}
{value}
{description}
))}
);
}
```
## Levels
| Level | Purpose | Shadow |
| ----------- | ---------------------------------------------- | --------- |
| `sunken` | Recessed wells, inset regions, and work areas | None |
| `surface` | The standard application content plane | None |
| `container` | Subtle grouping within the current surface | None |
| `raised` | Persistent content lifted above nearby content | `raised` |
| `overlay` | Temporary UI above the application hierarchy | `overlay` |
Use the lowest level that communicates the relationship. A border may clarify a boundary, but it should not replace elevation when depth is meaningful.
## Surface and shadow tokens
Raised and overlay treatments combine two token families:
```css
.raised-surface {
background: var(--elevation-surface-raised-default);
box-shadow: var(--elevation-shadow-raised);
}
.overlay-surface {
background: var(--elevation-surface-overlay-default);
box-shadow: var(--elevation-shadow-overlay);
}
```
| Token | Role |
| --------------------------------------- | -------------------------------- |
| `--elevation-surface-sunken-default` | Recessed surface color |
| `--elevation-surface-default` | Base content surface |
| `--elevation-surface-container-default` | Grouped container surface |
| `--elevation-surface-raised-default` | Raised surface color |
| `--elevation-surface-overlay-default` | Overlay surface color |
| `--elevation-shadow-raised` | Compact raised shadow |
| `--elevation-shadow-overlay` | Strong overlay shadow |
| `--elevation-shadow-overflow` | Scroll and overflow boundary cue |
Surface roles also provide `hover` and `pressed` values where interaction applies. Prefer the `Box` `elevation` prop for normal composition; use tokens directly when styling application-specific surfaces.
## Tailwind utilities
Zenos exposes the semantic elevation values to Tailwind:
```tsx
Overlay content
```
## Dark mode
Dark mode changes both the surface colors and shadow construction. Overlay shadows gain a subtle perimeter so dark surfaces remain distinguishable without relying on a bright border. Use semantic tokens and utilities rather than copying the light-theme shadow values.
## Usage guidance
- Keep page content on `surface` or `sunken` levels.
- Use `container` to group related information without implying interactivity.
- Use `raised` for persistent floating controls and lifted cards.
- Reserve `overlay` for popovers, menus, dialogs, and similar temporary layers.
- Do not communicate focus, selection, or validation through elevation alone.
Elevation controls visual depth only. Positioning, stacking context, focus management, and overlay behavior remain the responsibility of the relevant component or application layout.
Source: https://zenos-ui.pages.dev/foundations/elevation/
---
# Motion
Use purposeful, interruptible motion that explains state and respects reduced-motion preferences.
Motion should explain what changed, where an element came from, or how two states relate. It should never delay a task, hide essential feedback, or become the only way a state is communicated.
Zenos keeps routine motion short and quiet. Small anchored surfaces respond immediately, ordinary controls and disclosures use a measured base rhythm, and larger spatial transitions receive slightly more time.
## Duration
Zenos components currently use three practical duration bands:
| Rhythm | Duration | CSS variable | Utility | Typical use |
| ------ | -------: | ------------------------ | ---------------------- | ------------------------------------------------------------------------- |
| Fast | `150ms` | `--motion-duration-fast` | `duration-motion-fast` | Popovers, menus, tooltips, indicators, and immediate feedback |
| Base | `200ms` | `--motion-duration-base` | `duration-motion-base` | Dialogs, sheets, accordions, switches, carets, and ordinary state changes |
| Slow | `300ms` | `--motion-duration-slow` | `duration-motion-slow` | Lightboxes, large media, and transitions with greater visual distance |
Choose the shortest duration that keeps the relationship understandable. A small opacity change should not wait for a large panel transition, while a full-screen media change may need more time than a checkbox indicator.
The same values are exported for JavaScript-driven animation:
```tsx
import { motionDuration } from "@zentara-co/zenos-ui";
element.animate(keyframes, { duration: motionDuration.base });
```
## Easing
The curves below share one duration in the preview so the change in velocity is visible. Reset and replay the tracks rather than judging a curve from its name alone.
```tsx
import { Button, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
const motionEasingRows = [
{ label: "Out", utility: "ease-motion-out", use: "UI enter and exit" },
{ label: "In out", utility: "ease-motion-in-out", use: "On-screen movement" },
{ label: "Drawer", utility: "ease-motion-drawer", use: "Sheets and large panels" },
{ label: "Sine", utility: "ease-motion-sine", use: "Oscillation" },
{ label: "Spring", utility: "ease-motion-spring", use: "Rewarding confirmation" },
] as const;
function MotionEasingExample() {
const [played, setPlayed] = useState(false);
return (
{motionEasingRows.map((row) => (
{row.utility}
{row.use}
))}
);
}
```
| Curve | CSS variable | Utility | Use |
| ------ | ---------------------- | -------------------- | ------------------------------------------------- |
| Out | `--motion-ease-out` | `ease-motion-out` | Entering, exiting, expanding, and settling |
| In out | `--motion-ease-in-out` | `ease-motion-in-out` | Moving between two equally important positions |
| Drawer | `--motion-ease-drawer` | `ease-motion-drawer` | Large sheets and panels that travel farther |
| Sine | `--motion-ease-sine` | `ease-motion-sine` | Multi-stop oscillation such as a restrained shake |
| Spring | `--motion-ease-spring` | `ease-motion-spring` | Small, rewarding confirmation moments |
Use the out curve for elements entering, exiting, expanding, or moving toward a resting position. It responds quickly at the beginning and settles without making the interface feel delayed. Use the symmetric in-out curve only when both ends of the movement carry equal weight.
Drawer gives large surfaces a confident start without extending the overall duration. Sine leaves and arrives gently, which prevents a multi-stop shake from pausing harshly at every extreme. Spring deliberately overshoots; reserve it for a checkmark, confirmation, or a control popping into place—not menus, dialogs, validation errors, or routine navigation.
For JavaScript animation, use the values from the same public contract:
```tsx
import { motionDuration, motionEasing } from "@zentara-co/zenos-ui";
element.animate(keyframes, {
duration: motionDuration.base,
easing: motionEasing.out,
});
```
The curve, duration, and distance form one decision. A longer travel distance can justify the slow rhythm, but increasing duration does not rescue motion that lacks a clear purpose.
## Prefer interruptible transitions
Use CSS transitions for motion driven by hover, focus, pressed, selected, expanded, or open state. A transition can reverse from its current position when the state changes halfway through.
Zenos Button uses the fast duration and out easing for its pressed scale. Use `disableMotion` for an individual button when movement would duplicate feedback supplied by its surrounding interaction:
```tsx
```
The opt-out removes the transition and scale while retaining the immediate pressed color, focus treatment, and native activation behavior.
```tsx
```
Reserve keyframes for sequences that must run independently, such as a loader, a one-time overlay entrance, or a staged effect with more than two states. Do not use a looping animation merely to make static content appear active.
## Name the properties
Transition only the properties that communicate the state change:
```tsx
// Color feedback
// Spatial feedback
```
Avoid `transition-all`. It can animate an unrelated property introduced later and makes layout or paint work harder to diagnose. Prefer composited `opacity` and `transform` for spatial motion. Animate `height` only when revealing measured content, as Accordion and Collapsible do.
Tailwind CSS v4 represents `translate`, `scale`, and `rotate` as individual properties. Use `transition-transform` when those transform-related properties move together, or name the individual property in a custom transition list.
## Enter and exit with different emphasis
Entrance motion may establish origin with a small fade, scale, or directional offset. Exit motion should be equal or quieter: shorter travel, less scale, and no dramatic collapse.
Anchored Zenos surfaces derive direction from their placement. A popover below its trigger enters from above; one positioned to the right enters from the left. Dialogs and alerts use a restrained fade and scale because their origin is the current viewport rather than an edge.
Keep travel small. Motion should preserve the user's spatial model, not force their attention to follow an object across the screen.
## Stagger related content
When a small group mounts together, revealing every item as one block can hide its reading order. `Stagger` assigns a token-based delay to each direct element child, plays once on mount, and removes the entire effect under reduced motion.
```tsx
import { Button, Card, Stagger, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
const staggerItems = ["Overview", "Analytics", "Reports", "Members", "Billing", "Settings"];
function StaggerExample() {
const [replay, setReplay] = useState(0);
return (
{staggerItems.map((item) => (
{item}
))}
);
}
```
```tsx
import { Card, Stagger } from "@zentara-co/zenos-ui";
{items.map((item) => (
{item.name}
))}
;
```
The default `step` is `70ms`, also exported as `motionStaggerStep` and available as `--motion-stagger-step`. Use `inView` for below-the-fold content and `blur` for an optional 4px focus pull. Direct children must forward `style` and `data-*` attributes. Keep cascades short; a large data set should not make its final rows wait to become readable.
## Turn one indicator instead of swapping two
When one mark represents two directions, preserve the mark and rotate it:
```tsx
```
Replacing a down caret with a separate up caret removes the visible relationship between the states. Swapping icons is appropriate only when the symbols communicate genuinely different actions or meanings.
## Avoid unsolicited entrance motion
Content visible on the first page render should usually be present without an entrance animation. The user did not initiate a state change, and animating the entire page delays scanning.
Use entrance motion for an element that is newly mounted because of an action, for an overlay whose origin matters, or for a focused sequence where the transition explains hierarchy. Do not replay it on every render or route update.
Base UI exposes starting and ending state attributes for overlays and panels. Zenos uses those attributes so the motion follows the component lifecycle instead of relying on arbitrary timeouts.
## Respect reduced motion
Every non-essential transition and keyframe must have a reduced-motion treatment. In utility classes, use `motion-reduce:transition-none`, `motion-reduce:animate-none`, or gate an effect behind `motion-safe:`.
Reduced motion does not mean reduced information. Apply the final state immediately, retain visible focus and status feedback, and replace spatial movement with a static change or a simple state update.
```css
@media (prefers-reduced-motion: reduce) {
.product-transition {
animation: none;
transition: none;
}
}
```
Ambient and looping motion deserves particular care. A loader can retain a static progress shape or accessible status text when its animation stops. Never require movement to prove that work is happening.
## Performance
Prefer changes the browser can composite, especially `opacity` and transform-related properties. Avoid animating layout properties such as width, padding, or position unless the relationship cannot be expressed another way.
Do not add `will-change` preemptively. It can keep extra compositor layers alive and consume memory. Apply it only after measuring a real first-frame problem, limit it to the animated property, and remove it when the transition ends.
## Review checklist
Before shipping motion, verify:
- [ ] The movement explains a state, origin, hierarchy, or relationship.
- [ ] The duration matches the distance and complexity.
- [ ] Interactive state changes use interruptible transitions.
- [ ] Only intended properties animate.
- [ ] Exit motion is no stronger than entrance motion.
- [ ] Initial page content does not animate without purpose.
- [ ] Keyboard and pointer interactions can retarget the transition cleanly.
- [ ] Reduced motion preserves the same final state and information.
- [ ] Focus, announcements, and input remain available throughout the transition.
- [ ] Performance is tested on the actual surface, not inferred from the property name.
Motion is part of interaction design, not decoration added after implementation. Review it alongside keyboard behavior, focus management, responsive layout, and content—not as a separate polish pass.
Source: https://zenos-ui.pages.dev/foundations/motion/
---
# Theme customization
Adapt Zenos through global and scoped overrides for colors, typography, shape, and elevation.
Make Zenos fit your product without rewriting its components. Theme customization changes shared visual decisions through CSS variables, while component props and local styles handle individual variations.
This guide explains **how to customize the system**. Browse [Colors](/foundations/colors/) for the color explorer and naming model, or [Dark mode](/foundations/dark-mode/) for theme selection, persistence, and system preferences.
## Understand the layers
Primitivered-600--color-red-600
A reusable value with no product meaning.
→
SemanticBrand border--border-brand
A role that adapts to the theme.
→
ComponentButtonborder-border-brand
A component that consumes the role.
Primitive tokens describe values; semantic tokens describe purpose. Override the semantic role when you want to change its meaning across the application. Do not edit package source or copy component selectors into your theme.
For the complete foundation references, see [Colors](/foundations/colors/), [Fonts](/foundations/fonts/), [Typography](/foundations/typography/), [Radius](/foundations/radius/), and [Elevation](/foundations/elevation/). Structural spacing uses the typed [layout spacing scale](/foundations/spacing/), not the color naming model.
## Load styles before overrides
Put package imports at the top of your global `index.css`, before your application theme. For Tailwind CSS v4:
```css title="src/index.css"
@import "tailwindcss";
@import "@zentara-co/zenos-ui/tailwind.css";
@import "./styles/product-theme.css";
```
This entrypoint makes the tokens available as Tailwind utilities and to Tailwind CSS IntelliSense. Without Tailwind, replace the two package imports with `@import "@zentara-co/zenos-ui/styles.css";`. Load only your local `index.css` from the application entry; do not import both Zenos stylesheets.
Keep shared theme decisions in one application-owned stylesheet. Start with the roles your product needs; unspecified roles retain their Zenos values.
## Customize the application theme
The following examples use an explicit `data-theme="light"` or `data-theme="dark"` on the document root. Let your application's theme control manage that attribute; see [Dark mode](/foundations/dark-mode/) for the public `useTheme` hook and initialization guidance.
```css title="src/styles/product-theme.css"
:root[data-theme="light"] {
--background-default: #ffffff;
--background-neutral-card: #f1f5f9;
--text-default: #0f172a;
--text-subtle: #475569;
--icon-default: #0f172a;
--border-default: rgb(15 23 42 / 14%);
}
:root[data-theme="dark"] {
--background-default: #10151a;
--background-neutral-card: #1e293b;
--text-default: #f1f5f9;
--text-subtle: #cbd5e1;
--icon-default: #f1f5f9;
--border-default: rgb(241 245 249 / 16%);
}
```
Override related surfaces and foregrounds together, then check the resulting contrast. One brand variable does not recolor every component: different variants consume different emphasis and state roles. Use the [color explorer](/foundations/colors/) to identify the complete set you need.
Zenos also supports `.dark`. If your application uses classes instead of attributes, apply your overrides to the same convention. If you rely on CSS-only system preference without an explicit mode, include your custom dark values in a matching `prefers-color-scheme: dark` media query too; attribute-only overrides will not run without the attribute.
## Scope a product theme
Put overrides on a wrapper when a workspace, campaign, or embedded area needs a different visual treatment. Apply the application's active mode to that wrapper so its semantic values are selected explicitly.
```tsx
import { Button } from "@zentara-co/zenos-ui";
function CampaignActions() {
return (
);
}
```
```css
[data-product-theme="campaign"][data-theme="light"] {
--background-brand-subtle-default: #6d28d9;
--background-brand-subtle-hover: #5b21b6;
--background-brand-subtle-pressed: #4c1d95;
--border-brand: #6d28d9;
--text-brand: #6d28d9;
}
[data-product-theme="campaign"][data-theme="dark"] {
--background-brand-subtle-default: #5b21b6;
--background-brand-subtle-hover: #6d28d9;
--background-brand-subtle-pressed: #7c3aed;
--border-brand: #c4b5fd;
--text-brand: #c4b5fd;
}
```
Descendants inherit the scoped variables. Explicit theme containers can define their own values, so place overrides on the boundary that owns the treatment rather than assuming they will cross every nested theme.
A nested light container does not cancel `dark:` utilities activated by a dark ancestor. Keep scoped brand treatments in the application's active mode unless you have verified mixed-mode styling for the affected components.
Portaled content outside the wrapper does not inherit its variables. For dialogs, popovers, and other overlays, apply the same theme boundary to the rendered content or use the component's supported portal-container option where available. Test triggers and overlays together.
## Customize typography and shape
Color is only one part of a theme. Font-family and radius variables can be overridden through the same cascade:
```css
:root {
--font-heading: "Product Sans", ui-sans-serif, system-ui, sans-serif;
--font-body: "Product Sans", ui-sans-serif, system-ui, sans-serif;
--font-code: "Product Mono", ui-monospace, monospace;
--radius-sm: 0.25rem;
--radius-md: 0.5rem;
--radius-lg: 0.75rem;
--radius-xl: 1rem;
}
```
The product font names above are placeholders: load the actual font files in your application, as described in [Fonts](/foundations/fonts/). Zenos does not fetch them for you.
Preserve the hierarchy when adjusting scales. Larger radius roles should remain at least as large as smaller ones. When changing typography sizes, review line heights, label wrapping, and control density together; see [Typography](/foundations/typography/) and [Radius](/foundations/radius/) for the available roles.
## Customize elevation
Elevation combines a surface color with a shadow. Override the complete shadow value, not a shadow-color token when you intend to change its geometry:
```css
:root[data-theme="light"] {
--elevation-shadow-overlay: 0 12px 24px rgb(15 23 42 / 16%), 0 0 0 1px rgb(15 23 42 / 8%);
}
:root[data-theme="dark"] {
--elevation-shadow-overlay: 0 12px 24px rgb(0 0 0 / 40%), 0 0 0 1px rgb(241 245 249 / 12%);
}
```
Pair overlay shadows with `--elevation-surface-overlay-default`, and raised shadows with their corresponding raised surfaces. See [Elevation](/foundations/elevation/) for depth roles and their Tailwind utilities.
## Choose the right customization level
- **Component props:** Use `variant`, `size`, and other supported props for a component's existing visual treatments.
- **Theme variables:** Override shared decisions when the same change should affect every consumer of a role in a scope.
- **Local styles:** Use `className` or `style` for one-off composition, such as a specific card's width or spacing.
- **Application tokens:** Add a named product role when existing Zenos roles do not express its meaning.
Avoid deep selectors, private package imports, and assumptions about internal child order. If a local override repeats across features, consider moving the shared decision into the theme.
Semantic utilities and direct CSS variables consume the same roles:
```tsx
Workspace overview
```
```css
.workspace-panel {
background: var(--background-neutral-card);
color: var(--text-default);
border: 1px solid var(--border-default);
}
```
## Add application-specific roles
Keep product concepts in application-owned variables. Reference a Zenos role when it already expresses the visual intent:
```css
[data-product-theme] {
--risk-critical-surface: var(--background-danger-subtlest-default);
--risk-critical-text: var(--text-danger-default);
}
.risk-banner {
background: var(--risk-critical-surface);
color: var(--risk-critical-text);
}
```
Define these aliases on the theme boundary where they are consumed so their references resolve against that boundary's semantic values. Document the purpose and owner of new roles. Only choose primitive values when a product role deliberately needs a treatment that differs from the existing semantic system.
## Validate your theme
- Check surfaces, text, icons, borders, and focus indicators together in both modes.
- Review default, hover, pressed, selected, disabled, invalid, and loading states.
- Test nested theme boundaries and portaled overlays, not just the page canvas.
- Check font loading, zoom, long labels, and responsive layouts after typography changes.
- Keep state understandable through labels, shapes, or icons as well as color.
- Verify contrast on the final rendered surface, especially for translucent values.
Use [Colors](/foundations/colors/) to inspect values, this guide to customize them, and [Dark mode](/foundations/dark-mode/) to manage how a mode is selected.
Source: https://zenos-ui.pages.dev/foundations/tokens/
---
# Dark mode
Apply Zenos' semantic theme in class-based or data-attribute applications.
Zenos dark mode is a semantic theme, not an inverted color filter. Surfaces, text, borders, elevation, feedback colors, and interaction states receive deliberate values for each mode.
Zenos recognizes either a `.dark` ancestor or `data-theme="dark"` on the document root.
LightSecurity overview
12 assets require review.
DarkSecurity overview
12 assets require review.
## Apply a theme
Keep the class and data attribute synchronized when the application supports both conventions:
```tsx
document.documentElement.classList.toggle("dark", theme === "dark");
document.documentElement.dataset.theme = theme;
```
Components respond through semantic variables. Application code should not branch between light and dark hex values when one semantic role can describe the intent.
## Global theme hook
The public `useTheme` hook reads the preference in this order:
1. A valid persisted value
2. The document's `data-theme` value
3. The document's `.dark` class
4. The operating-system preference
5. The configured fallback
```tsx
import { useTheme } from "@zentara-co/zenos-ui";
function ThemeControl() {
const { theme, setTheme, toggleTheme } = useTheme();
return (
);
}
```
By default, the hook stores the value under `theme`, updates both root selectors, reacts to changes from another browser tab, and follows system changes until a preference is stored.
See the [`useTheme` hook reference](/hooks/use-theme/) for every option, return value, synchronization rule, and SSR consideration.
Use a product-specific `storageKey` when multiple applications share a domain. Set it to `null` when persistence is managed elsewhere.
## Theme toggle button
`ThemeToggleButton` composes the global hook with an accessible button and an optional View Transition reveal.
```tsx
(theme === "dark" ? : )}
shape="circle"
/>
```
The button sets `aria-pressed`, supplies a default accessible name, forwards native button props, and skips the visual transition when the user prefers reduced motion or the browser does not support View Transitions.
Use the controlled `theme` and `onThemeChange` props when another state manager owns the preference.
## Prevent a theme flash
Apply a stored or system theme before the first paint when server-rendering or generating a static application. Place a small inline script in the document head before styles render:
```html
```
If storage access can be restricted, wrap it in `try/catch` and fall back to the system preference.
## Customize both modes
Override roles rather than component selectors:
```css
:root {
--background-default: #ffffff;
--text-default: #0f0f0f;
--border-default: rgb(15 15 15 / 8%);
}
[data-theme="dark"] {
--background-default: #0f0f0f;
--text-default: #f8f9fa;
--border-default: rgb(255 255 255 / 12%);
}
```
Check every interactive state in both modes: default, hover, pressed, selected, focused, disabled, invalid, and loading.
## Surfaces and elevation
Dark interfaces need visible surface hierarchy without bright borders around every region. Use semantic elevation surfaces and shadows so cards, raised controls, and overlays remain distinct from the canvas.
Avoid pure black for every layer. Small differences between canvas, card, raised, and overlay surfaces make dense interfaces easier to scan.
## Images, charts, and code
- Verify logos and illustrations remain legible on both surfaces.
- Use semantic chart tokens rather than light-only series colors.
- Keep grid lines and axes quieter than the plotted data.
- Test code blocks, selection, syntax colors, and scrollbars independently.
- Do not reduce image opacity globally as a substitute for a dark-mode treatment.
## Testing
Test the complete interface in light, dark, and system-selected modes. Verify persistence across reloads, synchronization across tabs, initial render without a flash, forced-colors behavior, reduced motion, and readable focus indicators.
The documentation theme control follows the same browser preference and lets Starlight manage persistence, avoiding a second competing theme state.
Source: https://zenos-ui.pages.dev/foundations/dark-mode/
---
# RTL
Configure Zenos for Arabic, Hebrew, Persian, and mixed-direction product interfaces.
Zenos supports right-to-left interfaces through native HTML direction, logical layout utilities, and the [Direction component](/components/direction/) for interactive Base UI behavior. Set both layers: `dir` controls browser layout and text flow, while `DirectionProvider` keeps keyboard navigation, positioning, sliders, menus, and portalled surfaces aligned with that direction.
```tsx
import { ArrowRightIcon } from "@phosphor-icons/react";
import { Button, Card, DirectionProvider, Field, Input, Stack, Switch, Text } from "@zentara-co/zenos-ui";
function RtlFoundationExample() {
return (
مرحباً بعودتكأدخل بياناتك للوصول إلى مساحة العمل.البريد الإلكتروني} />
تذكرني
}>
تسجيل الدخول
);
}
```
## Configure the application root
Set the document language and direction as early as possible, ideally in the server-rendered root element. Then wrap the application with Zenos' provider.
```tsx
import { DirectionProvider } from "@zentara-co/zenos-ui";
export function App({ children }: { children: React.ReactNode }) {
return {children};
}
```
```html
```
Use `direction="ltr" | "rtl"` on `DirectionProvider`. The default is `ltr`. Zenos does not change `document.documentElement` for you because applications own language selection, SSR output, persistence, and hydration.
## Scope a mixed-direction region
An application can keep its document LTR while rendering an RTL conversation, preview, or embedded workflow. Keep the DOM attribute and provider on the same boundary:
```tsx
```
Plain text can use `dir="auto"` when its direction is unknown, but interactive component trees need an explicit provider direction.
## Write direction-independent layouts
Prefer logical language in application styles and component composition:
| Physical | Logical equivalent |
| -------------------------- | ------------------------- |
| `left-*` / `right-*` | `start-*` / `end-*` |
| `ml-*` / `mr-*` | `ms-*` / `me-*` |
| `pl-*` / `pr-*` | `ps-*` / `pe-*` |
| `border-l` / `border-r` | `border-s` / `border-e` |
| `text-left` / `text-right` | `text-start` / `text-end` |
Physical values are still correct when the meaning is genuinely physical—for example, a comparison handle anchored to the left side of an image. Zenos' `Sheet` accepts `inline-start` and `inline-end` for language-aware edges while retaining `left` and `right` for explicitly physical placement.
`AppShell` places Side Nav at inline start and opens its compact navigation sheet from that same edge. Table headings, toggles, switches, pagination, breadcrumbs, submenu indicators, gallery controls, and horizontal resize keyboard behavior also follow direction.
## Directional icons
Mirror arrows and chevrons whose meaning is backward, forward, expand, or collapse. Do not mirror logos, checkmarks, media controls, or icons that depict a physical object.
```tsx
}>Continue
```
Built-in Zenos pagination, breadcrumb, menu, and lightbox chevrons mirror automatically. Consumer-provided icons remain under application control because Zenos cannot infer their meaning.
## Portals and overlays
Keep `DirectionProvider` above dialogs, menus, selects, popovers, tooltips, and other portalled components. Base UI uses the context to resolve alignment and keyboard behavior even when the popup is mounted outside the local DOM subtree. The document-level `dir` attribute ensures logical CSS and text alignment also reach the portal container.
Use logical Sheet sides for localized applications:
```tsx
Settings
```
## Fonts and content
Choose a font family with complete glyph coverage for the target language. Keep user-entered identifiers, email addresses, URLs, code, and numbers in their natural direction; use a nested `dir="ltr"` or CSS `unicode-bidi` treatment only for the specific content that needs it.
Translated labels are often longer than their English equivalents. Test narrow containers, zoom, validation messages, loading states, and mixed Arabic or Hebrew text with Latin product names.
## Testing checklist
- Render representative pages with `dir="rtl"` and `DirectionProvider direction="rtl"`.
- Verify arrow-key behavior for sliders, resizable panels, galleries, tabs, menus, and composite controls.
- Open every portalled surface and confirm alignment, entry motion, and close controls.
- Check that Side Nav, leading and trailing icons, table alignment, and form labels follow inline start.
- Test mixed-direction content, long translations, keyboard focus order, screen-reader labels, and browser zoom.
- Run accessibility and visual-regression coverage in both LTR and RTL for critical product flows.
Source: https://zenos-ui.pages.dev/foundations/rtl/
---
# Accessibility
How Zenos preserves semantics and how consumers complete them.
Accessibility is part of the component contract and the product workflow. Zenos provides a reliable foundation, while the consuming application supplies the context that a component library cannot know.
## Responsibility model
```text
Native HTML → semantic foundation
Base UI → complex keyboard, focus, and ARIA behavior
Zenos → preserves and composes those semantics
Consumer → supplies meaningful labels, content, and workflows
```
## What Zenos provides
- Native controls where the browser already provides the correct semantics.
- Base UI behavior for dialogs, menus, selection controls, tabs, and anchored overlays.
- Forwarded refs, native props, event handlers, `aria-*`, and `data-*` attributes.
- Keyboard navigation, focus management, Escape handling, and focus return where applicable.
- Visible focus treatment and semantic `disabled`, `invalid`, and `required` states.
- Field relationships between labels, controls, descriptions, and errors.
- Reduced-motion behavior for transitions and animation.
- Semantic tokens that support readable light and dark themes.
## Consumer responsibilities
Name controls
Give icon-only actions, landmarks, forms, and navigation regions concise accessible names.
Write useful content
Provide meaningful headings, dialog titles, instructions, status messages, and actionable
errors.
Preserve focus
Keep a logical order, return focus after overlays close, and never remove an outline without an
equivalent.
Test the workflow
Validate complete tasks with keyboard, zoom, assistive technology, real content, and application
state.
## Start with native semantics
Use a `button` for actions and an anchor for navigation. Keep heading levels meaningful. Use lists, tables, labels, and landmarks for their intended purpose.
Zenos polymorphism does not make every element interchangeable. When using `as`, preserve the semantic role and required native behavior of the resulting element.
## Labels, descriptions, and errors
Use `Field` to establish form relationships:
```tsx
EmailUsed for security notifications.Enter a valid email address.
```
A placeholder is not a label. Error text should explain how to recover, and invalid state should not rely on color alone.
## Keyboard interaction
Native controls and Base UI primitives provide their established keyboard patterns. Consumers should not replace those handlers unless the product requires a different documented interaction.
Verify at minimum:
- `Tab` and `Shift+Tab` move through controls in a logical order.
- `Enter` and `Space` activate the expected controls.
- `Escape` closes temporary surfaces without closing unrelated parents.
- Arrow keys, Home, and End work where the component pattern defines them.
- Disabled controls are skipped or announced according to their semantics.
## Focus management
Focus must remain visible in light and dark themes. Dialogs and modal sheets contain focus while open and return it to a sensible trigger when closed. Popovers and menus should not leave focus on removed content.
Composition through Base UI's `render` prop must preserve the supplied props, ref, event handlers, and ARIA attributes on the rendered element.
## Content and visual design
- Maintain sufficient contrast for text, icons, borders, and focus rings.
- Do not communicate status with color alone.
- Allow labels, descriptions, and errors to wrap.
- Keep controls reachable at 200% browser zoom.
- Respect `prefers-reduced-motion` and avoid essential information in animation.
- Test right-to-left content and logical navigation where direction matters.
- Provide text alternatives for meaningful images; use empty alt text for decoration.
## Dynamic content
Announce important asynchronous results with an appropriate live region, but avoid narrating every intermediate update. Loading indicators need nearby context when the outcome is not otherwise clear.
Move focus only when it helps the user continue the task. Validation should normally preserve focus and connect the control to its error instead of jumping unexpectedly.
## Testing strategy
Zenos uses several layers because no single tool can verify accessibility:
| Layer | Purpose |
| -------------------------- | --------------------------------------------------------------------------------- |
| Vitest and Testing Library | Roles, accessible names, state, relationships, and component contracts |
| Playwright | Browser keyboard behavior, focus movement, portals, and complete consumer flows |
| axe | Common automated WCAG failures on representative rendered pages |
| Manual review | Screen readers, zoom, contrast, motion, RTL, long content, and task comprehension |
Use accessible queries such as `getByRole` in tests. They validate the public experience and remain more stable than classes or private selectors.
## Manual checklist
- Complete the flow with keyboard only.
- Verify Tab, Shift+Tab, Enter, Space, Escape, arrows, Home, and End where relevant.
- Confirm focus is always visible and returns after an overlay closes.
- Test at 200% zoom and with large system text.
- Enable reduced motion, dark mode, and RTL.
- Review labels, descriptions, status messages, and errors with a screen reader.
- Test empty, loading, invalid, disabled, and long-content states.
- Confirm touch targets remain usable on a narrow viewport.
Automated checks find common failures; they do not certify an experience or replace testing with disabled users and assistive technology.
Source: https://zenos-ui.pages.dev/foundations/accessibility/
---
# Box
A minimal polymorphic structural wrapper.
`Box` is the lowest-level Zenos layout primitive. It gives a semantic element a stable slot and optional elevation while leaving spacing, sizing, borders, and display behavior to the consumer.
```tsx
import { PulseIcon } from "@phosphor-icons/react";
import { Badge, Box, Stack, Text } from "@zentara-co/zenos-ui";
function BoxExample() {
return (
Workspace summary
Activity across all environments
);
}
```
## Import
```tsx
import { Box } from "@zentara-co/zenos-ui";
```
## Elevation
Elevation describes the surface's relationship to surrounding content. It applies semantic surface tokens and, where appropriate, shadows and interaction states.
```tsx
import { Box, Grid, Stack, Text } from "@zentara-co/zenos-ui";
function BoxElevationExample() {
const elevations = [
{ value: "sunken", level: "−1", description: "Recessed regions" },
{ value: "surface", level: "0", description: "Page surface" },
{ value: "container", level: "+1", description: "Grouped content" },
{ value: "raised", level: "+2", description: "Floating controls" },
{ value: "overlay", level: "+3", description: "Temporary layers" },
] as const;
return (
{elevations.map(({ value, level, description }) => (
Level {level}
{value}
{description}
))}
);
}
```
Use the levels consistently:
- `sunken` for recessed wells and inset regions
- `surface` for the standard content plane
- `container` for grouped content on a surface
- `raised` for elements lifted above nearby content
- `overlay` for the highest temporary surfaces
Elevation adds visual hierarchy; it does not add layout, dialog behavior, or stacking context.
## Polymorphism
Use `as` to choose the correct semantic element. Native attributes and the forwarded ref follow that element, so an anchor accepts `href`, an article retains article semantics, and a section can use `aria-labelledby`.
```tsx
import { ArrowRightIcon, ShieldPlusIcon } from "@phosphor-icons/react";
import { Badge, Box, Grid, Stack, Text } from "@zentara-co/zenos-ui";
function BoxPolymorphicExample() {
return (
Review
Incident report
Rendered as a semantic article with its own heading.
Read the Box API
A native link with href and visible focus behavior.
);
}
```
## Responsibility
Use Box when semantic wrapping, elevation, or a stable customization hook is enough. Use Stack, Grid, Center, Container, or Section when the structure has a repeated layout rule. One-off application styling belongs in `className`:
```tsx
...
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element and source of native prop and ref types. |
| elevation | sunken \| surface \| container \| raised \| overlay | — | Optional semantic surface level, including interaction states and shadows. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Box adds no role or interaction behavior. Choose `as` for the content's meaning and preserve native semantics. If styling Box as an interactive surface, render an actual link or button rather than adding click behavior to a `div`, and keep a visible focus indicator.
Source: https://zenos-ui.pages.dev/layout/box/
---
# Stack
Arrange siblings along one responsive axis with typed spacing, alignment, and sizing.
`Stack` arranges siblings in a row or column. Its direction, spacing, alignment, distribution, wrapping, and padding can adapt at Zenos breakpoints.
```tsx
import { Button, Cluster, Stack, StackItem, Text } from "@zentara-co/zenos-ui";
function StackExample() {
return (
Production workspace
12 services monitored
);
}
```
## Import
```tsx
import { Stack, StackItem } from "@zentara-co/zenos-ui";
```
## Responsive direction
Stack uses `column` by default. Its direction accepts only `row` and `column`, either directly or through a responsive object.
```tsx
...
```
Use HStack or VStack when the direction is fixed and logical-axis alignment reads more clearly.
## Wrapping and spacing
`gap`, `align`, `justify`, `wrap`, and every padding prop accept responsive values. Wrap accepts booleans as shorthand, plus `nowrap`, `wrap`, and `wrap-reverse`.
```tsx
import { Badge, Stack } from "@zentara-co/zenos-ui";
function StackWrapExample() {
return (
{["Authentication", "Infrastructure", "Data protection", "Observability"].map((item) => (
{item}
))}
);
}
```
Logical padding props such as `paddingInlineStart` and `paddingBlockEnd` adapt to writing direction. More specific padding classes can override general padding at the same breakpoint.
## Sizing and scrolling
Stack supports tokenized width, height, minimum, and maximum constraints. `isScrollable` adds overflow scrolling and is most useful with a constrained height or width.
```tsx
import { Box, Stack, Text } from "@zentara-co/zenos-ui";
function StackSizingExample() {
return (
{Array.from({ length: 8 }, (_, index) => (
Activity item {index + 1}
))}
);
}
```
## Semantics
Use `as="ul"` with list-item children for ordered collections, `as="nav"` for navigation, or another element that matches the content. Native props and refs follow the selected element.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| direction | Responsive | column | Responsive main axis. |
| align / justify | Responsive | — | Cross-axis alignment and main-axis distribution. |
| gap | Responsive | 4 | Space between children. |
| wrap | Responsive | false | Responsive flex wrapping. |
| padding / paddingX / paddingY / logical padding props | Responsive | — | Physical and logical responsive padding. |
| width / height / minWidth / maxWidth / minHeight / maxHeight | SizeToken | — | Structural size constraints. |
| isScrollable | boolean | false | Enables overflow scrolling within a constrained Stack. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Responsive direction changes presentation without changing source order. Keep DOM order meaningful for reading and keyboard navigation. Independently scrollable stacks need a visible size constraint and must remain usable at 200% zoom.
Source: https://zenos-ui.pages.dev/layout/stack/
---
# Grid
A responsive CSS Grid container with typed tracks, gaps, alignment, and auto-flow.
`Grid` creates responsive two-dimensional layouts with typed track counts and spacing. It controls the grid container; use GridItem or GridSpan when a child needs explicit placement or spanning.
```tsx
import { Grid, Stack, Text } from "@zentara-co/zenos-ui";
function GridExample() {
return (
{["Assets", "Findings", "Coverage", "Members"].map((label, index) => (
{label}
{[128, 7, 94, 24][index]}
))}
);
}
```
## Import
```tsx
import { Grid } from "@zentara-co/zenos-ui";
```
## Tracks and gaps
`columns` and `rows` accept responsive counts from 1 through 12. `gap` sets both axes, while `columnGap` and `rowGap` refine each axis independently.
```tsx
import { Center, Grid, Text } from "@zentara-co/zenos-ui";
import { type ReactNode } from "react";
function GridDemoTile({ children, className }: { children: ReactNode; className?: string }) {
return (
{children}
);
}
function GridTracksExample() {
return (
{Array.from({ length: 6 }, (_, index) => (
Track {index + 1}
))}
);
}
```
## Auto flow
`autoFlow` controls how auto-positioned children fill explicit tracks. It is a direct value rather than a responsive prop.
```tsx
import { Center, Grid, Text } from "@zentara-co/zenos-ui";
import { type ReactNode } from "react";
function GridDemoTile({ children, className }: { children: ReactNode; className?: string }) {
return (
{children}
);
}
function GridAutoFlowExample() {
return (
{Array.from({ length: 6 }, (_, index) => (
Item {index + 1}
))}
);
}
```
Use `dense`, `row-dense`, or `column-dense` carefully: dense packing may make visual order differ from source order.
## Alignment
`align` controls how items sit on the block axis of their cells. `justify` distributes the grid content on the inline axis. Both accept responsive values. Use GridItem's self-alignment props when only one child differs.
## Semantics
Grid renders a `div` by default. Use `as="ul"` with list-item children for a semantic collection, or another element that matches the content. Grid styles do not remove native list or landmark semantics.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| columns / rows | Responsive<1 \| 2 \| ... \| 12> | columns: 1 | Responsive explicit grid track counts. |
| gap | Responsive | 4 | Shared row and column gap. |
| columnGap / rowGap | Responsive | — | Axis-specific gap overrides. |
| align / justify | Responsive | — | Grid item alignment and content distribution. |
| autoFlow | row \| column \| dense \| row-dense \| column-dense | — | Placement direction for auto-positioned items. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Keep DOM order aligned with the intended reading and keyboard order. Explicit placement and dense flow can rearrange visuals without rearranging the accessibility tree. Test responsive layouts at narrow widths, 200% zoom, and with keyboard focus visible.
Source: https://zenos-ui.pages.dev/layout/grid/
---
# Composition Guide
Choose and combine Zenos layout primitives by structural responsibility.
Zenos layout primitives describe one structural relationship at a time. Compose them instead of asking one component to manage page width, section rhythm, child flow, alignment, and decoration together.
```tsx
import { Badge, Box, Button, Container, Cluster, Grid, Section, Stack, Text } from "@zentara-co/zenos-ui";
function CompositionExample() {
const metrics = [
{ label: "Active projects", value: "18", change: "+3 this month" },
{ label: "Contributors", value: "42", change: "Across 4 teams" },
{ label: "Deployments", value: "126", change: "98.7% successful" },
];
return (
Workspace overview
Product activity at a glance
Each primitive owns one relationship: page rhythm, content width, child flow, or
alignment.
{metrics.map(({ label, value, change }) => (
{label}
{value}
{change}
))}
);
}
```
The example follows an outside-in order: `Section` owns the region and its padding, `Container` constrains the readable width, `Stack` creates vertical rhythm, `Cluster` arranges the heading and actions, and `Grid` adapts the summary cards to available space.
## Mental model
Treat layout as a set of independent relationships:
1. **Region** — What semantic part of the page is this, and how much space surrounds it?
2. **Measure** — Should its content fill the viewport or stop at a maximum width?
3. **Flow** — Do children move along one axis, wrap as a group, or occupy tracks?
4. **Alignment** — Does content need centering or distribution within available space?
5. **Surface** — Does the region need elevation, a border, color, or another application treatment?
Give each relationship one owner. This keeps responsive changes local and prevents nested wrappers from fighting over the same gap, width, or alignment.
## Choose by relationship
Use the narrowest primitive that owns the relationship. For example, use `Cluster` for a toolbar that wraps; do not use `Grid` merely because the toolbar has several children.
## Compose outside in
Start from the largest boundary and move toward the content. Place `Section` outside `Container` when a section background or divider should span the available width while its content remains constrained:
```tsx
{content}
```
Reverse that order only when the section itself should be constrained. A `Section` inside a `Container` creates a narrow semantic region; a `Container` inside a `Section` creates a full-width region with constrained content.
## Responsive values
Responsive layout props accept a direct value or a mobile-first breakpoint object:
```tsx
```
`base` applies everywhere. Each larger breakpoint overrides it and remains active until another value replaces it. Omitted breakpoints inherit the last applicable value through CSS.
Add a breakpoint when the content needs a different relationship, not simply because another breakpoint exists. A card collection may move from one to two columns at `md` and remain there through `2xl`; it does not need a new value at every step.
Prefer responsive props when the primitive owns the behavior:
```tsx
```
Use `className` for application-specific decoration or a layout behavior that is intentionally outside the primitive's API:
```tsx
...
```
## Common composition patterns
### Heading with actions
Use `Cluster` when the actions should stay together and wrap naturally as space narrows:
```tsx
Team members
Manage access to this workspace.
```
### Centered state inside normal flow
Let the surrounding `Stack` own its relationship to siblings and let `Center` own only the state region's internal alignment:
```tsx
```
### Repeated content
Use `Grid` when repeated items should share tracks. The item component owns its internal `Stack`; the parent owns only the gap between items.
```tsx
{projects.map((project) => (
))}
```
## Ownership boundaries
- Let one parent own the gap between siblings. Avoid combining parent `gap` with child margins for the same relationship.
- Let `Container` own maximum width and inline gutters. Do not repeat `max-width` on every child section.
- Let the nearest layout primitive own alignment. Avoid pushing children into position with arbitrary margins.
- Keep decoration on the surface that visually owns it. A border around a group belongs on the group's `Box`, not on each internal layout wrapper.
- Keep feature behavior outside generic layout components. Layout primitives should not fetch data, coordinate routes, or infer application state.
## Avoid unnecessary wrappers
Not every primitive belongs in every composition. If a `Grid` already owns the relationship between cards, it does not need an extra `Stack` solely to exist. If a `Box` has no semantics, elevation, or customization role, a fragment may be clearer.
Add a wrapper when it owns a real boundary: semantics, spacing, width, alignment, responsive behavior, or decoration. Remove it when it only forwards children and duplicates a relationship already owned elsewhere.
## Semantics
All layout primitives use `as` for polymorphism and forward the selected element's native props and ref. Choose elements from the content's meaning: use `section` for a labeled thematic region, `article` for independently distributable content, `nav` for navigation, and `ul` or `ol` for a true list.
Layout appearance alone does not justify a landmark, heading, list, or interactive role. Do not add click handlers to a `Box` or `Stack`; render a native link or button when the surface is interactive. Preserve a logical heading order even when visual size changes.
## Related foundations
- [Spacing](/foundations/spacing/) defines the shared rhythm used by `gap` and padding props.
- [Breakpoints](/foundations/breakpoints/) documents the mobile-first responsive scale.
- [Aspect Ratio](/layout/aspect-ratio/) reserves stable media geometry inside composed layouts.
- [Box](/layout/box/) adds semantic wrapping and elevation without owning child flow.
Source: https://zenos-ui.pages.dev/layout/composition/
---
# Aspect Ratio
Reserve a stable ratio for media and embedded content.
`AspectRatio` reserves predictable space while its width changes. Use it for images, videos, embeds, previews, and other content whose proportions should remain stable.
```tsx
import { AspectRatio, Label, Stack, Switch, Text, ToggleGroup } from "@zentara-co/zenos-ui";
import { useState } from "react";
function AspectRatioExample() {
const ratios = [
{ label: "1:1", value: 1, use: "Avatars and tiles" },
{ label: "4:3", value: 4 / 3, use: "Classic photos and thumbnails" },
{ label: "3:2", value: 3 / 2, use: "Landscape photography" },
{ label: "16:9", value: 16 / 9, use: "Video and product previews" },
{ label: "21:9", value: 21 / 9, use: "Cinematic banners" },
{ label: "4:5", value: 4 / 5, use: "Portrait cards" },
{ label: "2:3", value: 2 / 3, use: "Posters and editorial covers" },
{ label: "9:16", value: 9 / 16, use: "Stories and vertical video" },
] as const;
const [ratioLabel, setRatioLabel] = useState<(typeof ratios)[number]["label"]>("4:3");
const [crop, setCrop] = useState(true);
const selectedRatio = ratios.find(({ label }) => label === ratioLabel) ?? ratios[1];
const frameWidth = `min(100%, calc(28rem * ${selectedRatio.value}))`;
return (
);
}
```
Switch between common landscape, square, and portrait ratios to see one image reframed. The frame transitions between dimensions while the image remains centered. Turn off **Crop to fill** to use `object-contain` and preserve the complete image with letterboxing.
## Import
```tsx
import { AspectRatio } from "@zentara-co/zenos-ui";
```
## Media
AspectRatio controls the outer geometry. Size the media to fill that box and choose `object-cover` or `object-contain` according to whether cropping is acceptable.
```tsx
import { AspectRatio, Grid, Stack, Text } from "@zentara-co/zenos-ui";
function AspectRatioMediaExample() {
return (
16:9 landscape cover
4:3 editorial thumbnail
);
}
```
## Semantic content
Use `as` when the ratio box itself has semantic meaning. Native props and the ref follow the selected element.
```tsx
import { AspectRatio, Badge } from "@zentara-co/zenos-ui";
function AspectRatioSemanticExample() {
return (
Travel journal
Morning at Moraine Lake
);
}
```
## Choosing a ratio
Pass a positive number using width divided by height:
| Ratio | Value | Typical use |
| ------ | -------- | -------------------------------- |
| `1:1` | `1` | Avatars, square tiles, and icons |
| `4:3` | `4 / 3` | Classic photos and thumbnails |
| `3:2` | `3 / 2` | Landscape photography |
| `16:9` | `16 / 9` | Video and product previews |
| `21:9` | `21 / 9` | Cinematic banners and hero media |
| `4:5` | `4 / 5` | Portrait cards and social media |
| `2:3` | `2 / 3` | Posters and editorial covers |
| `9:16` | `9 / 16` | Stories and vertical video |
Choose the ratio from the destination layout rather than the source file. A stable frame prevents surrounding content from shifting while media loads, and one source image can be reframed for several placements.
The component does not crop or resize its children. It only sets `aspect-ratio`, full width, and overflow clipping. Use `object-cover` when filling the frame matters more than preserving every edge, or `object-contain` when the complete image must remain visible. Add decorative surface, border, radius, and motion styles through `className`.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| ratio | number | 1 | CSS aspect-ratio value, such as 16 / 9. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
AspectRatio does not change child semantics. Images still need meaningful alternative text when informative and an empty `alt` when decorative. Videos and embeds retain their own caption, title, and keyboard requirements. Avoid placing essential text where media cropping can hide it.
Source: https://zenos-ui.pages.dev/layout/aspect-ratio/
---
# Form Layout
A neutral responsive grid for form-related content.
`FormLayout` arranges form-related content with a responsive CSS Grid. It does not manage labels, errors, field state, validation, parsing, or submission.
```tsx
import { Button, Field, FormLayout, Input, Select, Text, Textarea } from "@zentara-co/zenos-ui";
import { type SubmitEvent, useState } from "react";
function FormExample() {
const [created, setCreated] = useState(false);
return (
) => {
event.preventDefault();
setCreated(true);
}}
>
Project name}
/>
Use a name your team will recognize.RegionSingaporeFrankfurtNotes} />
{created ? "Project created locally." : ""}
);
}
```
## Import
```tsx
import { FormLayout } from "@zentara-co/zenos-ui";
```
## Responsive columns
`columns` accepts the shared responsive value shape. Start with one column so controls remain usable on narrow screens, then add columns as space permits.
```tsx
import { Field, FormLayout, Input } from "@zentara-co/zenos-ui";
function FormLayoutColumnsExample() {
return (
{[
["Project name", "Security workspace"],
["Owner", "Platform team"],
["Environment", "Production"],
].map(([label, value]) => (
{label}} />
))}
);
}
```
## Row and column gaps
`gap` sets both axes. Use `rowGap` and `columnGap` when vertical form rhythm should differ from spacing between columns. Axis-specific values override the corresponding part of `gap`.
```tsx
import { Field, FormLayout, Input } from "@zentara-co/zenos-ui";
function FormLayoutGapExample() {
return (
First name} />
Last name} />
Role} />
This field spans both columns while FormLayout continues to own the grid.
);
}
```
Children can span tracks through application-specific `className` when the form needs a full-width field. FormLayout intentionally does not expose a field-item abstraction.
## Semantic element
FormLayout renders a `div` by default. Use `as="form"` when it owns native form submission, or `as="fieldset"` when it groups related controls inside another form.
```tsx
import { Checkbox, FormLayout, Label, Text } from "@zentara-co/zenos-ui";
function FormLayoutSemanticExample() {
return (
Notification preferences
);
}
```
Native props follow the selected element. A form accepts `action`, `method`, and `onSubmit`; a fieldset accepts `disabled`, `name`, and its native grouping semantics.
## Alignment
Use `align` to position items within their grid tracks and `justify` to distribute the grid's content. Both accept responsive values. Most forms should keep the defaults so fields stretch consistently; change alignment only when mixed-size controls require it.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element, including form, fieldset, or div. |
| columns | Responsive<1 \| 2 \| ... \| 12> | 1 | Responsive grid column count. |
| gap | Responsive | 4 | Shared row and column gap. |
| rowGap / columnGap | Responsive | — | Axis-specific gap overrides. |
| align | Responsive | — | Item alignment within grid tracks. |
| justify | Responsive | — | Grid content distribution on the inline axis. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Responsibility
Compose FormLayout with Field for label, description, error, required, invalid, and disabled semantics. Inputs remain responsible for native control behavior. Form libraries such as React Hook Form or TanStack Form can provide state without changing the layout API.
## Accessibility
Responsive columns must preserve DOM order and a logical keyboard sequence. Avoid visual placement classes that make the reading order differ from the source. Use a real `form` only when the region submits data, and give each `fieldset` a concise `legend`. FormLayout forwards refs, native attributes, `className`, `style`, `aria-*`, and `data-*`.
Source: https://zenos-ui.pages.dev/layout/form-layout/
---
# Layout
Compose a structural header, side panel, main content region, and footer.
`Layout` provides a fixed four-region CSS Grid for application and workspace surfaces. Its named parts set structural placement and sizing while leaving borders, backgrounds, navigation behavior, and product chrome to the consumer.
```tsx
import { Badge, Box, Grid, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutPanel, Link, Stack, Text } from "@zentara-co/zenos-ui";
function LayoutFrameExample() {
return (
Security workspace
Operational
{["Overview", "Assets", "Findings", "Settings"].map((item, index) => (
{item}
))}
Overview
A fixed structural frame with named regions.Assets
128
Open findings
7
Updated moments ago
);
}
```
## Import
```tsx
import {
Layout,
LayoutContent,
LayoutFooter,
LayoutHeader,
LayoutPanel,
} from "@zentara-co/zenos-ui";
```
## Anatomy
```text
Layout
├── LayoutHeader
├── LayoutPanel
├── LayoutContent
└── LayoutFooter
```
Header and Footer span both columns. Panel occupies the first column of the middle row, while Content occupies the flexible second column.
## Region sizing
Header and Footer accept `height` and `minHeight`. Panel accepts `width`, `minWidth`, and `maxWidth`; its default width is `sm`. Content accepts responsive `padding` and fills its grid area by default.
```tsx
import { Badge, Box, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutPanel, Stack, Text } from "@zentara-co/zenos-ui";
function LayoutOverflowExample() {
return (
Audit explorer
{Array.from({ length: 10 }, (_, index) => (
Filter {index + 1}
))}
{Array.from({ length: 10 }, (_, index) => (
Audit event {index + 1}
Workspace policy changed.
))}
Showing 10 events
);
}
```
Layout defaults to `min-height: 100vh`. Override that through `className` when embedding it in a bounded product surface, and give scrolling regions an explicit available height.
## Optional regions
The named regions are compositional rather than required. A Layout can omit Panel or Footer when the structural frame does not need them.
```tsx
import { Layout, LayoutContent, LayoutHeader, Text } from "@zentara-co/zenos-ui";
function LayoutContentOnlyExample() {
return (
Report
Panel and footer are optional. The content region keeps its main grid position.
);
}
```
## Layout or AppShell
Use Layout for a generic structural grid whose decoration and behavior belong to the application. Use AppShell when the product needs Zenos' complete shell behavior:
- sticky SideNav integration
- compact mobile and tablet navigation sheet
- top navigation region
- skip link and main-content focus handling
- application surface hierarchy
Layout does not collapse its panel, create overlays, or manage navigation state.
## Polymorphism
Every part supports `as`, native props, refs, `className`, `style`, `aria-*`, and `data-*`. Defaults are semantic: Header renders `header`, Panel renders `aside`, Content renders `main`, and Footer renders `footer`.
## Anatomy
```text
Layout
LayoutHeader
LayoutPanel
LayoutContent
LayoutFooter
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as (all parts) | ElementType | — | Changes a part's native element while preserving its props and ref type. |
| LayoutHeader / LayoutFooter height / minHeight | SizeToken | — | Header and footer size constraints. |
| LayoutContent grow | boolean | true | Lets LayoutContent fill its grid area. |
| LayoutContent padding | Responsive | — | LayoutContent responsive padding. |
| LayoutPanel width / minWidth / maxWidth | SizeToken | width: sm | LayoutPanel size constraints. |
| LayoutContent / LayoutPanel overflow | auto \| hidden \| scroll \| visible \| clip | — | Overflow behavior for bounded content and panel regions. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
A page should generally have one `main` landmark. If Layout is nested inside another page-level frame, render LayoutContent as `article`, `section`, or `div` as appropriate. Label complementary panels when multiple `aside` elements exist, and ensure independently scrolling Panel and Content regions remain keyboard reachable at high zoom.
Source: https://zenos-ui.pages.dev/layout/layout/
---
# App Shell
A responsive application frame for top navigation, side navigation, and main content.
`AppShell` assembles the outer product frame while leaving navigation and page content composition to `Header` and `SideNav`. Its outer canvas uses `--background-default`, separating the SideNav and content surfaces that use `--sidebar` (`#eceff1` in light mode and `#0f0f0f` in dark mode). The document remains the scrolling container, so the side navigation can stay sticky without trapping content in a nested scroller.
```tsx
import { ArrowLeftIcon, ArrowRightIcon, FolderIcon, GearIcon, HouseIcon, LifebuoyIcon, PulseIcon, UsersIcon } from "@phosphor-icons/react";
import { AppShell, Badge, Button, Grid, Header, Separator, SideNav, Stack, Text } from "@zentara-co/zenos-ui";
const shellNavigation = [
{ label: "Overview", icon: HouseIcon },
{ label: "Projects", icon: FolderIcon },
{ label: "Activity", icon: PulseIcon },
];
function ProductSideNav({ defaultCollapsed = false }: { defaultCollapsed?: boolean }) {
return (
}
>
ZENOS
{({ collapsed }) =>
collapsed ? (
) : (
)
}
{shellNavigation.map((item, index) => (
}
>
{item.label}
))}
}>
Members
}>
Settings
}>
Help and support
);
}
function AppShellExample() {
return (
Overview
Monitor projects, scans, and workspace activity.
{[
["Active projects", "18"],
["Scans today", "142"],
["Open findings", "7"],
].map(([label, value]) => (
{label}
{value}
))}
Recent activityProduction API scan completed without critical findings.Two members joined the incident response project.
);
}
```
## Import
```tsx
import { AppShell, Header, SideNav } from "@zentara-co/zenos-ui";
```
## Anatomy
```text
AppShell
├── banner
├── sideNav
├── topNav
└── main content
```
Pass complete navigation components into the named regions. `AppShell` owns the main landmark, responsive compact-navigation state, skip link, and overall surface hierarchy.
## Responsive navigation
On desktop and tablet landscape, `sideNav` stays at inline start and controls its own collapsed state. On mobile and tablet portrait, AppShell keeps a collapsed rail in the layout. Activating `SideNav.Toggle` opens the same navigation in an inline-start sheet—left in LTR and right in RTL. Selecting a navigation item closes that sheet.
Use `sideNavOpen`, `defaultSideNavOpen`, and `onSideNavOpenChange` when application state must observe or control the compact sheet. Use `SideNav`'s `collapsed` API only when SideNav is outside AppShell.
## Height and scrolling
`height="fill"` gives the shell a minimum viewport height. `height="auto"` follows its content, which is useful when the shell is embedded in another surface. In both modes, the document owns vertical scrolling and the navigation remains sticky.
## Content spacing
`contentPadding` accepts the shared responsive spacing scale:
```tsx
```
## Variants
height: fill, height: auto
## Anatomy
```text
AppShell
Header
SideNav
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| banner / topNav / sideNav | ReactNode | — | Named shell regions. |
| sideNavOpen | boolean | — | Controlled compact navigation sheet state. |
| defaultSideNavOpen | boolean | false | Initial compact navigation state. |
| onSideNavOpenChange | (open: boolean) => void | — | Runs when compact navigation changes. |
| sideNavLabel | string | Navigation | Accessible name for the compact navigation sheet. |
| contentPadding | Responsive | 0 | Main-region padding. |
| height | fill \| auto | fill | Viewport or content-based shell height. |
| skipLinkLabel | string | Skip to content | Accessible text for the keyboard skip link. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
AppShell renders a `main` landmark and a keyboard-accessible skip link. Give the side navigation a meaningful `aria-label`; `sideNavLabel` names the compact navigation dialog and its trigger. Keep only one top-level AppShell per application view.
Source: https://zenos-ui.pages.dev/layout/app-shell/
---
# Center
Centers content on one or both axes with responsive structural sizing.
`Center` places content on the horizontal axis, vertical axis, or both. It can also define the region's size and responsive logical padding.
```tsx
import { Badge, Center } from "@zentara-co/zenos-ui";
function CenterExample() {
return (
Centered on both axes
);
}
```
## Import
```tsx
import { Center } from "@zentara-co/zenos-ui";
```
## Axis
Choose only the axis the component should control. `both` is the default.
```tsx
import { Center, Grid, Text } from "@zentara-co/zenos-ui";
function CenterAxisExample() {
const axes = ["both", "horizontal", "vertical"] as const;
return (
{axes.map((axis) => (
{axis}
))}
);
}
```
## Sizing and logical padding
Size tokens constrain the centering region. Padding uses logical inline and block directions so layouts adapt to writing direction.
```tsx
import { Center, Stack, Text } from "@zentara-co/zenos-ui";
function CenterSizingExample() {
return (
Horizontally centered inside a constrained region.
Inline center
);
}
```
Use `isScrollable` only when the centered region has a meaningful size constraint. When content may exceed the available height, test zoom and large text to ensure it remains reachable.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| axis | both \| horizontal \| vertical | both | Axes on which content is centered. |
| isInline | boolean | false | Uses inline-flex instead of flex. |
| padding* | Responsive | — | Logical responsive padding props. |
| width / height / maxWidth / minHeight | SizeToken | — | Structural size constraints. |
| isScrollable | boolean | false | Allows centered content to scroll when it exceeds the region. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Center does not change semantics. Choose `as` for the region's meaning and avoid vertically centering long reading content in a fixed-height box, which can make overflow difficult to reach at high zoom.
Source: https://zenos-ui.pages.dev/layout/center/
---
# Cluster
Wraps related inline items with responsive spacing and alignment.
`Cluster` groups related items in a wrapping row. It works well for actions, filters, tags, metadata, and other content that should flow onto additional lines when space runs out.
```tsx
import { Badge, Cluster } from "@zentara-co/zenos-ui";
function ClusterExample() {
return (
Production
Healthy
12 services
);
}
```
## Import
```tsx
import { Cluster } from "@zentara-co/zenos-ui";
```
## Distribution
Use `justify` to distribute the whole group and `align` to align items across the row.
```tsx
import { Button, Cluster, Stack, Text } from "@zentara-co/zenos-ui";
function ClusterAlignmentExample() {
const values = ["start", "center", "between"] as const;
return (
{values.map((justify) => (
{justify}
))}
);
}
```
## Responsive wrapping
Wrapping is enabled by default. `gap`, `align`, `justify`, and `wrap` accept breakpoint values.
```tsx
import { Badge, Cluster } from "@zentara-co/zenos-ui";
function ClusterWrapExample() {
return (
{[
"Authentication",
"Infrastructure",
"Observability",
"Data protection",
"Incident response",
].map((label) => (
{label}
))}
);
}
```
Use Stack with `direction="row"` when you need row-specific sizing, scrolling, or explicit flex behavior beyond this focused wrapping relationship.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| gap | Responsive | 2 | Space between children. |
| align | Responsive | — | Cross-axis alignment. |
| justify | Responsive | — | Main-axis distribution. |
| wrap | Responsive | true | Responsive wrapping. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Cluster adds no roles or keyboard behavior. Render it as `nav`, `ul`, or another semantic element when the grouped content requires that meaning, and preserve the natural DOM order when changing visual distribution.
Source: https://zenos-ui.pages.dev/layout/cluster/
---
# Container
Constrains content width and provides responsive inline gutters.
`Container` establishes the horizontal reading boundary for a page or section. It fills the available width, centers itself, stops growing at a selected maximum width, and adds inline gutters so content does not touch the viewport edge.
It does not add vertical spacing, arrange children, or create a visual surface. Compose it with `Section` for page rhythm, `Stack` or `Grid` for child layout, and `Box` for elevation or decoration.
```tsx
import { Badge, Button, Container, Cluster, Section, Stack, Text } from "@zentara-co/zenos-ui";
function ContainerExample() {
return (
Quarterly review
Workspace activity
The section background spans the available width while Container keeps the content
centered, readable, and clear of the viewport edge.
);
}
```
In this pattern, `Section` owns the full-width background and block padding. `Container` owns only the centered content measure and responsive inline gutters.
## Import
```tsx
import { Container } from "@zentara-co/zenos-ui";
```
## Default behavior
Without props, Container renders a `div` with four behaviors:
- `width: 100%` lets it contract with its parent.
- `max-width: 64rem` applies the default `lg` preset.
- automatic inline margins center it when extra space is available.
- `1rem` inline padding, represented by `paddingX="4"`, provides the default gutter.
```tsx
```
The maximum width includes the inline padding. On a narrow viewport, the container fills the available width and the padding becomes the visible gutter. On a wide viewport, the maximum width limits the complete content region.
## Sizes
The five semantic sizes change the maximum width while retaining full available width and automatic centering. The default is `lg`.
```tsx
import { Container, Stack, Text } from "@zentara-co/zenos-ui";
function ContainerSizesExample() {
const sizes = [
{ value: "sm", ceiling: "36rem", use: "Focused reading" },
{ value: "md", ceiling: "48rem", use: "Forms and articles" },
{ value: "lg", ceiling: "64rem", use: "Standard application pages" },
{ value: "xl", ceiling: "80rem", use: "Dashboards and dense grids" },
{ value: "full", ceiling: "100%", use: "No maximum width" },
] as const;
return (
{sizes.map(({ value, ceiling, use }) => (
{value}
{ceiling} · {use}
))}
);
}
```
| Size | Maximum width | Good starting point for |
| ------ | ------------- | --------------------------------------- |
| `sm` | `36rem` | Focused reading and narrow flows |
| `md` | `48rem` | Forms, articles, and settings pages |
| `lg` | `64rem` | Standard application pages |
| `xl` | `80rem` | Dashboards, data views, and wide grids |
| `full` | `100%` | Surfaces that should not be constrained |
Choose a size from the content, not the viewport name. A settings form may remain `sm` on a large monitor, while a dense data table may need `xl`.
`size` is a semantic preset rather than a responsive prop. The container already responds naturally: it stays fluid below its ceiling and becomes fixed only when enough width is available.
## Responsive gutters
`paddingX` accepts a spacing token or a mobile-first responsive object. Use smaller gutters where space is scarce and increase them only when the wider composition benefits from more breathing room.
```tsx
```
Omitted breakpoints inherit the last applicable value. In this example, `4` applies by default, `6` begins at `md`, and `8` begins at `xl`.
Set `paddingX="0"` when another boundary already owns the gutter. This is useful when Container sits inside a padded panel, but it should be intentional—removing the only viewport gutter can make content touch the screen edge.
## Container and Section
The order determines which boundary spans the available width.
Place Container inside Section when backgrounds, borders, or dividers should extend beyond the constrained content:
```tsx
...
```
Place Section inside Container when the semantic region and its visual treatment should both remain constrained:
```tsx
...
```
See the [Composition Guide](/layout/composition/) for the complete outside-in layout model.
## Explicit constraints
Use `width` and `maxWidth` when a product surface needs a tokenized constraint outside the semantic presets.
```tsx
import { Container, Divider, Stack, Text } from "@zentara-co/zenos-ui";
function ContainerOverrideExample() {
return (
A 48rem editorial measure
Use an explicit maximum when a product surface needs a content width that does not match
one of the five semantic presets. The responsive inline padding remains independent.
size="full" · width="full" · maxWidth="3xl"
);
}
```
The three width props have different jobs:
- `size` selects one of the five Container-specific maximum widths.
- `width` sets the element's preferred width from the shared size-token scale.
- `maxWidth` replaces the preset ceiling with a value from the shared size-token scale.
`width` and `maxWidth` are direct token values, not responsive objects. Prefer a semantic `size` for standard page structure. Reach for explicit constraints when a real product requirement falls between presets or reuses a shared width token.
```tsx
```
Here `size="full"` removes the semantic ceiling, `width="full"` keeps the region fluid, and `maxWidth="3xl"` establishes a `48rem` maximum.
## Child layout
Container does not set display, direction, gap, or alignment for its children. Put a layout primitive inside it:
```tsx
{projects.map((project) => (
))}
```
Avoid nested Containers by default. They can create duplicate gutters and competing maximum widths. If an inner reading column must be narrower than a wide page container, either give the inner content an intentional `maxWidth` or set the inner Container's `paddingX` to `0` so only one boundary owns the gutter.
## When not to use Container
- Do not use it as a card. Use `Box` or `Card` for a bordered or elevated surface.
- Do not use it only to center one child on an axis. Use `Center`.
- Do not use it to arrange siblings. Use `Stack`, `Cluster`, or `Grid`.
- Do not wrap every component in its own Container. One page or section boundary should usually own the shared measure.
## Sizes
sm, md, lg, xl, full
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| size | ContainerSize | lg | Preset content max-width. |
| width / maxWidth | SizeToken | — | Explicit structural constraints. |
| paddingX | Responsive | 4 | Responsive inline padding. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Container is a `div` by default and adds no landmark or accessible name. Use `as="main"` only when it is the document's single main region. Choose `article`, `section`, `nav`, or another semantic element only when the contained content has that meaning.
Do not introduce a semantic wrapper solely because Container is present. It can remain a `div` inside an already meaningful `main` or `section`. At narrow widths and high zoom, verify that inline gutters do not leave too little room for controls, tables, or long translated text.
Source: https://zenos-ui.pages.dev/layout/container/
---
# Divider
A labelled or unlabelled structural rule with horizontal and vertical forms.
`Divider` separates related regions with a semantic separator. It supports two visual weights, two orientations, optional label content, and full-bleed geometry inside padded containers.
```tsx
import { Divider, Stack } from "@zentara-co/zenos-ui";
function DividerExample() {
return (
);
}
```
## Import
```tsx
import { Divider } from "@zentara-co/zenos-ui";
```
## Orientation
Horizontal is the default. A vertical divider needs a parent with a meaningful height because it fills the parent's block size.
```tsx
import { Divider, Cluster, Grid, Stack, Text } from "@zentara-co/zenos-ui";
function DividerOrientationExample() {
return (
HorizontalSeparates content along the block flow.EditorPreview
);
}
```
## Variants
Use `subtle` for routine content boundaries and `strong` when adjacent regions need clearer separation. Variant changes visual weight only.
```tsx
```
## Labels
A label is centered between two rule segments and becomes the separator's accessible name unless `aria-label` or `aria-labelledby` is supplied explicitly. Labels may contain text or a small component such as Badge.
```tsx
import { Badge, Divider, Stack } from "@zentara-co/zenos-ui";
function DividerLabelExample() {
return (
Advanced
}
variant="strong"
/>
);
}
```
## Full bleed
`isFullBleed` extends a divider through padding defined by the inherited container variables. This keeps surrounding content aligned while the rule reaches the surface edges.
```tsx
import { Divider, Stack, Text } from "@zentara-co/zenos-ui";
import { type CSSProperties } from "react";
const dividerPaddingVariables = {
"--container-padding-inline-start": "1.5rem",
"--container-padding-inline-end": "1.5rem",
} as CSSProperties;
function DividerFullBleedExample() {
return (
Activity
A regular divider stays inside the content padding.A full-bleed divider reaches both container edges.The content itself remains aligned to the padded inset.
);
}
```
Horizontal dividers read `--container-padding-inline-start` and `--container-padding-inline-end`. Vertical dividers use the corresponding block variables. An explicit `style` value can override the generated margins or dimensions.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | subtle \| strong | subtle | Rule weight. |
| orientation | horizontal \| vertical | horizontal | Rule axis. |
| label | ReactNode | — | Optional content between rule segments. |
| isFullBleed | boolean | false | Extends through inherited container padding. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Divider always renders `role="separator"` and exposes `aria-orientation`. Use a visible `label` when it helps everyone understand the transition, or an explicit accessible name when the boundary needs context that is already visually apparent. Avoid using Divider as a substitute for headings or whitespace when the content hierarchy needs stronger structure.
Source: https://zenos-ui.pages.dev/layout/divider/
---
# Grid Item
Places one child on explicit grid lines with fixed spans and self-alignment.
`GridItem` places a child on explicit grid lines, gives it fixed row or column spans, and controls its self-alignment. It must be used inside a CSS Grid container.
```tsx
import { Center, Grid, GridItem, Text } from "@zentara-co/zenos-ui";
import { type ReactNode } from "react";
function GridDemoTile({ children, className }: { children: ReactNode; className?: string }) {
return (
{children}
);
}
function GridItemExample() {
return (
Main content · columns 1–3Sidebar · three rowsActivityTimelineReports
);
}
```
## Import
```tsx
import { Grid, GridItem } from "@zentara-co/zenos-ui";
```
## Placement
`column` and `row` select starting grid lines from 1 through 13 or `auto`. `columnSpan` and `rowSpan` cover 1 through 12 tracks, `full`, or `auto`.
```tsx
Main content
Sidebar
```
These placement props are intentionally fixed. Use GridSpan when only the span must change across breakpoints, or application-specific classes when explicit starting lines must respond.
## Self-alignment
`alignSelf` moves one item on the block axis and `justifySelf` moves it on the inline axis.
```tsx
import { Badge, Center, Grid, GridItem, Text } from "@zentara-co/zenos-ui";
function GridItemAlignmentExample() {
return (
Start
Center
End
Stretch across the assigned area
);
}
```
## Polymorphism
GridItem renders a `div` by default. Use `as="li"`, `as="article"`, or another semantic element while retaining placement styles, native props, and the correct ref type.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| column / row | 1–13 \| auto | — | Starting grid line. |
| columnSpan / rowSpan | 1–12 \| full \| auto | — | Track span. |
| alignSelf | AlignSelf | — | Item alignment on the block axis. |
| justifySelf | JustifySelf | — | Item alignment on the inline axis. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
CSS placement does not change DOM order. Keep visual order consistent with reading and focus order, especially when manually assigning rows and columns. Do not use grid placement to move a later interactive control ahead of an earlier one visually.
Source: https://zenos-ui.pages.dev/layout/grid-item/
---
# Grid Span
Applies responsive row and column spans to a grid child.
`GridSpan` is the responsive spanning companion to Grid. It lets one child occupy different numbers of columns or rows without taking responsibility for explicit starting lines or alignment.
```tsx
import { Center, Grid, GridSpan, Text } from "@zentara-co/zenos-ui";
import { type ReactNode } from "react";
function GridDemoTile({ children, className }: { children: ReactNode; className?: string }) {
return (
{children}
);
}
function GridSpanExample() {
return (
Main content · 4 of 6 columnsSidebar · 2 of 6 columnsFull-width footer
);
}
```
## Import
```tsx
import { Grid, GridSpan } from "@zentara-co/zenos-ui";
```
## Responsive spans
Both `columns` and `rows` accept a direct value or breakpoint object. Use `full` to cover the complete explicit grid and `auto` to return to automatic spanning.
```tsx
MainAsideFooter
```
```tsx
import { Center, Grid, GridSpan, Text } from "@zentara-co/zenos-ui";
import { type ReactNode } from "react";
function GridDemoTile({ children, className }: { children: ReactNode; className?: string }) {
return (
{children}
);
}
function GridSpanRowsExample() {
return (
Responsive row spanOne trackTwo rowsTwo columns
);
}
```
## GridSpan or GridItem
Use GridSpan when spans change responsively and automatic placement should choose the start position. Use GridItem when the child needs a fixed starting row or column, fixed spans, or self-alignment.
GridSpan is polymorphic and forwards native props and refs to the selected element.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| columns | Responsive<1–12 \| full \| auto> | — | Responsive column span. |
| rows | Responsive<1–12 \| full \| auto> | — | Responsive row span. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Spans change visual size without changing semantics. Keep the source order logical and avoid using large spans to imply heading or landmark importance. Choose `as` based on the content itself.
Source: https://zenos-ui.pages.dev/layout/grid-span/
---
# Header
A polymorphic start, center, and end header layout.
`Header` arranges stable start and end actions around a flexible center region. Its rounded default surface uses `--sidebar` (`#eceff1` in light mode and `#0f0f0f` in dark mode), falling back to `--background-default`. It remains customizable through `className`, making it suitable for application headers, contextual toolbars, breadcrumbs, and status rows.
```tsx
import { Button, Header, Text } from "@zentara-co/zenos-ui";
function HeaderExample() {
return (
Workspace}
end={}
className="w-full rounded-xl border border-border bg-background-neutral-card"
>
Production environment
);
}
```
## Import
```tsx
import { Header } from "@zentara-co/zenos-ui";
```
## Regions
Use `start` for branding or navigation, children for the flexible center, and `end` for actions. Empty regions are omitted from the DOM.
```tsx
import { Badge, Breadcrumb, Button, Header, Stack, Text } from "@zentara-co/zenos-ui";
function HeaderCompositionExample() {
return (
Preview
}
end={
}
className="rounded-xl border border-border bg-background-neutral-card"
>
API referenceAcme}
end={
Live
}
className="rounded-xl border border-border bg-background-neutral-card"
>
ProjectsGateway
);
}
```
## Semantic element
Header renders a `div` by default. Use `as="header"` for a page or application banner, or `as="nav"` when the whole region is navigation. The selected element controls the available native props and ref type.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| start | ReactNode | — | Content anchored at the logical start. |
| children | ReactNode | — | Flexible center content. |
| end | ReactNode | — | Content anchored at the logical end. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Choose `as` by meaning rather than appearance. A `header` becomes a banner landmark only in the appropriate document context, while a `nav` needs an accessible label when more than one navigation landmark exists.
Source: https://zenos-ui.pages.dev/layout/header/
---
# HStack
A horizontal Stack convenience primitive with logical-axis alignment.
`HStack` is Stack with a fixed horizontal direction. It adds `hAlign` and `vAlign` aliases so alignment can be described in visual axes.
```tsx
import { Button, HStack, Stack, Text } from "@zentara-co/zenos-ui";
function HStackExample() {
return (
Workspace
24 members
);
}
```
## Import
```tsx
import { HStack } from "@zentara-co/zenos-ui";
```
## Logical alignment
`hAlign` distributes children horizontally and maps to Stack's `justify`. `vAlign` aligns children vertically and maps to Stack's `align`.
```tsx
import { Badge, HStack, Stack } from "@zentara-co/zenos-ui";
function HStackAlignmentExample() {
return (
{(["start", "center", "between"] as const).map((hAlign) => (
{hAlign}
Item
))}
);
}
```
The shared `align` and `justify` props remain available and take precedence over the aliases when both are supplied. HStack also supports Stack's responsive gap, wrapping, padding, size constraints, scrolling, polymorphism, and native props.
Use Cluster when the main requirement is a wrapping row of related items. Use HStack when distribution, sizing, or the complete Stack API matters.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | div | Rendered semantic element. |
| hAlign | Responsive | — | Horizontal distribution. |
| vAlign | Responsive | — | Vertical alignment. |
| gap | Responsive | 4 | Space between children. |
| wrap | Responsive | false | Wrapping behavior. |
| shared Stack props | padding*, size constraints, isScrollable | — | HStack supports Stack spacing, sizing, scrolling, and native props. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
HStack does not add semantics or reorder children. Choose `as` for the content and keep the source order meaningful when using `hAlign="end"`, `between`, or `evenly`.
Source: https://zenos-ui.pages.dev/layout/h-stack/
---
# Polymorphic components
Build semantic interfaces with Zenos components instead of recreating layout and interaction from raw HTML.
Zenos components separate an element's **meaning** from its **presentation**. Start with the
component that owns the layout, typography, surface, or behavior you need, then select the correct
semantic element through `as` or compose behavior through `render`. This keeps product code aligned
with Zenos without reducing the page to anonymous `div` and `span` wrappers.
```tsx
import { Badge, Box, Cluster, Link, Section, Text, VStack } from "@zentara-co/zenos-ui";
function PolymorphicComponentsExample() {
const practices = [
["01", "Use the semantic element", "Choose article, section, nav, or a real list."],
["02", "Keep layout declarative", "Let VStack, HStack, Cluster, and Grid own flow."],
["03", "Preserve native behavior", "Use Button and Link for actions and navigation."],
] as const;
return (
Component-first markup
Build semantics into the layout
Zenos controls presentation while the as prop controls document meaning.
Recommended
{practices.map(([number, title, description]) => (
{number}
{title}
{description}
))}
Semantic HTML, without rebuilding the design system.
Choose an API
);
}
```
## The mental model
A polymorphic component keeps its Zenos API and styling while changing the element rendered to the
DOM:
```tsx
Release notes
```
`Box` still owns the surface. `article` supplies document meaning. `Text` still owns typography,
while `h2` supplies the heading level. TypeScript follows the selected element, so `Box as="a"`
accepts `href` and its ref resolves to an anchor.
The goal is not to hide HTML. The goal is to choose HTML semantics through a consistent Zenos
component instead of rebuilding layout, tokens, states, and accessibility for every screen.
## Start with responsibility
Choose the component before choosing the element. Ask what relationship the wrapper owns:
1. **Vertical flow** — use `VStack` when children always run from top to bottom.
2. **Horizontal flow** — use `HStack` when children stay in one row.
3. **Responsive direction** — use `Stack` when the axis itself changes by breakpoint.
4. **Wrapping row** — use `Cluster` for actions, tags, filters, and metadata that may wrap.
5. **Shared tracks** — use `Grid` for rows and columns that must align.
6. **Width and region** — use `Container` for measure and `Section` for a semantic region.
7. **Surface only** — use `Box` when you need an element, elevation, or customization hook but no
child-layout rule.
8. **Typography** — use `Text`, then select the correct heading, paragraph, label-like, or inline
element with `as`.
### VStack, HStack, Stack, or Cluster?
| Component | Default relationship | Use it for | Prefer another component when |
| --------- | ------------------------------------------------ | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `VStack` | Fixed vertical flex flow | Forms, card content, page sections, menus, and semantic vertical lists | The direction must become horizontal at a breakpoint. |
| `HStack` | Fixed horizontal flex flow without wrapping | Compact metadata, icon-label pairs, and controls that must remain together | Items should wrap when space runs out. |
| `Stack` | Configurable flex direction; vertical by default | Responsive or application-controlled direction, scrolling, and dimensional constraints | The direction is permanently vertical or horizontal and a named primitive is clearer. |
| `Cluster` | Horizontal flow that wraps by default | Toolbars, actions, tags, filters, and variable-width groups | Items must share grid tracks or must never wrap. |
`VStack` and `HStack` expose intent directly. They also provide axis-specific aliases:
`VStack` accepts `hAlign` and `vAlign`, while `HStack` accepts `hAlign` and `vAlign`. The shared
`align` and `justify` props remain available when flex terminology is more useful.
```tsx
Profile
```
Use `Stack` when direction is genuinely responsive:
```tsx
```
Use `Cluster` instead when a row should wrap naturally rather than switch to a predefined axis:
```tsx
{filters.map((filter) => (
))}
```
## Choose the right API
Zenos uses two composition APIs for different responsibilities.
### Use `as` for layout and typography
Use `as` when a Zenos primitive owns presentation and you need to select its semantic element.
```tsx
Billing
Manage invoices and payment methods.
```
Common polymorphic primitives include `Box`, `Text`, `Section`, `VStack`, `HStack`, `Stack`,
`Cluster`, `Grid`, `GridItem`, `GridSpan`, `Center`, `Container`, `AspectRatio`, and `FormLayout`.
Product-frame parts such as `Layout.Content` and `SideNav` also preserve their semantic defaults
while accepting `as` when the application needs a different element.
### Default elements
Keep the default when it already matches the content. Add `as` only when the document meaning must
change.
| Component | Default element | Responsibility | Common `as` values |
| ------------- | -------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------- |
| `Box` | `div` | Surface, elevation, and a stable customization boundary | `article`, `aside`, `a`, `li`, `span` |
| `Text` | `p`, or the element implied by its typography role | Type scale, weight, color, alignment, and truncation | `h1`–`h6`, `span`, `strong`, `code` |
| `Section` | `section` | Semantic region with vertical flow and responsive padding | `article`, `aside`, `div` |
| `VStack` | `div` | Fixed vertical flow and vertical rhythm | `section`, `header`, `footer`, `ul`, `ol`, `form` |
| `HStack` | `div` | Fixed horizontal flow that stays together | `header`, `footer`, `nav`, `li` |
| `Stack` | `div` | Responsive direction, wrapping, dimensions, and scrolling | Any structural element whose direction can change |
| `Cluster` | `div` | Wrapping horizontal groups | `nav`, `header`, `footer`, `ul` |
| `Grid` | `div` | Responsive shared tracks | `ul`, `ol`, `section` |
| `Center` | `div` | Centering on one or both axes | `section`, `main`, `aside` |
| `Container` | `div` | Maximum width and inline gutters | `main`, `section`, `article` |
| `FormLayout` | `div` | Responsive field layout | `form`, `fieldset` |
| `AspectRatio` | `div` | Stable media geometry | `figure`, `a` |
`Layout.Header`, `Layout.Content`, `Layout.Footer`, and `Layout.Panel` already default to `header`,
`main`, `footer`, and `aside`. Prefer those defaults unless the region has a different role in the
page.
### Custom React components
`as` accepts a React element type, not only an HTML tag. This is useful for router links or
application-owned semantic wrappers:
```tsx
Open Zenos project
```
The custom component must forward its ref and merge `className`, native accessibility attributes,
and event handlers onto the final DOM element. If it drops those props, Zenos styling or behavior
will also be dropped.
### Use `render` for behavior composition
Base UI-backed components, including Link, use `render` when behavior or link styling must be applied
to another component without adding a wrapper element.
```tsx
}>Open filters
...
```
The trigger remains one native button. Popover supplies focus, keyboard, and open-state behavior;
Button supplies the Zenos appearance. Do not nest a Button inside a trigger that already renders a
button, because nested interactive elements are invalid.
The same rule applies to field controls:
```tsx
Email} />
```
Link uses `render` when a router link should keep Link's color, size, underline, and focus ring:
```tsx
}>View workspace
```
`RouterLink` must forward `className`, event handlers, and its ref to the underlying anchor.
### Use the dedicated component when one exists
Use `Button`, `Link`, `Input`, `Checkbox`, `Table`, and other purpose-built components directly.
They already provide the correct native element, states, tokens, focus treatment, and public API.
Polymorphism is an escape hatch for semantics, not a reason to replace a focused component with a
generic Box.
## Replace common raw patterns
| Instead of rebuilding | Start with | Why |
| --------------------------------------- | ----------------------------------------- | ---------------------------------------------------------- |
| `
` | `` | VStack states that the flow is intentionally vertical. |
| `
` | `` | HStack keeps a compact row together without wrapping. |
| `
` | `` | Cluster owns a row that can wrap as space changes. |
| `
Backed by Base UI Checkbox for
upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on
this page.
```tsx
import { Checkbox, Label, Stack } from "@zentara-co/zenos-ui";
function CheckboxExample() {
return (
);
}
```
## Import
```tsx
import { Checkbox, Label, Stack } from "@zentara-co/zenos-ui";
```
## Sizes
Use `size="sm"`, `size="md"`, or `size="lg"` for 32px, 40px, or 48px hit targets. The visible boxes scale to 16px, 20px, and 24px.
```tsx
import { Checkbox, Label, Stack } from "@zentara-co/zenos-ui";
function CheckboxSizesExample() {
return (
);
}
```
## States
Checkbox supports native required, disabled, and invalid semantics. Disabled controls cannot be changed or submitted.
```tsx
import { Checkbox, Label, Stack } from "@zentara-co/zenos-ui";
function CheckboxStatesExample() {
return (
);
}
```
## Controlled and indeterminate
Use the indeterminate state for a parent choice when only some child choices are selected.
```tsx
import { Checkbox, Label, Stack } from "@zentara-co/zenos-ui";
import { useState } from "react";
function CheckboxControlledExample() {
const [selected, setSelected] = useState(["alerts"]);
const options = ["alerts", "reports"];
const allSelected = selected.length === options.length;
const parentState = allSelected ? true : selected.length ? "indeterminate" : false;
return (
setSelected(checked ? options : [])}
/>
{options.map((option) => (
setSelected((current) =>
checked ? [...current, option] : current.filter((item) => item !== option),
)
}
/>
))}
);
}
```
## Custom indicator
Use the compound API when the default check and dash marks do not fit the surrounding interface.
```tsx
import { Checkbox, Label, Stack } from "@zentara-co/zenos-ui";
function CheckboxCustomIndicatorExample() {
return (
●
);
}
```
## Anatomy
```text
Checkbox.Root
Checkbox.Indicator
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| checked | boolean \| indeterminate | — | Controlled checked state. |
| defaultChecked | boolean \| "indeterminate" | — | Initial uncontrolled checked state. |
| indeterminate / defaultIndeterminate | boolean | false | Controlled or initial mixed state aliases. |
| onCheckedChange | (checked) => void | — | Runs when state changes. |
| size | sm \| md \| lg | md | 32px, 40px, or 48px hit target. |
| disabled / required | boolean | false | Native form semantics. |
| name / value | string | — | Native form submission metadata. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Associate every checkbox with a visible `Label` using matching `id` and `htmlFor` values, or provide an accessible name directly. Space toggles a focused checkbox. The indeterminate state is announced as mixed, while `disabled`, `required`, and `aria-invalid` preserve their native or Base UI semantics.
Source: https://zenos-ui.pages.dev/components/checkbox/
---
# Switch
Immediate on/off settings built on Base UI.
Use Switch for a setting that takes effect immediately, such as auto-save or background sync. Its label should describe the setting, not change between “on” and “off.” Use [Checkbox](/components/checkbox/) for choices users review before submitting together.
Backed by Base UI Switch for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { Field, Stack, Switch } from "@zentara-co/zenos-ui";
function SwitchExample() {
return (
Continuous monitoringScan new assets as they are discovered.
);
}
```
## Import
```tsx
import { Switch } from "@zentara-co/zenos-ui";
```
## Controlled state
Use `defaultChecked` for an uncontrolled setting. Pair `checked` with `onCheckedChange` when application state owns the setting. The callback receives the next boolean state and Base UI event details; the controlled owner must update `checked`.
```tsx
import { Field, Stack, Switch, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function SwitchControlledExample() {
const [checked, setChecked] = useState(true);
return (
Auto-save reportsSave changes while you edit a report.
Auto-save is {checked ? "enabled" : "disabled"}.
);
}
```
## Required and disabled
`required` participates in native form validation and requires the switch to be checked before submission. A disabled switch cannot be changed and contributes no form value. Pass `disabled` to the switch itself; use `Field.Root disabled` to keep the surrounding label and description consistent. Keep explanatory text visible when policy or permissions make a setting unavailable.
```tsx
import { Field, Separator, Stack, Switch } from "@zentara-co/zenos-ui";
function SwitchStatesExample() {
return (
Critical alertsRequired for workspace administrators.Audit collection
Managed by your organization.
);
}
```
## Form value
Set `name` and `value` to include a checked switch in native `FormData`. An unchecked switch contributes no value, following native checkbox behavior.
```tsx
import { Button, Field, Stack, Switch, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function SwitchFormExample() {
const [submittedValue, setSubmittedValue] = useState("Not submitted");
return (
);
}
```
## Custom styling
Use the usual `className` prop to style the track and `classNameThumb` to style the automatically rendered thumb. No variant or color prop is needed. Use `data-[checked]` and `data-[disabled]` for state-specific classes, and keep a visible `focus-visible` treatment.
When changing dimensions, update the thumb size and checked translation together so it stays inside the track. The example below uses a 52px-wide track with a 2px border, a 24px thumb, and a 24px checked translation. Include matching `dark:` overrides when replacing built-in dark-theme colors.
```tsx
import { Field, Stack, Switch } from "@zentara-co/zenos-ui";
function SwitchCustomExample() {
return (
Background syncKeep your workspace up to date.
);
}
```
## Compound composition
`Switch` and `Switch.Root` share the same behavior and render a default thumb when no children are supplied. To style the thumb directly or compose its contents, provide `Switch.Thumb` explicitly. Children replace the automatic thumb; `classNameThumb` no longer applies, so use `className` on the explicit thumb instead.
Both parts preserve Base UI state attributes, native props, and refs. Keep `Switch.Thumb` in the composition so checked-state movement and styling continue to work.
```tsx
import { Field, Stack, Switch } from "@zentara-co/zenos-ui";
function SwitchCompoundExample() {
return (
Compact viewShow more items in each list.
);
}
```
## Anatomy
```text
Switch
Switch.Root
Switch.Thumb
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| checked | boolean | — | Controlled checked state. |
| defaultChecked | boolean | false | Initial uncontrolled checked state. |
| onCheckedChange | (checked: boolean, eventDetails) => void | — | Runs when state changes. |
| disabled / required | boolean | false | Native form semantics. |
| name / value | string | — | Form submission metadata. |
| className | string | — | Custom track styling. Override checked and disabled states with their data attributes, and preserve a visible focus treatment. |
| classNameThumb | string | — | Classes applied to the automatically rendered thumb. |
| children | ReactNode | — | Replaces the automatic thumb. Render Switch.Thumb explicitly to preserve its state attributes and movement. classNameThumb only applies to the automatic thumb. |
| native props | React.Base UI Switch props | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Associate every switch with a visible label using matching `id` and `htmlFor` values. Use `aria-label` when the surrounding visual context already explains the setting. Tab moves focus to the switch and Space toggles it; preserve this behavior when customizing its appearance.
Base UI exposes the current state through `role="switch"` and `aria-checked`; disabled and required semantics are preserved through its native form control. Keep the label stable, make both checked states visually distinguishable, and do not rely on track color alone. Preserve thumb movement and a visible keyboard focus indicator.
Source: https://zenos-ui.pages.dev/components/switch/
---
# Radio Group
Choose one value from a mutually exclusive set.
Choose one value from a mutually exclusive set.
Backed by Base UI Radio Group for
upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on
this page.
```tsx
import { Label, RadioGroup, Stack } from "@zentara-co/zenos-ui";
function RadioGroupExample() {
return (
);
}
```
## Import
```tsx
import { Label, RadioGroup } from "@zentara-co/zenos-ui";
```
State follows `value`, `defaultValue`, and `onValueChange`. Arrow keys move selection within the group, while disabled items remain unavailable.
## Sizes
Use `size="sm"`, `size="md"`, or `size="lg"` for 32px, 40px, or 48px hit targets. The visible radio controls are 16px, 20px, and 24px, matching the Checkbox size scale.
```tsx
import { Label, RadioGroup, Stack } from "@zentara-co/zenos-ui";
function RadioGroupSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
))}
);
}
```
## Custom styling
Use `className` on the group, labels, and items to create a custom treatment while Base UI continues to own selection and keyboard behavior. `RadioGroup.Item` exposes `data-checked` for state styling, and stable slots such as `radio-box` let parent-scoped selectors customize the visible control without replacing it.
```tsx
import { Label, RadioGroup, Stack, Text } from "@zentara-co/zenos-ui";
function RadioGroupCustomStylingExample() {
const options = [
["focused", "Focused", "Only the updates that need your attention."],
["balanced", "Balanced", "Important updates with a concise daily summary."],
["complete", "Complete", "Every workspace event as it happens."],
] as const;
return (
{options.map(([value, title, description]) => (
))}
);
}
```
## Controlled value
Use controlled state when another part of the interface needs the selected value immediately.
```tsx
import { Label, RadioGroup, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function RadioGroupControlledExample() {
const [cadence, setCadence] = useState("weekly");
return (
{[
["daily", "Daily"],
["weekly", "Weekly"],
["monthly", "Monthly"],
].map(([value, label]) => (
))}
Selected: {cadence}
);
}
```
## Arrangement
RadioGroup uses a vertical grid by default. Use `className` for a horizontal arrangement when the labels remain readable in the available width. Base UI continues to manage radio-group keyboard movement.
```tsx
import { Label, RadioGroup, Stack, Text } from "@zentara-co/zenos-ui";
function RadioGroupOrientationExample() {
return (
Horizontal
{[
["day", "Day"],
["week", "Week"],
["month", "Month"],
].map(([value, label]) => (
))}
Vertical
);
}
```
## States and custom indicator
Disable the complete group from Root or individual unavailable choices from Item. Pass custom content to Item when the default indicator does not fit the interface.
```tsx
import { Label, RadioGroup, Stack } from "@zentara-co/zenos-ui";
function RadioGroupStatesExample() {
return (
);
}
```
## Anatomy
```text
RadioGroup.Root
RadioGroup.Item
RadioGroup.Indicator
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| value | string | — | Controlled selected value. |
| defaultValue | string | — | Initial uncontrolled value. |
| onValueChange | (value: string, eventDetails) => void | — | Runs when selection changes. |
| name | string | — | Form field name shared by the group items. |
| disabled / required | boolean | false | Group form semantics. |
| Item.disabled | boolean | false | Prevents selection of an individual option. |
| Item.size | sm \| md \| lg | md | 32px, 40px, or 48px hit target with a proportionally sized circle. |
| Item.children | ReactNode | — | Replaces the default RadioGroup.Indicator. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Give every group an accessible name with a visible group label, `aria-label`, or `aria-labelledby`. Associate each option with Label by wrapping it or matching `htmlFor` and `id`. Arrow keys move focus and selection within the group, while Tab enters and leaves it. Disabled items are skipped. Required and invalid state must be paired with visible guidance when users need help correcting a selection.
Source: https://zenos-ui.pages.dev/components/radio-group/
---
# Select
Choose a predefined value from an accessible anchored list.
Choose a predefined value from an accessible anchored list.
After selection, `Select.Value` displays the selected item's label while `value`,
`onValueChange`, and native form submission continue to use its underlying value.
Backed by Base UI Select for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { Field, Select } from "@zentara-co/zenos-ui";
function SelectExample() {
return (
EnvironmentProductionStagingDevelopment
);
}
```
## Variants
`default` uses the bordered input surface, `filled` uses the gray subtlest fill, and `none` is borderless. Set `variant` on `Select.Root`; the trigger inherits it unless overridden.
```tsx
import { Select, Stack } from "@zentara-co/zenos-ui";
function SelectSurfaceVariantsExample() {
return (
{(["default", "filled", "none"] as const).map((variant) => (
OneTwo
))}
);
}
```
```tsx
import { Select, Stack } from "@zentara-co/zenos-ui";
type CatalogVariantProps = { limit?: number };
const limited = (items: readonly T[], limit?: number) =>
limit === undefined ? items : items.slice(0, limit);
const formControlSurfaceVariants = ["default", "filled", "none"] as const;
function SelectVariantsExample({ limit }: CatalogVariantProps = {}) {
if (limit !== undefined) {
return (
{limited(formControlSurfaceVariants, limit).map((variant) => (
One
))}
);
}
return (
{formControlSurfaceVariants.map((variant) => (
OneTwo
))}
);
}
```
## Custom styling
Every Select part accepts `className`. Style the trigger directly, then style `Select.Content` and its `listClassName` separately because the popup is rendered in a portal. Stable `data-slot` and Base UI state attributes can target highlighted and selected options without replacing the component's behavior.
```tsx
import { Field, Select } from "@zentara-co/zenos-ui";
function SelectCustomStylingExample() {
return (
Workspace accentTealBluePurpleA branded treatment built from semantic color tokens.
);
}
```
## Sizes
Set `size` on `Select.Root` to keep the trigger consistent with neighboring form controls. A trigger-level size can override the root when needed.
```tsx
import { Select, Stack } from "@zentara-co/zenos-ui";
function SelectSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
ProductionStagingDevelopment
))}
);
}
```
## Disabled and invalid
Disable the root or wrap the field in `Field.Root` with `disabled` when the entire selection is unavailable. For validation, set `Field.Root` to `invalid`; the trigger inherits `aria-invalid` and matches Input invalid styling.
```tsx
import { Field, Grid, Select } from "@zentara-co/zenos-ui";
function SelectStatesExample() {
return (
WorkspaceEngineeringThis selection is managed by your organization.RegionAsia PacificEurope, Middle East, and AfricaA region is required.
);
}
```
## Scrollable lists
`Select.Content` scrolls by default when options exceed the popup height (up to `16rem` or the available viewport space). The list is the scroll container; wheel, touch, and keyboard navigation keep working, and hover scroll arrows appear on pointer devices for long lists. Set `scrollable={false}` to render a static list (same padding as Autocomplete) or pass `listClassName` to adjust max height.
```tsx
import { Field, Select } from "@zentara-co/zenos-ui";
const timeZones = [
"Pacific/Honolulu",
"America/Anchorage",
"America/Los_Angeles",
"America/Denver",
"America/Chicago",
"America/New_York",
"America/Sao_Paulo",
"Atlantic/Reykjavik",
"Europe/London",
"Europe/Berlin",
"Europe/Helsinki",
"Africa/Cairo",
"Asia/Dubai",
"Asia/Kolkata",
"Asia/Bangkok",
"Asia/Singapore",
"Asia/Tokyo",
"Australia/Sydney",
"Pacific/Auckland",
];
function SelectScrollableExample() {
return (
Time zone
{timeZones.map((zone) => (
{zone.replaceAll("_", " ")}
))}
Long lists scroll inside the popup. Hover the top or bottom edge to step through options
with the scroll arrows.
);
}
```
## Groups and separators
Use groups to divide a longer option list into meaningful sections. Individual items can be disabled without disabling the rest of the Select.
```tsx
import { Field, Select } from "@zentara-co/zenos-ui";
function SelectGroupsExample() {
return (
Deployment regionAsia PacificSingaporeSydneyTokyoEuropeFrankfurtLondon
Private region (unavailable)
);
}
```
## Controlled selection and positioning
Pair `value` with `onValueChange` when application state owns the selection. `Select.Content` accepts `side`, `align`, and collision options and handles the portal, positioner, popup, scroll arrows, and list internally.
```tsx
import { Field, Select, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function SelectControlledExample() {
const [value, setValue] = useState("review");
return (
Publication status setValue(next ?? "review")}>
DraftIn reviewPublished
Current value: {value}
);
}
```
## Motion
The option list fades, scales, and moves from its resolved side when opening, then reverses that movement when closing. Reduced-motion preferences remove the animation automatically.
Open each select. The first list animates in and out. `disableMotion` makes the second appear and disappear immediately.
```tsx
import { Field, Grid, Select } from "@zentara-co/zenos-ui";
function SelectMotionExample() {
return (
With motionDraftPublishedWithout motionDraftPublished
);
}
```
## Variants
default, filled, none
## Sizes
sm, md, lg
## Anatomy
```text
Select.Root
Select.Trigger
Select.Value
Select.Content
Select.Group
Select.GroupLabel
Select.Item
Select.Separator
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| value | string | — | Controlled selected value. |
| defaultValue | string | — | Initial uncontrolled value. |
| onValueChange | (value: string \| null, eventDetails) => void | — | Runs when the selected value changes. |
| open / defaultOpen | boolean | — | Controlled or initial popup visibility. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when popup visibility changes. |
| size | sm \| md \| lg | md | Control height inherited by the trigger. |
| variant | default \| filled \| none | default | Trigger surface style (`filled` uses the subtle neutral fill). |
| Trigger.variant | default \| filled \| none | — | Overrides the visual treatment inherited from Select.Root. |
| disabled / required / name | boolean / boolean / string | — | Native form-control semantics forwarded through Base UI. |
| Content.side / align | top \| right \| bottom \| left / start \| center \| end | bottom / start | Preferred popup placement relative to the trigger. |
| Content.sideOffset | number | 4 | Space between the trigger and popup. |
| Content.alignItemWithTrigger | boolean | false | Overlaps the trigger and aligns the selected item with it. |
| Content.scrollable | boolean | true | Caps popup height and enables list scrolling with optional hover scroll arrows. |
| Content.disableMotion | boolean | false | Disables the popup enter and exit animation for this instance. |
| Content.listClassName | string | — | Extra classes on the list inside Content (for example a custom max height). |
| native props | React.Base UI Select props | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Select exposes a combobox trigger and listbox popup through Base UI. Arrow keys open and move through options, Enter or Space selects, and Escape closes the popup and returns focus to the trigger. `Home` and `End` move to the first and last available options. Associate the trigger with a visible `Field.Label`, and preserve disabled and invalid semantics rather than representing them through color alone.
Source: https://zenos-ui.pages.dev/components/select/
---
# Dialog
Modal content with focus management and composable actions.
Modal content with focus management and composable actions.
Backed by Base UI Dialog for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { Dialog, Field, Input, Stack, Textarea } from "@zentara-co/zenos-ui";
function DialogExample() {
return (
Edit workspaceEdit workspaceUpdate shared workspace settings.Workspace name} />
This name is visible to every workspace member.Summary} />
CancelSave changes
);
}
```
```text
Dialog.Root
├── Dialog.Trigger
└── Dialog.Content
├── Dialog.Header
│ ├── Dialog.Title
│ └── Dialog.Description
├── Content
└── Dialog.Footer
└── Dialog.Close
```
## Import
```tsx
import { Dialog } from "@zentara-co/zenos-ui";
```
## Composition and actions
`Dialog.Trigger` and `Dialog.Close` are already styled buttons. Use their `variant` and `size`
props for standard controls. Use Base UI's `render` composition only when another ref-forwarding
component must own the rendered element.
Use `Dialog.Close` for actions that always dismiss, such as Cancel or Done. For work that can fail
or finish asynchronously, use a regular Button and update the controlled `open` state only after
the operation succeeds.
## Controlled state
Use `open` and `onOpenChange` when application state must observe every opening and closing path.
The example closes from application code after saving while Cancel, Escape, and allowed outside
interaction continue through `onOpenChange`.
```tsx
import { Button, Dialog, Field, Input, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function DialogControlledExample() {
const [open, setOpen] = useState(false);
const [saved, setSaved] = useState(false);
return (
Edit profileEdit profileUpdate the name shown to workspace members.Display name} />
Cancel {
setSaved(true);
setOpen(false);
}}
>
Save changes
{saved ? "Profile saved." : `Dialog is ${open ? "open" : "closed"}.`}
);
}
```
## Dismissal behavior
Dialogs dismiss from their trigger, Close controls, Escape, and outside presses by default. Set
`disablePointerDismissal` when an accidental outside press would interrupt important work. Escape
and explicit Close controls remain available.
```tsx
import { Dialog, Text } from "@zentara-co/zenos-ui";
function DialogDismissalExample() {
return (
Review policyUpdated access policy
Outside presses are disabled so this decision is not dismissed accidentally.
Administrators must now review requests before members can access protected resources.
Not nowI understand
);
}
```
Set `showCloseButton={false}` only when another clearly labeled `Dialog.Close` is always present.
Use AlertDialog instead when a destructive or irreversible action requires an explicit decision.
## Width and surface styling
The default surface is `max-w-lg`. Override dimensions and padding through `className` on
`Dialog.Content`. Use `overlayClassName` for the backdrop and `viewportClassName` for viewport
spacing or alignment. Prefer semantic tokens for the dialog surface itself.
The backdrop still renders when the dialog is nested inside another dialog, including a closed
sheet. `Dialog.Overlay` uses `forceRender` for that case. Pass `forceRender={false}` only when a
nested dialog should leave the page undimmed.
```tsx
import { Card, Dialog, Grid, Text } from "@zentara-co/zenos-ui";
function DialogCustomSurfaceExample() {
return (
Open audit summaryAudit summaryA wider surface for information-dense workflows.Authentication
24 controls passing
Data protection
18 controls passing
Done
);
}
```
## Scrollable content
Enable `scrollable` for content that may exceed the viewport. Dialog constrains the surface to 90%
of the viewport height and creates an internal scroll region. Headers, body content, and footers
inside that region scroll together.
```tsx
import { Card, Dialog, Stack } from "@zentara-co/zenos-ui";
function DialogScrollableExample() {
return (
Review activityWorkspace activityRecent changes across this workspace.
{Array.from({ length: 12 }, (_, index) => (
Activity {index + 1}: Security policy updated by a workspace administrator.
))}
Done
);
}
```
## Focus management
Focus moves to the first tabbable element when the dialog opens and returns to its trigger when it
closes. Pass `initialFocus` or `finalFocus` to `Dialog.Content` only when the default order is not
appropriate. Avoid initially focusing a destructive action.
`Dialog.Content` creates the portal, overlay, viewport, and popup while preserving Base UI focus
trapping, Escape handling, outside interaction, and focus return. Use its styling props instead of
wrapping Content in another portal or overlay.
## Anatomy
```text
Dialog.Root
Dialog.Trigger
Dialog.Content
Dialog.Header
Dialog.Title
Dialog.Description
Dialog.Footer
Dialog.Close
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial uncontrolled open state. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs for trigger, Close, Escape, outside press, and controlled changes. |
| onOpenChangeComplete | (open: boolean) => void | — | Runs after opening or closing animations finish. |
| modal | boolean \| trap-focus | true | Controls focus trapping, page scroll locking, and outside interaction. |
| disablePointerDismissal | boolean | false | Prevents outside pointer presses from closing the dialog. |
| render (Trigger / Close) | ReactElement \| function | — | Composes Trigger and Close with another element. |
| initialFocus / finalFocus (Content) | Ref \| function | — | Customizes entry and return focus. |
| scrollable (Content) | boolean | false | Constrains tall content and enables internal overflow scrolling. |
| showCloseButton (Content) | boolean | true | Shows the automatic icon close control. |
| closeLabel (Content) | string | Close | Accessible name for the automatic close control. |
| variant / size (Trigger / Close) | ButtonVariant / sm \| md \| lg | primary / md (Trigger), outline / md (Close) | Styles the built-in button controls. |
| className (Content) | string | — | Overrides popup width, spacing, and surface styling. |
| overlayClassName (Content) | string | — | Adds classes to the generated modal backdrop. |
| forceRender (Overlay) | boolean | true | Renders the backdrop when the dialog is nested inside another dialog, including a closed sheet. |
| viewportClassName (Content) | string | — | Adds classes to the generated positioning viewport. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Give every dialog a meaningful `Dialog.Title`; add `Dialog.Description` when the scope or
consequence needs explanation. The automatic icon button uses `closeLabel`; customize it when
“Close” lacks enough context. Keep at least one explicit close path in modal dialogs, preserve a
logical tab order, and do not use Dialog as a substitute for AlertDialog confirmation semantics.
Source: https://zenos-ui.pages.dev/components/dialog/
---
# Popover
Non-modal content anchored to a trigger.
Non-modal content anchored to a trigger.
Backed by Base UI Popover for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { Button, Popover } from "@zentara-co/zenos-ui";
function PopoverExample() {
return (
}>Filters
Asset filtersLimit the visible asset set.Apply filters
);
}
```
## Anatomy
Use `Content` for the common portal, positioning, collision, and popup composition. `Header` groups the accessible title and description; `Footer` provides responsive spacing for actions.
```tsx
}>Details
Workspace detailsCurrent access and ownership.Done
```
## Import
```tsx
import { Button, Popover } from "@zentara-co/zenos-ui";
```
Popover uses `open`, `defaultOpen`, and `onOpenChange`. Content manages portal, positioner, and popup composition. Its default surface matches Dropdown Menu in both light and dark themes. Add the `arrow` prop when the popup needs a directional arrow; it is omitted by default. The popup and arrow share the same 150ms enter and exit motion so the arrow does not lag behind the surface. Escape and outside interaction close the popover according to Base UI behavior.
## Controlled state
Control open state when the trigger label or another part of the interface needs to reflect visibility.
```tsx
import { Button, Popover, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function PopoverControlledExample() {
const [open, setOpen] = useState(false);
return (
}>
{open ? "Details open" : "Show details"}
Finding detailsDetected on the public API endpoint.Done
Popover is {open ? "open" : "closed"}.
);
}
```
## Placement
`side` is the preferred side and may flip when collision avoidance detects insufficient space. `align` positions the popup along the selected side.
```tsx
import { Button, Popover, Stack } from "@zentara-co/zenos-ui";
function PopoverPlacementExample() {
return (
}>Top start
Top placementAligned to the start of the trigger.}>Bottom center
Bottom placementCentered on the trigger.}>Right end
Right placementAligned to the end of the trigger.
);
}
```
## Interactive content
Popover is non-modal and works well for compact controls that need an anchored surface. Keep longer workflows in Dialog or a dedicated page.
```tsx
import { Button, Checkbox, Label, Popover, Stack } from "@zentara-co/zenos-ui";
import { useState } from "react";
function PopoverFilterExample() {
const [criticalOnly, setCriticalOnly] = useState(false);
const [includeArchived, setIncludeArchived] = useState(false);
return (
}>Asset filters
Asset filtersLimit the assets shown in this view.Apply filters
);
}
```
## Motion
Popovers fade, scale, and move from their resolved side when opening, then reverse that movement when closing. Reduced-motion preferences remove the animation automatically. The arrow fades with the popup.
Open each popover. The first animates in and out. `disableMotion` makes the second appear and disappear immediately.
```tsx
import { Button, Grid, Popover } from "@zentara-co/zenos-ui";
function PopoverMotionExample() {
return (
}>With motion
Asset filtersLimit the visible asset set.}>Without motion
Asset filtersLimit the visible asset set.
);
}
```
## Custom styling
Use `className` to customize the popup surface and `arrowClassName` to keep the arrow fill matched. Pair semantic surface, border, and foreground tokens so nested title, description, and action colors remain legible across color schemes.
```tsx
import { Button, Popover } from "@zentara-co/zenos-ui";
function PopoverCustomExample() {
return (
}>Campaign summary
Quarterly campaign
Three audiences and 24 published assets.
Got it
);
}
```
## Popover or another component
Use Popover for compact, interactive content anchored to a trigger. Use [Tooltip](/components/tooltip/) for brief non-interactive descriptions, [Dropdown Menu](/components/dropdown-menu/) for a list of commands, and [Dialog](/components/dialog/) for modal or longer tasks.
## Anatomy
```text
Popover.Root
Popover.Trigger
Popover.Content
Popover.Header
Popover.Title
Popover.Description
Popover.Footer
Popover.Close
Popover.Arrow
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial uncontrolled state. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when visibility changes. |
| Trigger.render / Close.render | ReactElement \| function | — | Composes Trigger or Close with another element. |
| side | top \| right \| bottom \| left \| inline-* | bottom | Preferred popup side. |
| align | start \| center \| end | center | Position relative to trigger. |
| arrow | boolean | false | Renders the arrow inside Content. The arrow uses the same enter and exit motion as the popup. |
| Content.disableMotion | boolean | false | Disables the popup and arrow enter and exit animation for this instance. |
| sideOffset / alignOffset | number | sideOffset: 8 | Adjusts the popup distance and alignment-axis offset. |
| Close.variant / Close.size | ButtonVariant / sm \| md \| lg | outline / sm | Styles Popover.Close when it renders its default button. |
| Content.className / arrowClassName / positionerClassName | string | — | Customizes the popup, arrow, or positioning wrapper. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Title and Description name and describe the popup through Base UI’s ARIA relationships. The trigger receives expanded-state semantics. Escape and allowed outside interaction dismiss the popup, and focus returns to the trigger. Keep the focus order logical, label every form control, and avoid putting essential information in an unlabeled popup.
Source: https://zenos-ui.pages.dev/components/popover/
---
# Tooltip
Supplemental text for pointer and keyboard users.
Supplemental text for pointer and keyboard users.
Backed by Base UI Tooltip for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { CopyIcon } from "@phosphor-icons/react";
import { Button, Stack, Tooltip } from "@zentara-co/zenos-ui";
function TooltipVariantsExample() {
return (
{(["default", "solid"] as const).map((variant) => (
} />}>
{variant}
{variant} tooltip
))}
);
}
```
## Import
```tsx
import { Tooltip } from "@zentara-co/zenos-ui";
```
## Variants
`default` uses the brand-subtle surface for short labels. `solid` provides a stronger overlay surface for slightly longer supplemental descriptions.
## Placement
Set the preferred `side` and alignment on `Tooltip.Content`. Base UI flips or shifts the popup when collision avoidance requires it.
```tsx
import { Button, Stack, Tooltip } from "@zentara-co/zenos-ui";
function TooltipPlacementExample() {
const sides = ["top", "right", "bottom", "left"] as const;
return (
{sides.map((side) => (
}>{side}
Placed on the {side}
))}
);
}
```
## Controlled state
Use `open` with `onOpenChange` when another part of the interface must observe visibility. Hover, focus, Escape, and outside interaction all report through the same callback.
```tsx
import { Button, Stack, Text, Tooltip } from "@zentara-co/zenos-ui";
import { useState } from "react";
function TooltipControlledExample() {
const [open, setOpen] = useState(false);
return (
}>Policy status
Last checked five minutes ago.
Tooltip is {open ? "open" : "closed"}.
);
}
```
## Motion
Tooltips fade, scale, and move from their resolved side when opening, then reverse that movement when closing. Reduced-motion preferences remove the animation automatically. The arrow fades with the tooltip.
Hover or focus each button. The first tooltip animates in and out. `disableMotion` makes the second appear and disappear immediately.
```tsx
import { Button, Grid, Stack, Tooltip } from "@zentara-co/zenos-ui";
function TooltipMotionExample() {
return (
}>With motion
Saved two minutes ago}>Without motion
Saved two minutes ago
);
}
```
## Provider delay
Wrap related tooltips in one Provider to share `delay`, `closeDelay`, and the grace `timeout`. Once one tooltip appears, nearby tooltips can open instantly during the grace period. Zenos defaults `delay` to zero; set a modest delay for dense toolbars when immediate hover feedback feels noisy.
## Arrow
Content includes a matching arrow by default. Disable it for surfaces where trigger direction is already clear.
```tsx
import { Button, Stack, Tooltip } from "@zentara-co/zenos-ui";
function TooltipArrowExample() {
return (
}>With arrow
Arrow points to the trigger}>Without arrow
No arrow is rendered
);
}
```
Tooltips supplement an accessible name; they should not contain essential instructions or interactive content.
## Variants
default, solid
## Anatomy
```text
Tooltip.Provider
Tooltip.Root
Tooltip.Trigger
Tooltip.Content
Tooltip.Arrow
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| delay | number | 0 | Provider or trigger opening delay. |
| Provider.closeDelay / timeout | number / number | 0 / 400 | Close delay and instant-open grace period for grouped tooltips. |
| open / defaultOpen | boolean | — | Controlled or initial tooltip visibility. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when visibility changes. |
| variant | default \| solid | default | Popup surface style. |
| side | top \| right \| bottom \| left | top | Preferred popup side. |
| align / sideOffset | start \| center \| end / number | center / 4 | Popup alignment and distance from the trigger. |
| showArrow | boolean | true | Renders a matching arrow that fades with the tooltip. |
| Content.disableMotion | boolean | false | Disables the popup and arrow enter and exit animation for this instance. |
| render | ReactElement \| function | — | Composes the trigger with another element. |
| native props | React.Base UI Tooltip props | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Tooltips open on pointer hover and keyboard focus, close with Escape, and connect to their trigger through Base UI's description relationship. Trigger composition uses `render`, so the rendered control must retain supplied props and refs. Keep tooltip content brief and non-interactive. Disabled native buttons cannot receive focus or hover events reliably; place essential explanations in persistent text rather than depending on a tooltip.
Source: https://zenos-ui.pages.dev/components/tooltip/
---
# Tabs
Switch between related panels without leaving the page.
Switch between related panels without leaving the page.
Backed by Base UI Tabs for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { NewspaperIcon, ShieldPlusIcon } from "@phosphor-icons/react";
import { Badge, Stack, Tabs } from "@zentara-co/zenos-ui";
import { type ReactNode } from "react";
function TabsCountBadge({ children }: { children: ReactNode }) {
return (
{children}
);
}
function TabsPatternsExample() {
return (
Overview
25
Activity
25
Reports
25
Workspace overview
Workspace reports
Overview
25
Activity
25
Members
Settings
Project overview
Recent project activity
Project members
);
}
```
## Import
```tsx
import { Tabs } from "@zentara-co/zenos-ui";
```
## Variants
`default` renders a connected segmented control with end-cap rounding. `underline` uses a bottom selection indicator and works well for page-level sections. Pair tabs with icons and `Badge` counts; active tabs style nested `[data-slot=badge]` for primary counts. Set the variant on `Tabs.List`; every tab inherits it unless explicitly overridden.
```tsx
import { Stack, Tabs } from "@zentara-co/zenos-ui";
type CatalogVariantProps = { limit?: number };
const limited = (items: readonly T[], limit?: number) =>
limit === undefined ? items : items.slice(0, limit);
function TabsVariantsExample({ limit }: CatalogVariantProps = {}) {
if (limit !== undefined) {
return (
{limited(["default", "underline"] as const, limit).map((variant) => (
OneTwo
))}
);
}
return (
{(["default", "underline"] as const).map((variant) => (
OverviewActivity
{variant} tabs
Activity
))}
);
}
```
Tabs are horizontal. Use `default` for compact view switching and `underline` for broader content sections. If a vertical layout or URL navigation is required, use an appropriate navigation component instead.
## Custom styling
Every Tabs part accepts `className`. Style individual parts directly, or scope a cohesive treatment from `Tabs.List` with stable `data-slot` attributes and Base UI's `data-active` state. Keep selection, disabled state, and other behavior in their dedicated props.
```tsx
import { Tabs } from "@zentara-co/zenos-ui";
function TabsCustomStylingExample() {
return (
SummaryActivityMembers
Project health, ownership, and delivery status.
Recent changes across the project workspace.
Members and teams with access to this project.
);
}
```
## Controlled and disabled
Use `value` with `onValueChange` when application state owns the active panel. Disabled tabs remain visible but are skipped by pointer and keyboard activation.
```tsx
import { Stack, Tabs, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function TabsControlledExample() {
const [value, setValue] = useState("overview");
return (
OverviewActivityBilling
Archive
Workspace health and recent security posture.
Recent changes made by workspace members.
Subscription, usage, and invoice information.
Active tab: {value}
);
}
```
## Animated indicator
`Tabs.Indicator` is optional. Place it inside a `default` list when one moving selection surface should sit behind the tabs. The indicator follows the active tab's measured position and disables its transition under reduced motion. The `underline` variant already draws its active marker and does not need this part.
```tsx
import { Tabs } from "@zentara-co/zenos-ui";
function TabsIndicatorExample() {
return (
Details
Permissions
History
Asset ownership and environment details.
Members and teams with access to this asset.
Changes recorded during the last 30 days.
);
}
```
## Long tab lists
When all labels remain useful, place the list in a horizontal overflow container rather than compressing or wrapping tabs into multiple lines. For large information architectures, consider navigation instead of an excessively long tab set.
```tsx
import { Tabs } from "@zentara-co/zenos-ui";
function TabsOverflowExample() {
const items = [
"Overview",
"Activity",
"Assets",
"Members",
"Policies",
"Integrations",
"Notifications",
"Billing",
"Audit log",
"Advanced",
];
return (
{items.map((item) => (
{item}
))}
{items.map((item) => (
{item} settings
))}
);
}
```
## Variants
default, underline
## Anatomy
```text
Tabs.Root
Tabs.List
Tabs.Tab
Tabs.Indicator
Tabs.Content
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| Root.value | string | — | Controlled active tab. |
| Root.defaultValue | string | — | Initial uncontrolled tab. |
| Root.onValueChange | (value: string, eventDetails) => void | — | Runs when active tab changes. |
| Root.activationMode | automatic \| manual | automatic | Controls whether focus or explicit activation selects a tab. |
| List.variant | default \| underline | default | Visual treatment inherited by tabs in the list. |
| Tab.disabled | boolean | false | Prevents a tab from receiving activation. |
| Tab.variant | default \| underline | — | Overrides the visual treatment inherited from Tabs.List. |
| native props | React.Base UI Tabs props | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Tabs preserve Base UI's tab, tablist, and tabpanel relationships. Left and Right Arrow move between tabs; Home and End move to the first and last enabled tabs. Enter or Space activates a focused tab when activation is manual. Keep labels short, ensure every tab has a corresponding panel, and do not use Tabs as site navigation.
Source: https://zenos-ui.pages.dev/components/tabs/
---
# Accordion
Reveal sections of related content with keyboard-accessible headings.
Reveal sections of related content with keyboard-accessible headings.
Backed by Base UI Accordion for
upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on
this page.
```tsx
import { Accordion, Stack, Text } from "@zentara-co/zenos-ui";
const accordionPreviewItems = [
{
value: "notifications",
title: "Notification settings",
body: "Manage email alerts and push notifications for workspace updates.",
},
{
value: "privacy",
title: "Privacy & security",
body: "Review sign-in methods, sessions, and data sharing preferences.",
},
] as const;
function AccordionPreviewExample() {
return (
{(["default", "plain"] as const).map((variant) => (
{variant}
{accordionPreviewItems.map((item) => (
{item.title}{item.body}
))}
))}
);
}
```
## Anatomy
Each item needs a unique `value`. Wrap the trigger in `Header` so the disclosure control keeps proper heading semantics.
```tsx
BillingInvoices and payment methods.
```
`Root` uses the same neutral card surface, border, and radius as [Collapsible](/components/collapsible/) when `variant="default"`. `Trigger` matches Collapsible interaction states (hover, open, focus ring, chevron). `Content` animates height and renders a top divider with padded body text in `text-text-subtle`.
## Variants
`variant="default"` is the contained card used in settings panels and docs previews. `variant="plain"` removes the outer border and fill so the accordion sits flush on the page background—only horizontal dividers separate items, triggers have no hover fill, and content flows directly under the title without an inner divider. The preview at the top compares both side by side.
## Import
```tsx
import { Accordion } from "@zentara-co/zenos-ui";
```
## Single and multiple expansion
By default, opening one item closes the others. Pass `multiple` when several sections may stay open, such as notification and session settings on the same page.
```tsx
import { Accordion } from "@zentara-co/zenos-ui";
function AccordionMultipleExample() {
return (
NotificationsChoose which workspace events send notifications.Active sessionsReview devices currently signed in to this account.Recovery optionsConfigure backup codes and recovery contacts.
);
}
```
Control expansion with `value` and `onValueChange`, or use `defaultValue` for uncontrolled usage. Values are string arrays even when only one panel is open.
## Disabled item
Disable an item when its content is unavailable. The trigger stays visible; Base UI sets `aria-disabled` and blocks activation.
```tsx
import { Accordion } from "@zentara-co/zenos-ui";
function AccordionDisabledExample() {
return (
Available settingThis setting is available to all workspace owners.Enterprise settingThis setting requires the Enterprise plan.
);
}
```
## Accordion or Collapsible
Use Accordion for a related set of labeled sections where heading structure and choosing among panels matters. Use [Collapsible](/components/collapsible/) for a single optional region such as advanced settings or secondary metadata.
## Styling and composition
Default parts provide the design-system surface, chevron, dividers between items, and content spacing. Use `showChevron={false}` when another indicator shows state. Apply `contentClassName` on the inner wrapper so custom styling does not affect the animated panel height.
```tsx
import { Accordion } from "@zentara-co/zenos-ui";
function AccordionCustomExample() {
return (
Campaign settings
Audiences, budgets, and scheduling for the current quarter.
Export defaults
CSV and JSON export formats for workspace reports.
);
}
```
Pass `className` on `Root` or `Item` to tint the surface and borders. Style `Trigger` hover and open fills the same way as Collapsible. `Trigger` supports Base UI's `render` prop when a specialized element must own the control—keep a clear accessible name and visible expanded state.
## Variants
default, plain
## Anatomy
```text
Accordion.Root
Accordion.Item
Accordion.Header
Accordion.Trigger
Accordion.Content
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| Root.variant | default \| plain | default | Default uses a bordered card surface; plain is a flat list with horizontal dividers only. |
| value | string[] | — | Controlled expanded items. |
| defaultValue | string[] | — | Initial uncontrolled expanded items. |
| onValueChange | (value: string[]) => void | — | Runs when expansion changes. |
| multiple | boolean | false | Allows multiple open items. |
| disabled (Item / Trigger) | boolean | false | Disables an item and its trigger. |
| Trigger.showChevron | boolean | true | Shows the built-in disclosure chevron. |
| Content.contentClassName | string | — | Classes on the inner content wrapper; panel height animation is unchanged. |
| Root.className | string | — | Merged on the root. Uses bg-background-neutral-card by default, matching Collapsible. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Triggers expose button semantics with `aria-expanded`. Enter and Space toggle the focused section; arrow keys move between triggers in the group. Keep trigger labels concise and unique. Disabled items expose `aria-disabled`. Motion-reduction preferences disable height and chevron transitions.
Source: https://zenos-ui.pages.dev/components/accordion/
---
# Collapsible
A single disclosure region controlled by one trigger.
Reveal one optional region without navigating away or managing a collection of sections.
Backed by Base UI Collapsible for
upstream behavior and configuration. Zenos follows the same composition model as{" "}
shadcn/ui Collapsible: an
unstyled root, a trigger, and animated content—while keeping the compound{" "}
Collapsible.Root API.
```tsx
import { Collapsible, Stack, Text } from "@zentara-co/zenos-ui";
function CollapsiblePreviewExample() {
return (
default
Toggle details
Composable trigger and content without a built-in shell.
panel
Advanced settings
Contained disclosure surface with divider and padding.
);
}
```
## Composition
Build disclosures from three parts. The root owns open state; it does not impose a card shell unless you opt in.
```tsx
Toggle detailsHidden content
```
```text
Collapsible.Root
├── Collapsible.Trigger
└── Collapsible.Content
```
## Import
```tsx
import { Collapsible } from "@zentara-co/zenos-ui";
```
## Variants
`variant="default"` (implicit) keeps `Root` unstyled so you can wrap [Card](/components/card/), layout, or custom surfaces—similar to shadcn’s basic and order-detail examples. `variant="panel"` applies the contained disclosure shell (border, neutral card fill, full-width trigger row, content divider).
The preview above compares both.
## Basic
A minimal FAQ-style disclosure: inline trigger, chevron, and supporting text below.
```tsx
import { Collapsible } from "@zentara-co/zenos-ui";
function CollapsibleExample() {
return (
Can I use this in my project?
Yes. Free to use for personal and commercial projects. No attribution required.
);
}
```
## Order details in a card
Compose a default collapsible inside `Card` when the trigger should sit in a product surface rather than a standalone panel.
```tsx
import { Card, Collapsible, Stack, Text } from "@zentara-co/zenos-ui";
function CollapsibleOrderExample() {
return (
Order #4189
StatusShipped
Tracking updates when the carrier scans the package.
);
}
```
## Settings panel
Use `Collapsible.Trigger` with Base UI’s `render` prop when a [Button](/components/button/) or other control should own the trigger element. Set `showChevron={false}` when the control already communicates state.
```tsx
import { Button, Collapsible, Field, Input, Stack } from "@zentara-co/zenos-ui";
function CollapsibleSettingsPanelExample() {
return (
} showChevron={false}>
Radius
Radius XRadius Y
);
}
```
## File tree
Nested folders and files belong in [File Tree](/components/file-tree/). Collapsible stays the primitive for one disclosure region.
## Controlled state
Use `open` and `onOpenChange` when another part of the UI must read or drive the disclosure. Prefer `defaultOpen` for local, uncontrolled usage.
```tsx
import { Collapsible, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function CollapsibleControlledExample() {
const [open, setOpen] = useState(false);
return (
{open ? "Hide" : "Show"} deployment details
Production deploys require two approvals and a passing security scan.
Panel is {open ? "open" : "closed"}.
);
}
```
## States
`defaultOpen` sets the initial uncontrolled state. A disabled trigger stays visible but cannot open its panel.
```tsx
import { Collapsible, Stack } from "@zentara-co/zenos-ui";
function CollapsibleStatesExample() {
return (
Closed by default
This content appears after the trigger is activated.
Unavailable sectionUnavailable content
);
}
```
## Panel variant
When you want the contained shell without wrapping `Card`, set `variant="panel"` on `Root`.
```tsx
import { Collapsible } from "@zentara-co/zenos-ui";
function CollapsiblePanelExample() {
return (
Advanced settings
Configure retention, exports, and workspace access policies.
);
}
```
## Custom styling
Override surfaces with semantic tokens on `Root`, `Trigger`, or `contentClassName`. Panel variant accepts the same accent treatments as before; default variant keeps animation on `Content` while you style the surrounding layout.
```tsx
import { Collapsible } from "@zentara-co/zenos-ui";
function CollapsibleCustomExample() {
return (
Campaign details
This campaign includes three audiences and runs until the end of the quarter.
);
}
```
## Collapsible or Accordion
Use Collapsible for one optional region. Use [Accordion](/components/accordion/) when several related sections need heading structure and shared list behavior. Use [File Tree](/components/file-tree/) for nested folders and files.
## Variants
default, panel
## Anatomy
```text
Collapsible.Root
Collapsible.Trigger
Collapsible.Content
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| Root.variant | default \| panel | default | Default leaves Root unstyled for Card and layout composition; panel applies the contained disclosure shell. |
| open | boolean | — | Controlled expanded state. |
| defaultOpen | boolean | false | Initial uncontrolled state. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when state changes. |
| Trigger.disabled | boolean | false | Prevents Trigger activation. |
| Trigger.showChevron | boolean | true | Shows the built-in disclosure chevron. |
| Trigger.render | ReactElement \| function | — | Composes Trigger with another element. |
| Content.contentClassName | string | — | Adds classes to the inner content wrapper without changing panel animation. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
The trigger is a native button (or the element passed to `render`) and exposes `aria-expanded`. Enter and Space toggle it when focused. Keep labels meaningful, preserve visible focus, and avoid nesting interactive controls inside the trigger unless they stop propagation. Motion-reduction preferences disable height and chevron transitions.
Source: https://zenos-ui.pages.dev/components/collapsible/
---
# Dropdown Menu
Contextual commands and selection controls in an anchored menu.
Contextual commands and selection controls in an anchored menu.
Backed by Base UI Menu for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { DotsThreeVerticalIcon } from "@phosphor-icons/react";
import { DropdownMenu, IconButton } from "@zentara-co/zenos-ui";
function DropdownMenuExample() {
return (
}>
AssetOpenArchiveDelete
);
}
```
## Import
```tsx
import { Button, DropdownMenu } from "@zentara-co/zenos-ui";
```
## Selection items
Use checkbox items for independent view options and a radio group when exactly one option should be active.
```tsx
import { Button, DropdownMenu } from "@zentara-co/zenos-ui";
import { useState } from "react";
function DropdownMenuSelectionExample() {
const [showArchived, setShowArchived] = useState(false);
const [density, setDensity] = useState("comfortable");
return (
}>
View options
Show archived assets
DensityCompactComfortable
);
}
```
## Submenus, links, and shortcuts
Use Item for commands and LinkItem for navigation. Shortcut is presentation for a command the application already implements.
```tsx
import { Button, DropdownMenu } from "@zentara-co/zenos-ui";
function DropdownMenuSubmenuExample() {
return (
}>
Share project
Copy link ⌘CShare with teamDesignEngineeringManage access
);
}
```
Content hides portal and positioning internals. Arrow keys navigate, Home/End jump through items, Escape closes the menu, and focus returns to the trigger. Use `ContextMenu` when invocation belongs to a context-menu gesture rather than a visible trigger.
## Motion
Dropdown menus and submenus fade, scale, and move from their resolved side when opening, then reverse that movement when closing. Reduced-motion preferences remove the animation automatically.
Open each menu. The first animates in and out. `disableMotion` makes the second appear and disappear immediately.
```tsx
import { Button, DropdownMenu, Grid } from "@zentara-co/zenos-ui";
function DropdownMenuMotionExample() {
return (
}>
With motion
RenameDuplicateArchive}>
Without motion
RenameDuplicateArchive
);
}
```
## Custom styling
Style the visible trigger through its rendered button, then style `DropdownMenu.Content` separately because the popup is rendered in a portal. Stable `data-slot` attributes and Base UI's `data-highlighted` state can target items, labels, separators, and shortcuts without changing menu behavior.
```tsx
import { Button, DropdownMenu } from "@zentara-co/zenos-ui";
function DropdownMenuCustomStylingExample() {
return (
}
>
Workspace actions
Workspace
Invite members ⌘I
Copy link ⌘CManage settings
);
}
```
## Anatomy
```text
DropdownMenu.Root
DropdownMenu.Trigger
DropdownMenu.Content
DropdownMenu.Item
DropdownMenu.CheckboxItem
DropdownMenu.RadioGroup
DropdownMenu.RadioItem
DropdownMenu.Sub
DropdownMenu.Separator
DropdownMenu.Shortcut
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial uncontrolled state. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when visibility changes. |
| render | ReactElement \| function | — | Composes the trigger with another element. |
| side / align | Base UI position values | — | Popup placement supplied on Content. |
| Content.disableMotion | boolean | false | Disables enter and exit motion on Content or SubContent. |
| checked / onCheckedChange | boolean / (checked: boolean, eventDetails) => void | — | Controls a CheckboxItem selection. |
| value / onValueChange | string / (value: string, eventDetails) => void | — | Controls the selected RadioGroup item. |
| disabled | boolean | false | Prevents an item from receiving selection. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Base UI provides menu roles, focus movement, typeahead, selection semantics, Escape dismissal, and focus return. Give icon-only triggers an accessible name. Use menu items for short actions and choices; use ordinary page content when users need to read or interact with a complex form.
Source: https://zenos-ui.pages.dev/components/dropdown-menu/
---
# Combobox
Search and select one or more values from a collection.
Search and select one or more values from a collection.
Backed by Base UI Combobox for
upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on
this page.
```tsx
import { Combobox } from "@zentara-co/zenos-ui";
const teams = ["Design", "Engineering", "Operations"];
function ComboboxExample() {
return (
No teams found.
{(team: string) => (
{team}
)}
);
}
```
## Popup search
Use a standalone trigger when the selected value should remain separate from filtering. The popup places a padded, borderless search row (with a magnifying-glass icon) above the result list, following the Argus selection pattern. List options use the same styling as [`Autocomplete`](/components/autocomplete/).
```tsx
import { Combobox, Field, Stack } from "@zentara-co/zenos-ui";
function ComboboxPopupSearchExample() {
const popupTeams = ["Design", "Engineering", "Operations", "Research"];
return (
Primary teamNo teams found.
{(team: string) => (
{team}
)}
Participating teamsNo teams found.
{(team: string) => (
{team}
)}
);
}
```
```text
Combobox.Root
├── Combobox.InputGroup
│ ├── Combobox.Input
│ ├── Combobox.Clear
│ └── Combobox.Trigger
└── Combobox.Content
├── Combobox.Empty
├── Combobox.List
│ ├── Combobox.Group
│ ├── Combobox.Item
│ └── Combobox.Separator
└── Combobox.Status
```
## Import
```tsx
import { Combobox } from "@zentara-co/zenos-ui";
```
## Sizes
`Combobox.InputGroup` uses the shared `sm`, `md`, and `lg` control scale from [`Input`](/components/input/).
```tsx
import { Combobox, Stack } from "@zentara-co/zenos-ui";
const teams = ["Design", "Engineering", "Operations"];
function ComboboxSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
))}
);
}
```
## Variants
Choose a surface that matches the field hierarchy. `default`, `filled`, and `none` match Input. Standalone `Combobox.Trigger` (popup search) uses the same variants when it is not nested in `Combobox.InputGroup`.
```tsx
import { Combobox, Field, Grid } from "@zentara-co/zenos-ui";
const teams = ["Design", "Engineering", "Operations"];
function ComboboxVariantsExample() {
return (
{(["default", "filled", "none"] as const).map((variant) => (
{variant}No teams found.
{(team: string) => (
{team}
)}
))}
);
}
```
## Disabled and invalid
Compose with `Field` for shared label, description, and error semantics. Hover, focus, invalid, and disabled treatments follow the Input spec: the **input group** (or standalone trigger) owns the 2px focused border and pressed background—no inner focus ring on the text field, clear, or trigger affordances. Popup search rows keep a bottom border only.
```tsx
import { Combobox, Field, Grid } from "@zentara-co/zenos-ui";
const teams = ["Design", "Engineering", "Operations"];
function ComboboxStatesExample() {
return (
DisabledInvalid
{(team: string) => (
{team}
)}
Select a supported team.
);
}
```
## Controlled selection
Use `value` and `onValueChange` when selection belongs to application state. `defaultValue` provides the uncontrolled equivalent.
```tsx
import { Combobox, Field, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
const teams = ["Design", "Engineering", "Operations"];
function ComboboxControlledExample() {
const [team, setTeam] = useState("Engineering");
return (
Workspace teamNo teams found.
{(item: string) => (
{item}
)}
Selected team: {team ?? "None"}
);
}
```
## Motion
`Combobox.Content` uses the fast popup motion rhythm: it fades, scales, and moves from the resolved placement on open, then reverses on close. Reduced-motion preferences remove the animation automatically.
Open both fields. The first popup animates in and out. `disableMotion` makes the second appear and disappear immediately.
```tsx
import { Combobox, Field, Grid } from "@zentara-co/zenos-ui";
const teams = ["Design", "Engineering", "Operations"];
function ComboboxMotionExample() {
return (
With motionNo teams found.
{(team: string) => (
{team}
)}
Without motionNo teams found.
{(team: string) => (
{team}
)}
);
}
```
## Multiple selection
Multiple selection uses chips to keep chosen values visible and individually removable while the input remains searchable.
```tsx
import { Combobox, Field, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
const teams = ["Design", "Engineering", "Operations"];
function ComboboxMultipleExample() {
const [selectedTeams, setSelectedTeams] = useState(["Design", "Engineering"]);
return (
Project teams
{(value: string[]) => (
{value.map((team) => (
{team}
))}
)}
No teams found.
{(team: string) => (
{team}
)}
{selectedTeams.length} teams selected
);
}
```
## Async search (single)
Load results when the input changes instead of fetching the entire collection upfront. Keep search text (`inputValue`) separate from selection (`value`), and use `filter={null}` when the server already filters results—including matches on email addresses or roles rather than just display names.
This example waits 250 ms before starting a simulated request, cancels superseded requests with `AbortController`, and ignores aborted responses. It searches only while the popup is open and the query has at least two characters. Loading, errors, and empty results are announced with `Combobox.Status`; requests never run just because a selected person's name fills the input.
```tsx
import { useEffect, useState } from "react";
import { Combobox, Field, Text } from "@zentara-co/zenos-ui";
interface DirectoryPerson {
id: string;
name: string;
email: string;
role: string;
}
const directoryPeople: DirectoryPerson[] = [
{ id: "ana", name: "Ana Santos", email: "ana@example.com", role: "Product Designer" },
{ id: "nadia", name: "Nadia Putri", email: "nadia@example.com", role: "Design Engineer" },
{ id: "leo", name: "Leo Chen", email: "leo@example.com", role: "Frontend Engineer" },
{ id: "maya", name: "Maya Patel", email: "maya@example.com", role: "Engineering Manager" },
{ id: "omar", name: "Omar Hassan", email: "omar@example.com", role: "Product Manager" },
{ id: "sari", name: "Sari Wijaya", email: "sari@example.com", role: "Researcher" },
];
function searchDirectory(query: string, signal: AbortSignal): Promise {
return new Promise((resolve, reject) => {
if (signal.aborted) {
reject(new DOMException("Search cancelled", "AbortError"));
return;
}
const timer = setTimeout(() => {
signal.removeEventListener("abort", cancel);
if (query === "error") {
reject(new Error("Directory unavailable. Change your search to try again."));
return;
}
resolve(
directoryPeople
.filter((person) =>
`${person.name} ${person.email} ${person.role}`.toLowerCase().includes(query),
)
.map((person) => ({ ...person })),
);
}, 500);
function cancel() {
clearTimeout(timer);
reject(new DOMException("Search cancelled", "AbortError"));
}
signal.addEventListener("abort", cancel, { once: true });
});
}
interface DirectorySearchState {
query: string;
status: "idle" | "loading" | "success" | "error";
results: DirectoryPerson[];
error: string | null;
}
function useDirectorySearch(inputValue: string, enabled: boolean) {
const query = inputValue.trim().toLowerCase();
const canSearch = enabled && query.length >= 2;
const [state, setState] = useState({
query: "",
status: "idle",
results: [],
error: null,
});
useEffect(() => {
if (!canSearch) return;
const controller = new AbortController();
setState({ query, status: "loading", results: [], error: null });
const timer = setTimeout(async () => {
try {
const results = await searchDirectory(query, controller.signal);
if (!controller.signal.aborted) {
setState({ query, status: "success", results, error: null });
}
} catch (error) {
if (!controller.signal.aborted) {
setState({
query,
status: "error",
results: [],
error: error instanceof Error ? error.message : "Could not search the directory.",
});
}
}
}, 250);
return () => {
clearTimeout(timer);
controller.abort();
};
}, [query, canSearch]);
const current: DirectorySearchState = !canSearch
? { query, status: "idle", results: [], error: null }
: state.query === query
? state
: { query, status: "loading", results: [], error: null };
const message =
current.status === "loading"
? "Searching directory…"
: current.status === "error"
? current.error
: current.status === "idle"
? "Type at least two characters to search."
: current.results.length === 0
? `No people found for “${inputValue.trim()}”.`
: `${current.results.length} ${current.results.length === 1 ? "person" : "people"} found.`;
return { ...current, message, isLoading: current.status === "loading" };
}
function includeSelectedPeople(results: DirectoryPerson[], selected: DirectoryPerson[]) {
return [
...results,
...selected.filter((person) => !results.some((result) => result.id === person.id)),
];
}
function DirectorySearchContent({ search }: { search: ReturnType }) {
return (
{search.message}
{search.status === "success" && search.results.length === 0 ? (
Try a name, email address, or role.
) : null}
{(person: DirectoryPerson) => (
{person.name}
{person.role} · {person.email}
)}
);
}
function ComboboxAsyncSingleExample() {
const [selected, setSelected] = useState(null);
const [inputValue, setInputValue] = useState("");
const [open, setOpen] = useState(false);
const search = useDirectorySearch(inputValue, open && inputValue !== selected?.name);
const items = includeSelectedPeople(search.results, selected ? [selected] : []);
return (
);
}
```
Replace `searchDirectory` with your application's API call, passing its signal to `fetch`. Keep the selected object in `items`, use `itemToStringLabel` for its display name, `itemToStringValue` for native form submission, and `isItemEqualToValue` to compare stable IDs across new responses. Fetching belongs to the consuming feature, not the core Combobox.
## Async search (multiple)
Add `multiple`, control selection as an array, and render removable chips through `Combobox.Value`. Merge selected people into each new result collection without duplicate IDs so changing the query, loading another result set, or encountering an error does not discard earlier selections. Selecting a person clears the search text. Remove chips individually without losing the other selections; closing the popup also clears the multiple-select query through Base UI's normal input behavior.
```tsx
import { useEffect, useState } from "react";
import { Combobox, Field, Text } from "@zentara-co/zenos-ui";
interface DirectoryPerson {
id: string;
name: string;
email: string;
role: string;
}
const directoryPeople: DirectoryPerson[] = [
{ id: "ana", name: "Ana Santos", email: "ana@example.com", role: "Product Designer" },
{ id: "nadia", name: "Nadia Putri", email: "nadia@example.com", role: "Design Engineer" },
{ id: "leo", name: "Leo Chen", email: "leo@example.com", role: "Frontend Engineer" },
{ id: "maya", name: "Maya Patel", email: "maya@example.com", role: "Engineering Manager" },
{ id: "omar", name: "Omar Hassan", email: "omar@example.com", role: "Product Manager" },
{ id: "sari", name: "Sari Wijaya", email: "sari@example.com", role: "Researcher" },
];
function searchDirectory(query: string, signal: AbortSignal): Promise {
return new Promise((resolve, reject) => {
if (signal.aborted) {
reject(new DOMException("Search cancelled", "AbortError"));
return;
}
const timer = setTimeout(() => {
signal.removeEventListener("abort", cancel);
if (query === "error") {
reject(new Error("Directory unavailable. Change your search to try again."));
return;
}
resolve(
directoryPeople
.filter((person) =>
`${person.name} ${person.email} ${person.role}`.toLowerCase().includes(query),
)
.map((person) => ({ ...person })),
);
}, 500);
function cancel() {
clearTimeout(timer);
reject(new DOMException("Search cancelled", "AbortError"));
}
signal.addEventListener("abort", cancel, { once: true });
});
}
interface DirectorySearchState {
query: string;
status: "idle" | "loading" | "success" | "error";
results: DirectoryPerson[];
error: string | null;
}
function useDirectorySearch(inputValue: string, enabled: boolean) {
const query = inputValue.trim().toLowerCase();
const canSearch = enabled && query.length >= 2;
const [state, setState] = useState({
query: "",
status: "idle",
results: [],
error: null,
});
useEffect(() => {
if (!canSearch) return;
const controller = new AbortController();
setState({ query, status: "loading", results: [], error: null });
const timer = setTimeout(async () => {
try {
const results = await searchDirectory(query, controller.signal);
if (!controller.signal.aborted) {
setState({ query, status: "success", results, error: null });
}
} catch (error) {
if (!controller.signal.aborted) {
setState({
query,
status: "error",
results: [],
error: error instanceof Error ? error.message : "Could not search the directory.",
});
}
}
}, 250);
return () => {
clearTimeout(timer);
controller.abort();
};
}, [query, canSearch]);
const current: DirectorySearchState = !canSearch
? { query, status: "idle", results: [], error: null }
: state.query === query
? state
: { query, status: "loading", results: [], error: null };
const message =
current.status === "loading"
? "Searching directory…"
: current.status === "error"
? current.error
: current.status === "idle"
? "Type at least two characters to search."
: current.results.length === 0
? `No people found for “${inputValue.trim()}”.`
: `${current.results.length} ${current.results.length === 1 ? "person" : "people"} found.`;
return { ...current, message, isLoading: current.status === "loading" };
}
function includeSelectedPeople(results: DirectoryPerson[], selected: DirectoryPerson[]) {
return [
...results,
...selected.filter((person) => !results.some((result) => result.id === person.id)),
];
}
function DirectorySearchContent({ search }: { search: ReturnType }) {
return (
{search.message}
{search.status === "success" && search.results.length === 0 ? (
Try a name, email address, or role.
) : null}
{(person: DirectoryPerson) => (
{person.name}
{person.role} · {person.email}
)}
);
}
function ComboboxAsyncMultipleExample() {
const [selected, setSelected] = useState([]);
const [inputValue, setInputValue] = useState("");
const [open, setOpen] = useState(false);
const search = useDirectorySearch(inputValue, open);
const items = includeSelectedPeople(search.results, selected);
return (
);
}
```
Both examples use a deterministic, simulated directory rather than a live service. Search for a name such as “Ana”, a role such as “engineer”, an unknown name for an empty response, or “error” for a failed request. Change the query to recover. Clearing the input, closing the popup, and unmounting cancel pending work; `aria-busy` marks the input and popup while loading.
## Groups, status, and disabled items
Group related results, expose filtering status, and leave unavailable values visible when that context helps users understand the collection.
```tsx
import { Combobox } from "@zentara-co/zenos-ui";
function ComboboxGroupedExample() {
const items = ["Design", "Engineering", "Operations", "Legacy systems"];
return (
No capabilities found.Active teams
{items.slice(0, 3).map((item) => (
{item}
))}
Legacy systems
);
}
```
## Anatomy
```text
Combobox.Root
Combobox.Trigger
Combobox.Value
Combobox.Content
Combobox.Input
Combobox.List
Combobox.Item
Combobox.Empty
Combobox.Group
Combobox.GroupLabel
Combobox.Separator
Combobox.Status
Combobox.Chips
Combobox.Chip
Combobox.ChipRemove
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| value | ItemValue \| ItemValue[] \| null | — | Controlled selection. |
| defaultValue | ItemValue \| ItemValue[] | — | Initial uncontrolled selection. |
| onValueChange | (value) => void | — | Runs when selection changes. |
| multiple | boolean | false | Enables multiple selection. |
| items | ItemValue[] | — | Items available for filtering. |
| inputValue / onInputValueChange | string / (value, details) => void | — | Controls search text independently of selection. Use input changes to load async results in the consuming feature. |
| filter | function \| null | — | Set to null to disable local filtering when a remote service already filters results. |
| itemToStringLabel / itemToStringValue | (item) => string | — | Maps object values to display labels and native form values respectively. |
| isItemEqualToValue | (item, value) => boolean | — | Compares stable IDs so refreshed async objects retain their selected state. |
| disabled | boolean | false | Disables selection and input interaction. |
| name | string | — | Name used for native form submission. |
| open / defaultOpen / onOpenChange | controlled state props | — | Controls popup visibility. |
| size (InputGroup / Input / Trigger) | 'sm' \| 'md' \| 'lg' | md | Control height for the input group shell and nested input. |
| variant (InputGroup / Trigger) | 'default' \| 'filled' \| 'none' | default | Input group or standalone trigger surface treatment. |
| side / align (Content) | Base UI position values | bottom / start | Popup placement relative to its anchor. |
| Content.disableMotion | boolean | false | Disables the popup enter and exit animation for this instance. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Give the input an accessible label through `Field.Label`, `Combobox.Label`, or `aria-label`. Base UI manages the input's active descendant, listbox relationship, selection announcements, and focus. Arrow keys move through results, Enter selects the active result, Escape closes the popup without losing input focus, and removable chips expose named buttons.
Source: https://zenos-ui.pages.dev/components/combobox/
---
# Activity Feed
A vertical timeline of comments, mentions, status changes, uploads, and other events.
Activity Feed is a timeline of what happened. One rail threads the events, and each event composes only the parts it needs: a marker, a header, a short note, a quoted card, files, or a trailing action.
```tsx
import { AtIcon, ChatCircleIcon, CheckCircleIcon } from "@phosphor-icons/react";
import { ActivityFeed, Avatar, IconButton } from "@zentara-co/zenos-ui";
function ActivityFeedPreviewExample() {
return (
Mina Cho
commented
2h ago
The empty states are clearer now. Can we ship the copy tweaks before Friday?
Jonah Adeyemi
mentioned you in the migration notes
3h agoCan you own the checklist for the billing cutover?Mina Cho
marked the review done
6h ago
);
}
```
## Import
```tsx
import { ActivityFeed } from "@zentara-co/zenos-ui";
```
## Anatomy
`ActivityFeed` renders an `ol`. Each `ActivityFeed.Item` renders an `li`. There is no prop for hiding the time, body, or marker: leave the part out.
```tsx
{/* icon */}Mina Cho
marked the review done
6h ago{/* optional note */}{/* optional controls */}
```
Use Activity Feed for an audit log, a record history, or a notification list. Use [Empty State](/components/empty-state/) when the list has no events yet. Use [Alert](/components/alert/) for a single status message that is not part of a history.
## Markers
The marker names the kind of event. `ActivityFeed.Icon` is a soft tinted tile. `ActivityFeed.Dot` is the same 32px slot with a small dot for a minor edit. For a person, put [Avatar](/components/avatar/) in the marker at `size={32}`. The slot stays 32px at both densities so the rail stays aligned.
```tsx
import { UploadSimpleIcon } from "@phosphor-icons/react";
import { ActivityFeed, Avatar } from "@zentara-co/zenos-ui";
function ActivityFeedMarkersExample() {
return (
Jonah Adeyemi
joined the workspace
2m agoJonah Adeyemi
uploaded the press kit
10m agoJonah Adeyemi
renamed the project
17m ago
);
}
```
Icon and dot variants are `default`, `primary`, `success`, `warning`, `info`, `destructive`, `purple`, `teal`, `orange`, and `magenta`. The tile and the dot are decorative. The actor and the action carry the meaning.
## Unread
`unread` on an item strengthens the header and adds a brand dot at the end of the row. The dot has the visually hidden label “Unread”. The row itself stays untinted.
## Quoted notes and files
`ActivityFeed.Body` is a short muted line. `ActivityFeed.Card` is a nested surface for a comment, review, or note, with a smaller radius than [Card](/components/card/).
Files and images belong in `ActivityFeed.Attachments`. Lay `ActivityFeed.Image` thumbnails out in a wrapping row, and compose a [File Card](/components/file-card/) for each file. Each image requires `alt`.
```tsx
import { UploadSimpleIcon } from "@phosphor-icons/react";
import { ActivityFeed, Avatar, FileCard } from "@zentara-co/zenos-ui";
function ActivityFeedAttachmentsExample() {
return (
Mina Cho
attached 3 files
5h ago
source-assets.zip18 MB · ArchiveJonah Adeyemi
left a review
8h ago
The motion is right, but the empty-state illustration feels heavy on the cream theme.
Try it at a smaller size.
);
}
```
## Row actions and links
`ActivityFeed.Actions` sits beside the content, aligned to the marker, so it stays on the first line as the event grows. Compose [Icon Button](/components/icon-button/) or [Button](/components/button/) there and give each control a specific accessible name.
To make the whole event a link or button, pass `as` on the item. The list item stays an `li`, and the link or button becomes the surface inside it:
```tsx
Merged the pull request
```
`as` implies `interactive`, which adds a hover fill, a pressed fill, and a focus ring. Keep actions off a linked item so a control is not nested inside the link. `ActivityFeed.Actor` also accepts `as` when only the name should navigate.
## Day groups
`ActivityFeed.Group` gathers events under `ActivityFeed.GroupLabel`. The label sits in the text column, and the rail runs through it, so the timeline stays one line from the first event to the last. Each group is its own list, named by the label.
```tsx
import { ActivityFeed, Avatar } from "@zentara-co/zenos-ui";
function ActivityFeedGroupsExample() {
return (
TodayMina Cho
checked in for the 10:30 visit
10:24Front desk
marked the invoice paid
09:02YesterdayJonah Adeyemi
left a note on the record
16:40Prefers morning slots. Bring the March x-ray.
);
}
```
The label renders a `div` by default. Pass `as="h2"` or another heading when the group name should appear in the page outline.
## Separator
`separator="rail"` is the default timeline. `separator="rule"` replaces the rail with a hairline between events, for an audit log or notification inbox. `separator="none"` is a plain list for a single notice or a digest where a timeline would be too heavy.
```tsx
import { ActivityFeed, Stack, Text } from "@zentara-co/zenos-ui";
function ActivityFeedSeparatorExample() {
const events = ["Edited the brief", "Uploaded the press kit", "Renamed the project"] as const;
return (
{(["rail", "rule", "none"] as const).map((separator) => (
{separator}
{events.map((event) => (
Mina Cho
{event}
))}
))}
);
}
```
## Density
`density="comfortable"` is the default. `density="compact"` tightens the gap between events and the type of the header. Density also inherits from `DensityProvider`. The marker size does not change.
```tsx
import { AtIcon, CheckCircleIcon } from "@phosphor-icons/react";
import { ActivityFeed, Grid, Stack, Text } from "@zentara-co/zenos-ui";
function ActivityFeedDensityExample() {
return (
{(["comfortable", "compact"] as const).map((density) => (
{density}
Mina Cho
edited the brief
1h agoMina Cho
exported the report
40m ago
))}
);
}
```
## Variants
default, primary, success, warning, info, destructive, purple, teal, orange, magenta
## Anatomy
```text
ActivityFeed.Root
ActivityFeed.Item
ActivityFeed.Marker
ActivityFeed.Icon
ActivityFeed.Dot
ActivityFeed.Content
ActivityFeed.Header
ActivityFeed.Actor
ActivityFeed.Time
ActivityFeed.Body
ActivityFeed.Card
ActivityFeed.Attachments
ActivityFeed.Image
ActivityFeed.Actions
ActivityFeed.Group
ActivityFeed.GroupLabel
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| separator | rail \| rule \| none | rail | Rail draws the timeline through the marker column. Rule replaces it with a hairline between events. None is a plain list. |
| density | comfortable \| compact | comfortable | Controls event spacing. The marker stays 32px. Inherits from DensityProvider when omitted. |
| Item.unread | boolean | false | Strengthens the header and adds a brand dot with the visually hidden label Unread. |
| Item.interactive | boolean | false | Adds hover, press, and focus treatment on the event surface. |
| Item.as | ElementType | div | Renders the event surface inside the list item. Use a or button for a native link or control. Implies interactive. |
| Icon.variant / Dot.variant | default \| primary \| success \| warning \| info \| destructive \| purple \| teal \| orange \| magenta | default | Soft tint for a typed event or low-emphasis dot. Both markers are decorative. |
| Time.dateTime | string | — | Machine-readable datetime for the time element. |
| Image.alt | string | — | Required alternative text for an attachment thumbnail. |
| GroupLabel.as | ElementType | div | Rendered element for the group name. Use a heading when it belongs in the page outline. |
| className | string | — | Merged last on every part. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
The feed is an ordered list. Group labels name their nested lists, so a screen reader can announce “Today, list” before the events in that day. Pass `dateTime` on `ActivityFeed.Time` so the visible relative time has a machine-readable value.
Icons and dots are `aria-hidden`. An avatar in the marker keeps its own accessible name. Attachment images require alternative text. The unread dot includes the hidden text “Unread”.
A linked or button event uses a native `a` or `button` inside the list item. Do not put another link or button inside that surface. Icon-only row actions need their own accessible names. The feed does not announce new events on its own; add a live region in the surrounding feature when an update should be spoken.
Source: https://zenos-ui.pages.dev/components/activity-feed/
---
# Alert
A compact banner-style message with optional icon, action, and dismissal controls.
A compact banner-style message with optional icon, action, and dismissal controls.
```tsx
import { Alert, Stack } from "@zentara-co/zenos-ui";
const alertExampleTitle = "Lorem ipsum here";
const alertExampleDescription = "Content text here zipzipzipzipzipzipblebleblebleblebleble";
function AlertPreviewExample() {
return (
{(["info", "success", "warning"] as const).map((variant) => (
{alertExampleTitle}{alertExampleDescription}
))}
);
}
```
## Import
```tsx
import { Alert } from "@zentara-co/zenos-ui";
```
## Custom icons
Pass a custom icon on `Alert.Root` for a shared leading icon, or on `Alert.Icon` with the `icon` prop (or children) to override it locally. Set `showDefault={false}` on `Alert.Icon` to omit the variant default on status alerts. Built-in status icons are exported as `AlertInfoIcon`, `AlertCheckCircleIcon`, `AlertWarningIcon`, and `AlertErrorIcon`.
```tsx
import { Alert, Stack } from "@zentara-co/zenos-ui";
function AlertCustomIconExample() {
const SparkIcon = () => (
);
return (
}>
Scheduled maintenanceWorkspace sync pauses tonight from 11 PM to 1 AM.} />
Product launch weekPin the launch checklist to your team home page.
);
}
```
## Actions and dismissal
`Alert.Title` and `Alert.Description` use body medium and body regular at the `body-m` scale. Long copy truncates with an ellipsis. `Alert.Action` adds a related action. `Alert.Close` provides the dismiss control while the consumer remains responsible for removing the static alert. Both controls automatically match the semantic color of `Alert.Root`.
```tsx
import { Alert, Button } from "@zentara-co/zenos-ui";
import { useState } from "react";
function AlertActionsExample() {
const [visible, setVisible] = useState(true);
if (!visible) {
return (
setVisible(true)}>
Show alert
);
}
return (
Import runningYour workspace data is still being processed. undefined}>Details setVisible(false)} />
);
}
```
## Variants
Neutral variants suit general and inverse announcements. Status variants use information and accent subtle banner surfaces for success, info, warning, and error. Leading icons appear on status variants only. Action and close controls inherit the alert tone.
```tsx
import { Alert, Stack, Text } from "@zentara-co/zenos-ui";
type CatalogVariantProps = { limit?: number };
const limited = (items: readonly T[], limit?: number) =>
limit === undefined ? items : items.slice(0, limit);
const alertVariantGroups = [
{ label: "Neutral", variants: ["default", "announcement"] },
{ label: "Status", variants: ["info", "success", "warning", "error"] },
] as const;
const alertVariants = alertVariantGroups.flatMap((group) => group.variants);
const alertShowsDefaultIcon = (variant: (typeof alertVariants)[number]) =>
variant === "info" || variant === "success" || variant === "warning" || variant === "error";
const alertExampleTitle = "Lorem ipsum here";
const alertExampleDescription = "Content text here zipzipzipzipzipzipblebleblebleblebleble";
function AlertVariantsExample({ limit }: CatalogVariantProps = {}) {
if (limit !== undefined) {
return (
{limited(alertVariants, limit).map((variant) => (
{alertShowsDefaultIcon(variant) ? : null}
{alertExampleTitle}{alertExampleDescription}Button
))}
);
}
return (
{alertVariantGroups.map((group) => (
{group.label}
{group.variants.map((variant) => (
{alertShowsDefaultIcon(variant) ? : null}
{alertExampleTitle}{alertExampleDescription}Button
))}
))}
);
}
```
## Anatomy
```text
Alert.Root
Alert.Content
Alert.Icon
Alert.Body
Alert.Title
Alert.Description
Alert.Action
Alert.Close
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| Root.variant | AlertVariant | default | Semantic visual tone; error also defaults to role=alert. |
| Root.icon | ReactNode | — | Custom leading icon for Alert.Icon when it has no local override. |
| Icon.icon | ReactNode | — | Custom icon node; overrides Root.icon and the variant default. |
| Icon.showDefault | boolean | true | Renders the variant default when no custom icon is provided. |
| Action.variant | ButtonVariant | ghost | Button treatment; its color follows Root.variant. |
| Close.label | string | Dismiss | Accessible name for the dismiss control. |
| role | AriaRole | — | Overrides the status or alert role. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Alert uses `role="status"` by default and `role="alert"` for the error variant. Use concise titles, keep action labels meaningful, and avoid placing essential information only in the icon or color.
Source: https://zenos-ui.pages.dev/components/alert/
---
# Alert Dialog
A modal confirmation surface for actions that require an explicit decision.
A modal confirmation surface for actions that require an explicit decision.
Backed by Base UI Alert Dialog for
upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on
this page.
```tsx
import { AlertDialog } from "@zentara-co/zenos-ui";
function AlertDialogExample() {
return (
Delete projectDelete this project?This action cannot be undone.CancelDelete
);
}
```
## Import
```tsx
import { AlertDialog } from "@zentara-co/zenos-ui";
```
## Confirmation patterns
Match the action tone to the consequence. Reversible actions can use the primary action, while destructive and irreversible actions should use the destructive treatment and explicit wording.
```tsx
import { AlertDialog, Stack } from "@zentara-co/zenos-ui";
function AlertDialogPatternsExample() {
return (
Archive projectArchive this project?
Members will lose access until the project is restored.
CancelArchiveDelete projectDelete this project?
This permanently removes its data and cannot be undone.
Keep projectDelete permanently
);
}
```
## Controlled state
Control visibility when the surrounding flow needs to observe or coordinate the decision. Action and Cancel both close the modal after their handlers run.
```tsx
import { AlertDialog, Button, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function AlertDialogControlledExample() {
const [open, setOpen] = useState(false);
const [result, setResult] = useState("No decision");
return (
}>
Revoke access
Revoke member access?
The member will be signed out and removed from this workspace.
setResult("Cancelled")}>Cancel setResult("Access revoked")}>
Revoke access
{result}
);
}
```
## Nested backdrops
`AlertDialog.Content` includes a backdrop through `AlertDialog.Overlay`. The overlay defaults to `forceRender={true}` so it can render inside another dialog, including a closed sheet. This does not open the alert dialog or keep it mounted when closed. When composing the overlay yourself, pass `forceRender={false}` to use Base UI's default nested-backdrop behavior.
## Anatomy
```text
AlertDialog.Root
AlertDialog.Trigger
AlertDialog.Content
AlertDialog.Header
AlertDialog.Title
AlertDialog.Description
AlertDialog.Footer
AlertDialog.Cancel
AlertDialog.Action
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial uncontrolled open state. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when open state changes. |
| render | ReactElement \| function | — | Composes triggers and actions with another element. |
| variant / size | ButtonVariant / sm \| md \| lg | — | Styles Trigger, Action, and Cancel controls. |
| forceRender (Overlay) | boolean | true | Allows the backdrop to render inside another dialog, including a closed sheet. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
AlertDialog uses `role="alertdialog"`, traps focus, prevents casual outside dismissal, and returns focus to its trigger. Always provide a title and a description of the consequence. Use specific action text such as “Delete permanently” instead of a vague “Continue,” and make the safe cancellation path easy to identify.
Source: https://zenos-ui.pages.dev/components/alert-dialog/
---
# Autocomplete
A filterable text input that suggests matching values.
A filterable text input that suggests matching values.
Backed by Base UI Autocomplete for
upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on
this page.
```tsx
import { Autocomplete, Field } from "@zentara-co/zenos-ui";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteExample() {
return (
CityNo cities found.
{(city: string) => (
{city}
)}
);
}
```
## Import
```tsx
import { Autocomplete } from "@zentara-co/zenos-ui";
```
## Sizes
`Autocomplete.InputGroup` uses the shared `sm`, `md`, and `lg` control scale from Input.
```tsx
import { Autocomplete, Stack } from "@zentara-co/zenos-ui";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
))}
);
}
```
## Variants
Choose a surface that matches the field hierarchy. `default` is the standard bordered control, `filled` is the subtle filled surface, and `none` is borderless for inline editing—the same variants as [`Input`](/components/input/).
```tsx
import { Autocomplete, Field, Grid } from "@zentara-co/zenos-ui";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteVariantsExample() {
return (
{(["default", "filled", "none"] as const).map((variant) => (
{variant}No cities found.
{(city: string) => (
{city}
)}
))}
);
}
```
## Custom styling
Every Autocomplete part accepts `className`. Style `Autocomplete.InputGroup` for the field, then style `Autocomplete.Content` separately because the popup is rendered in a portal. Stable `data-slot` values and the `data-highlighted` state can restyle suggestions without replacing filtering or keyboard behavior. Pass `positionerClassName` on `Content` when the positioning wrapper needs classes of its own.
```tsx
import { Autocomplete, Field } from "@zentara-co/zenos-ui";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteCustomStylingExample() {
return (
Workspace city
No cities found.
{(city: string) => (
{city}
)}
A branded treatment built from semantic color tokens.
);
}
```
## Grouped suggestions
Pass an array of groups to `items`, with an `items` array on each group. Keep any label or other metadata alongside those items. Render the filtered groups through `Autocomplete.List`, then pass each group's filtered `items` to `Autocomplete.Group`.
Use `Autocomplete.GroupLabel` to name the group and `Autocomplete.Collection` to render its suggestions. Collection does not add a wrapper element; it uses the items supplied by its group. Filtering matches the suggestions, hides groups with no matches, and keeps keyboard navigation on options rather than group headings.
```tsx
import { Autocomplete, Field } from "@zentara-co/zenos-ui";
function AutocompleteGroupedExample() {
const groups = [
{ label: "West Java", items: ["Bandung", "Bogor"] },
{ label: "East Java", items: ["Malang", "Surabaya"] },
];
return (
City by province items={groups}>
No cities found.
{(group: (typeof groups)[number]) => (
{group.label}
{(city: string) => (
{city}
)}
)}
Suggestions are grouped by province; you can also enter another city.
);
}
```
Do not map the original groups directly when using built-in filtering: the function child of `Autocomplete.List` receives the filtered groups. For object suggestions, provide `itemToStringValue` to define the text used for filtering and input completion, and pass the full item to `Autocomplete.Item value`.
`Group` and `GroupLabel` accept native props, refs, and `className` for custom spacing or heading styling. Group labels describe suggestions; they are not selectable options. Keep `Autocomplete.Empty` in the popup to explain when no group has matching results.
## Opening
The suggestion popup opens when the input receives focus. Set `openOnFocus={false}` when the list should wait for typing or `Autocomplete.Trigger`.
Focus the first field to open its suggestions. The second field stays closed until you type or press its trigger.
```tsx
import { Autocomplete, Field, Grid } from "@zentara-co/zenos-ui";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteOpeningExample() {
return (
Opens on focusNo cities found.
{(city: string) => (
{city}
)}
Focus opens the suggestions.Opens from typingNo cities found.
{(city: string) => (
{city}
)}
Focus keeps the list closed. Type or use the trigger.
);
}
```
## Controlled value
Use `value` and `onValueChange` when selection belongs to application state. `Autocomplete.Clear` resets the value through the same callback.
```tsx
import { Autocomplete, Field, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteControlledExample() {
const [value, setValue] = useState("Jakarta");
return (
CityNo cities found.
{(city: string) => (
{city}
)}
Selected: {value || "None"}
);
}
```
## Motion
`Autocomplete.Content` fades, scales, and moves from its resolved side when it opens, then reverses that movement when it closes. The animation uses the fast motion rhythm and automatically stands down for reduced-motion preferences.
Open both fields. The first popup animates in and out. `disableMotion` makes the second appear and disappear immediately.
```tsx
import { Autocomplete, Field, Grid } from "@zentara-co/zenos-ui";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteMotionExample() {
return (
With motionNo cities found.
{(city: string) => (
{city}
)}
Without motionNo cities found.
{(city: string) => (
{city}
)}
);
}
```
## Disabled and invalid
Place Autocomplete inside `Field` to share disabled and invalid semantics with its label, description, and error message. Hover, focus, invalid, and disabled treatments follow the Input spec: the **input group** owns the 2px focused border and pressed background (no inner focus ring on the text field or trigger). Invalid groups use the same danger-subtle border and accent red subtlest fill as Input.
```tsx
import { Autocomplete, Field, Grid } from "@zentara-co/zenos-ui";
const cities = ["Bandung", "Jakarta", "Surabaya"];
function AutocompleteStatesExample() {
return (
DisabledInvalid
{(city: string) => (
{city}
)}
Select a supported city.
);
}
```
## Anatomy
```text
Autocomplete.Root
Autocomplete.InputGroup
Autocomplete.Input
Autocomplete.Trigger
Autocomplete.Clear
Autocomplete.Content
Autocomplete.List
Autocomplete.Item
Autocomplete.Empty
Autocomplete.Group
Autocomplete.GroupLabel
Autocomplete.Collection
Autocomplete.Separator
Autocomplete.Status
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| value | ItemValue | — | Controlled input value. |
| defaultValue | ItemValue | — | Initial uncontrolled value. |
| onValueChange | (value: ItemValue) => void | — | Runs when selection changes. |
| openOnFocus | boolean | true | Opens the suggestion popup when the input receives focus. Typing and Autocomplete.Trigger still open it when this is false. |
| items | readonly ItemValue[] \| readonly { items: readonly ItemValue[] }[] | — | Flat suggestions or groups containing suggestions. Groups may include labels and other metadata; List renders the filtered groups. |
| itemToStringValue | (item: ItemValue) => string | — | Text used to filter and complete object suggestions. Receives individual suggestions, not their groups. |
| Group.items | readonly ItemValue[] | — | The filtered suggestions for this group. Its nested Collection renders these items. |
| GroupLabel.children | ReactNode | — | Visible heading and accessible name for a suggestion group. |
| Collection.children | (item: ItemValue, index: number) => ReactNode | — | Renders the group's suggestions without an additional DOM wrapper. |
| size | 'sm' \| 'md' \| 'lg' | md | Input group height (`Autocomplete.InputGroup` / `Autocomplete.Input`). |
| variant | 'default' \| 'filled' \| 'none' | default | Surface treatment on `Autocomplete.InputGroup` (`default`, `filled`, or `none`). |
| Content.disableMotion | boolean | false | Disables the popup enter and exit animation for this instance. |
| className | string | — | Merged last on every part. Style InputGroup on the field and Content for the portaled popup. |
| Content.positionerClassName | string | — | Classes on the positioning wrapper around the popup. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Autocomplete preserves Base UI's combobox semantics, filtering, active-option announcements, and keyboard navigation. Provide a visible label through `Field.Label`, label icon-only trigger and clear controls, and keep empty-state text meaningful. In grouped lists, use `GroupLabel` so each group has an accessible name; arrow keys navigate its options and continue across group boundaries.
Source: https://zenos-ui.pages.dev/components/autocomplete/
---
# Avatar
An image, fallback, status, and tooltip representation for a person or entity.
An image, fallback, status, and tooltip representation for a person or entity.
Backed by Base UI Avatar for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { Avatar, Stack } from "@zentara-co/zenos-ui";
function AvatarPreviewExample() {
return (
}
/>
);
}
```
## Import
```tsx
import { Avatar } from "@zentara-co/zenos-ui";
```
## Sizes
Use a named size for the shared scale or one of the supported numeric pixel sizes for a specific context.
```tsx
import { Avatar, Stack } from "@zentara-co/zenos-ui";
function AvatarSizesExample() {
return (
{(["xsm", "sm", "md", "lg", "xl"] as const).map((size) => (
))}
);
}
```
## Shapes
```tsx
import { Avatar, Stack } from "@zentara-co/zenos-ui";
function AvatarShapesExample() {
return (
{(["circle", "rounded", "square"] as const).map((shape) => (
))}
);
}
```
## Status
Status dots contribute their label to the Avatar's accessible name. Do not rely on the dot color alone.
```tsx
import { Avatar, Stack } from "@zentara-co/zenos-ui";
function AvatarStatusesExample() {
return (
{(["success", "neutral", "error"] as const).map((variant) => (
}
/>
))}
);
}
```
## Fallbacks and tooltips
`name` generates initials and is the default tooltip. A failed image falls back to initials, while an unnamed avatar uses the generic person icon.
```tsx
import { Avatar, Stack } from "@zentara-co/zenos-ui";
function AvatarFallbackExample() {
return (
);
}
```
## Custom styling
Use `className` on `Avatar` to style its root and stable slots such as `avatar-fallback`. Status content remains independently customizable through `Avatar.StatusDot`. Keep `name`, `alt`, and the status `label` meaningful when changing the visual treatment.
```tsx
import { Avatar } from "@zentara-co/zenos-ui";
function AvatarCustomStylingExample() {
return (
}
/>
);
}
```
## Anatomy
```text
Avatar
Avatar.Root
Avatar.Image
Avatar.Fallback
Avatar.StatusDot
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| src | string | — | Image URL. |
| alt | string | — | Image alternative text. |
| name | string | — | Display name used to generate initials and tooltip content. |
| Root.size | AvatarSize | md | Named or supported numeric size. |
| shape | circle \| rounded \| square | circle | Avatar geometry. |
| tooltip | boolean \| string | true | Uses the name or a custom string as tooltip content. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Avatar uses Base UI's image loading and fallback behavior. Provide `name` or `alt` for meaningful avatars, label status dots, and use `tooltip={false}` only when the surrounding interface already identifies the person.
Source: https://zenos-ui.pages.dev/components/avatar/
---
# Avatar Group
An overlapping collection of avatars with an overflow summary.
An overlapping collection of avatars with an overflow summary.
```tsx
import { Avatar, AvatarGroup } from "@zentara-co/zenos-ui";
function AvatarGroupExample() {
return (
);
}
```
## Import
```tsx
import { AvatarGroup } from "@zentara-co/zenos-ui";
```
## Sizes
Set `size` once on the group. Every child Avatar and overflow control inherits it.
```tsx
import { Avatar, AvatarGroup, Stack } from "@zentara-co/zenos-ui";
function AvatarGroupSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
))}
);
}
```
## Shapes
The group also passes its shape to every child, keeping overlap and borders consistent.
```tsx
import { Avatar, AvatarGroup, Stack } from "@zentara-co/zenos-ui";
function AvatarGroupShapesExample() {
return (
{(["circle", "rounded", "square"] as const).map((shape) => (
))}
);
}
```
## Overflow
Use `AvatarGroup.Overflow` to represent hidden members. Providing `onClick` makes it a keyboard-accessible button.
```tsx
import { Avatar, AvatarGroup, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function AvatarGroupOverflowExample() {
const [expanded, setExpanded] = useState(false);
return (
{!expanded && setExpanded(true)} />}
{expanded && (
<>
>
)}
{expanded ? "Showing additional collaborators." : "Activate +8 to show more."}
);
}
```
## Group tooltip
Use a group tooltip when one summary describes the entire stack. Disable child tooltips to avoid competing hover targets.
```tsx
import { Avatar, AvatarGroup } from "@zentara-co/zenos-ui";
function AvatarGroupTooltipExample() {
return (
);
}
```
## Custom styling
Style the group surface with `className`, then use stable slots to coordinate child Avatar borders, fallbacks, and `AvatarGroup.Overflow`. Size, shape, overlap, accessible group naming, and roving focus behavior remain owned by the component.
```tsx
import { Avatar, AvatarGroup, Stack, Text } from "@zentara-co/zenos-ui";
function AvatarGroupCustomStylingExample() {
return (
Campaign team
8 collaborators
);
}
```
## Anatomy
```text
AvatarGroup.Root
AvatarGroup.Overflow
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| size | AvatarSize | md | Size inherited by child avatars. |
| shape | AvatarShape | circle | Shape inherited by child avatars. |
| tooltip | string | — | Optional tooltip describing the whole group. |
| count | number | — | Number of hidden avatars represented by AvatarGroup.Overflow. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Give every group an accessible name. Interactive avatars and overflow controls use roving focus with Left, Right, Home, and End navigation. Keep every Avatar's `name` meaningful even when initials are visually sufficient.
Source: https://zenos-ui.pages.dev/components/avatar-group/
---
# Badge
A compact label with independent appearance and color.
Badge separates **appearance** from **color**. Use `variant` to choose the surface treatment and `color` to choose a semantic intent or named palette.
```tsx
import { Badge, Stack } from "@zentara-co/zenos-ui";
const badgeVariants = ["default", "outline", "solid", "soft"] as const;
function BadgePreviewExample() {
return (
{badgeVariants.map((variant) => (
{variant}
))}
);
}
```
## Import
```tsx
import { Badge, type BadgeColor, type BadgeVariant } from "@zentara-co/zenos-ui";
```
## Appearance variants
- **default:** A tinted surface with a matching border.
- **outline:** A transparent surface with a colored outline.
- **solid:** A strong fill with a contrasting foreground and a richer dark-mode surface.
- **soft:** A low-emphasis fill without a visible border.
Every appearance supports the same colors. Omitting both props gives `variant="default"` and `color="neutral"`. Neutral default and outline badges use visible gray surfaces and borders instead of low-opacity white or black.
```tsx
import { Badge, Stack, Text } from "@zentara-co/zenos-ui";
type CatalogVariantProps = { limit?: number };
const limited = (items: readonly T[], limit?: number) =>
limit === undefined ? items : items.slice(0, limit);
const badgeVariants = ["default", "outline", "solid", "soft"] as const;
const badgeColors = [
"neutral",
"brand",
"danger",
"warning",
"information",
"success",
"gray",
"red",
"orange",
"yellow",
"lime",
"green",
"teal",
"cyan",
"sky",
"blue",
"indigo",
"purple",
"pink",
] as const;
function BadgeVariantsExample({ limit }: CatalogVariantProps = {}) {
if (limit !== undefined) {
return (
{limited(badgeVariants, limit).map((variant) => (
{variant}
))}
);
}
return (
{badgeVariants.map((variant) => (
{variant}
{badgeColors.map((color) => (
{color}
))}
))}
);
}
```
## Colors
Choose an intent with `neutral`, `brand`, `danger`, `warning`, `information`, or `success`. For categorical distinctions, choose `gray`, `red`, `orange`, `yellow`, `lime`, `green`, `teal`, `cyan`, `sky`, `blue`, `indigo`, `purple`, or `pink`.
Color and appearance are independent: for example, `variant="outline" color="danger"` and `variant="soft" color="danger"` share an intent but have different emphasis. The palettes use mode-aware semantic tokens.
```tsx
import { Badge, Stack } from "@zentara-co/zenos-ui";
const badgeColors = [
"neutral",
"brand",
"danger",
"warning",
"information",
"success",
"gray",
"red",
"orange",
"yellow",
"lime",
"green",
"teal",
"cyan",
"sky",
"blue",
"indigo",
"purple",
"pink",
] as const;
function BadgeColorsExample() {
return (
{badgeColors.map((color) => (
{color}
))}
);
}
```
## Shape
Use `rounded` for fully rounded corners, or `rounded={false}` for regular corners. Badge defaults to `false`. Shape is independent of `variant` and `color`, including custom variants. Custom classes can still override the corner radius.
```tsx
import { Badge, Stack } from "@zentara-co/zenos-ui";
function BadgeShapeExample() {
return (
Regular corners
Fully rounded
);
}
```
## With icons
Use `Badge.Icon` for decorative leading or trailing icons. The wrapper hides its contents from assistive technology so the badge text remains the accessible label. `Badge.Root` is an alias for `Badge`.
```tsx
import { CheckCircleIcon } from "@phosphor-icons/react";
import { Badge, Stack } from "@zentara-co/zenos-ui";
function BadgeIconExample() {
return (
Verified
Active
);
}
```
## As a link
Use `render={}` when a label navigates to another page or section. Badge renders that anchor instead of a wrapping span, preserving `variant`, `color`, `rounded`, custom styling, hover feedback, and a visible keyboard focus ring. Without `render`, `Badge` and `Badge.Root` remain noninteractive spans.
```tsx
import { CheckCircleIcon } from "@phosphor-icons/react";
import { Badge, Stack } from "@zentara-co/zenos-ui";
function BadgeLinkExample() {
return (
}
variant="outline"
color="blue"
>
Explore appearances
} variant="soft" color="purple" rounded>
Explore shapes
);
}
```
Put native anchor props such as `href`, `target`, `rel`, `download`, and `aria-current` on the element passed to `render`. Base UI merges its classes, styles, event handlers, and ref with Badge's props. Use `Badge.Icon` for decorative icons inside a link. For a new tab, pair `target="_blank"` with `rel="noopener noreferrer"` and make that behavior clear in the link text.
You can also pass your router's link component through `render`, provided it forwards props and its ref to the underlying anchor. A render callback is supported when you need to construct the element yourself; spread the supplied props onto that element so styling, accessibility attributes, and refs are preserved.
## Custom styling
Like [Button](/components/button/#custom-styling), Badge accepts your own appearance through the usual `className` prop. You do not need to supply `variant`, `color`, or `variantClassName`. Your classes apply last and override conflicting built-in styles while keeping the base layout, icon sizing, and native behavior.
Define the background, border, foreground, shape, and spacing you want to replace, using semantic tokens for theme-aware colors. Layout-only classes keep the default appearance, and native `style` props remain available. Built-in `variant` and `color` props are optional conveniences, not requirements for custom styling.
```tsx
import { Badge, Stack } from "@zentara-co/zenos-ui";
function CustomBadgeVariantExample() {
const campaignBadgeClassName =
"rounded-full border-transparent bg-background-accent-purple-bolder-hover px-3 text-text-contrary";
return (
Campaign
Ready
);
}
```
The same `className` approach works with `render` links. Share a class string or an application CSS class when you want to reuse a custom appearance.
For a compact uppercase category label, use [Status Pill](/components/status-pill/).
## Anatomy
```text
Badge
Badge.Root
Badge.Link
Badge.Icon
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| className | string | — | Custom styling and instance overrides. No variant or color prop is required. |
| render | ReactElement \| ((props, state) => ReactElement) | — | Replace the default span with an anchor or router link. Base UI merges props, handlers, and refs. |
| rounded | boolean | false | Fully rounded corners when true; regular corners when false. |
| variant | BadgeVariant | default | default, outline, solid, soft, or a consumer-owned appearance name. |
| variantClassName | string | — | Optional classes for existing named-variant integrations. Use className for custom styling. |
| color | BadgeColor | neutral | Semantic intent or named color palette, independent of appearance. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
| href | string | — | Navigation destination on the anchor passed to render. Also supported by Badge.Link. |
| anchor props | AnchorHTMLAttributes | — | Badge.Link forwards native anchor attributes and an HTMLAnchorElement ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Badge renders a native `span` by default, not an interactive control or an automatic live region. When using `render` with a link, supply an `href` and descriptive link text, and keep its keyboard focus indicator visible. Do not nest interactive elements inside it or use it for actions that belong on a button. Keep text concise and do not rely on color alone to communicate meaning. Use `role="status"` on a noninteractive label only when the content actually needs a polite live announcement.
Source: https://zenos-ui.pages.dev/components/badge/
---
# Breadcrumb
A semantic navigation trail for hierarchical locations.
A semantic navigation trail for hierarchical locations.
```tsx
import { Breadcrumb } from "@zentara-co/zenos-ui";
function BreadcrumbExample() {
return (
HomeComponentsBreadcrumb
);
}
```
## Import
```tsx
import { Breadcrumb } from "@zentara-co/zenos-ui";
```
## Collapsed path
Use `Breadcrumb.Ellipsis` to summarize intermediate levels while keeping the root and current page visible.
```tsx
import { Breadcrumb } from "@zentara-co/zenos-ui";
function BreadcrumbCollapsedExample() {
return (
HomeAtlasActivity
);
}
```
## Custom separators
Pass text or an icon to `Breadcrumb.Separator`. Separators remain decorative and are hidden from assistive technology.
```tsx
import { Breadcrumb, Stack } from "@zentara-co/zenos-ui";
function BreadcrumbSeparatorExample() {
return (
Workspace/Settings/MembersWorkspace·Settings·Members
);
}
```
## Long content
Breadcrumbs wrap by default so the full hierarchy remains available in narrow containers and at high zoom.
```tsx
import { Breadcrumb } from "@zentara-co/zenos-ui";
function BreadcrumbLongContentExample() {
return (
Investigations
Quarterly access review for international workspaces
Findings
);
}
```
## Custom styling
Every compound part accepts `className`, so the list surface, ancestor links, separators, and current page can use a custom treatment. Keep `Breadcrumb.Page` for the current location so visual styling does not replace its built-in `aria-current="page"` semantics.
```tsx
import { Breadcrumb } from "@zentara-co/zenos-ui";
function BreadcrumbCustomStylingExample() {
return (
Workspace
Projects
Atlas
);
}
```
## Anatomy
```text
Breadcrumb.Root
Breadcrumb.List
Breadcrumb.Item
Breadcrumb.Link
Breadcrumb.Page
Breadcrumb.Separator
Breadcrumb.Ellipsis
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| as | ElementType | a | Polymorphic element for Breadcrumb.Link. |
| label | string | More | Accessible label for Ellipsis. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Breadcrumb renders a labeled `nav` containing an ordered list. Use links for ancestor levels and `Breadcrumb.Page` only for the current location so it receives `aria-current="page"`. Separators are decorative and excluded from the accessibility tree.
Source: https://zenos-ui.pages.dev/components/breadcrumb/
---
# Bubble
A composable conversation surface for messages, suggestions, and reactions.
Bubble presents short conversational content without owning the surrounding chat model. Keep avatars, sender names, timestamps, delivery state, and message-level actions in the parent interface.
```tsx
import { Bubble } from "@zentara-co/zenos-ui";
function BubbleExample() {
return (
The deployment is ready for review.I also attached the accessibility report.Looks good. Ship it.👍🔥👀+2
);
}
```
## Import
```tsx
import { Bubble } from "@zentara-co/zenos-ui";
```
## Composition
Compose `Bubble.Content` inside a root Bubble. Use `Bubble.Group` for consecutive messages from the same sender and `Bubble.Reactions` for a compact reaction or quick-action row.
```tsx
The report is ready.👍
```
Reactions overlap the selected bubble edge. Leave enough space between conversation rows when reactions are present.
## Actions
Place any custom control inside `Bubble.Actions` to attach it to the logical end of the bubble. Actions default to `visibility="hover"`: they appear on hover or keyboard focus on pointer devices and remain available on devices without hover. Use `visibility="always"` for persistent controls. The slot accepts dropdown menus, emoji-picker triggers, buttons, or any other element without owning its behavior.
```tsx
import { DotsThreeVerticalIcon, PlusIcon } from "@phosphor-icons/react";
import { Bubble, DropdownMenu, IconButton, Stack } from "@zentara-co/zenos-ui";
function BubbleActionsExample() {
return (
}
>
ReplyCopy messageDeleteHover or focus this message to reveal its menu.This reaction action always stays visible.
);
}
```
## Variants
Use `default` for a strong current-user message, `secondary` for standard conversation content, `muted` for supporting information, `tinted` for quiet brand emphasis, `outline` for bordered rich content, `ghost` for unframed assistant output, and `destructive` for failed or unsafe results.
```tsx
import { Bubble, Stack } from "@zentara-co/zenos-ui";
function BubbleVariantsExample() {
return (
Default — strong current-user emphasis.Secondary — standard conversation content.Muted — quiet supporting information.Tinted — subtle brand emphasis.Outline — bordered rich content.Ghost — unframed assistant text that can use the full row.Destructive — the deployment failed validation.
);
}
```
### Custom variant
Use any stable custom `variant` name with `variantClassName` to define a consumer-owned content treatment. The name is exposed through `data-variant`, while Zenos preserves Bubble layout, alignment, reactions, and native content behavior.
```tsx
import { Bubble } from "@zentara-co/zenos-ui";
function BubbleCustomVariantExample() {
return (
Campaign launch is ready for review.
);
}
```
## Alignment and RTL
Set `align="start"` or `align="end"` on each Bubble. Alignment and reaction placement use logical CSS edges, so the same composition mirrors automatically inside `DirectionProvider direction="rtl"` or an RTL document.
## Interactive content
`Bubble.Content` defaults to a `div`. Use `as="button"` or `as="a"` when the complete surface performs an action or navigates. Native props and refs follow the selected element, and Zenos supplies a visible keyboard focus ring.
```tsx
import { Bubble, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function BubbleInteractiveExample() {
const [choice, setChoice] = useState("No option selected.");
return (
How should I handle the failed deployment?
{["Retry the deployment", "Open the build log", "Notify the release owner"].map(
(option) => (
setChoice(option)}>
{option}
),
)}
{choice}
);
}
```
## Variants
default, secondary, muted, tinted, outline, ghost, destructive
## Anatomy
```text
Bubble.Root
Bubble.Group
Bubble.Actions
Bubble.Content
Bubble.Reactions
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | BubbleVariant \| custom string | default | Semantic surface treatment for the bubble content. |
| variantClassName | string | — | Consumer-owned classes applied to Bubble.Content for a custom variant. |
| align | start \| end | start | Logical inline alignment of the bubble within its conversation row. |
| Actions.visibility | hover \| always | hover | Reveals custom end actions on hover and focus or keeps them visible. |
| Content.as | ElementType | div | Renders content as a semantic element such as a button or link. |
| Reactions.side | top \| bottom | bottom | Bubble edge overlapped by the reaction row. |
| Reactions.align | start \| end | start | Logical position of reactions along the selected edge. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Bubble is a presentational surface rather than a complete chat transcript. Put conversation semantics such as `role="log"`, sender context, and live-region behavior on the surrounding interface. Give every interactive control inside `Bubble.Actions` an accessible name; hover-only actions are also revealed by keyboard focus. When reactions are decorative summaries, group them with `role="img"` and a descriptive `aria-label`; when they are actions, render labeled buttons instead. Destructive meaning must also be stated in text rather than communicated by color alone.
Source: https://zenos-ui.pages.dev/components/bubble/
---
# Button Group
A spaced group of frequently performed, related actions.
A button group displays multiple related actions together while each button keeps its own shape, size, state, and native keyboard behavior.
```tsx
import { Button, ButtonGroup } from "@zentara-co/zenos-ui";
function ButtonGroupExample() {
return (
SubmitCancel
);
}
```
## Shared and custom variants
Set `variant` once on the group to pass it to buttons and icon buttons that do not choose their own variant. Add `variantClassName` for a consumer-owned appearance; an explicitly styled child still overrides the group.
```tsx
import { PlusIcon } from "@phosphor-icons/react";
import { Button, ButtonGroup, IconButton } from "@zentara-co/zenos-ui";
const campaignButtonVariant =
"rounded-full bg-background-accent-purple-bolder-default text-text-contrary hover:bg-background-accent-purple-bolder-hover active:bg-background-accent-purple-bolder-pressed";
function ButtonGroupCustomVariantExample() {
return (
LaunchPreview
);
}
```
## Import
```tsx
import { ButtonGroup } from "@zentara-co/zenos-ui";
```
## Anatomy
```text
ButtonGroup.Root
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | ButtonVariant \| custom string | default | Visual treatment inherited by buttons without an override. |
| variantClassName | string | — | Variant classes inherited by buttons using the group variant. |
| label | string | — | Accessible group name used when aria-label is omitted. |
| aria-label | string | — | Accessible group name. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
`ButtonGroup` renders an accessible group but does not replace the keyboard behavior of its children. Each enabled button remains in the native tab order. Give the group a concise `label` or `aria-label`, keep button labels specific, and provide an accessible name for every icon-only control.
Use [SplitButton](/components/split-button/) when one primary action and its secondary menu action should appear as one connected control.
Source: https://zenos-ui.pages.dev/components/button-group/
---
# Card
A compound surface for grouped content and actions.
A compound surface for grouped content and actions.
```tsx
import { Card, Stack } from "@zentara-co/zenos-ui";
function CardPreviewExample() {
return (
Workspace12 active membersSecurity score94 of 100
);
}
```
## Import
```tsx
import { Card } from "@zentara-co/zenos-ui";
```
## Anatomy
Use the parts only when the layout needs them. `Card.Header` groups title and description; `Card.Action` aligns trailing controls in the header row.
```tsx
{/* photo or video */}Workspace12 active members{/* optional */}{/* body */}{/* actions */}
```
## Variants
The default surface uses the neutral card fill (`background-neutral-card`), default border, and `rounded-lg` corners. Title and description use `type-body-l` medium and `type-body-s` regular text.
`variant="grey"` applies accent gray subtlest fill and a muted border—use it for secondary metrics, nested groups, or quieter dashboards without changing the internal spacing.
Use `variant="white"` for a white surface in light mode that matches the default card background in dark mode. It uses `background-default` in light mode and `background-neutral-card` in dark mode, with text and icons following the active theme. ClickableCard and SelectableCard share this variant; their hover, pressed, selected, and disabled treatments still apply.
```tsx
import { Card, Stack } from "@zentara-co/zenos-ui";
type CatalogVariantProps = { limit?: number };
const limited = (items: readonly T[], limit?: number) =>
limit === undefined ? items : items.slice(0, limit);
function CardVariantsExample({ limit }: CatalogVariantProps = {}) {
return (
{limited(["default", "grey", "white"] as const, limit).map((variant) => (
{variant}
{variant === "default"
? "Neutral card fill with default border."
: variant === "white"
? "White in light mode; dark in dark mode."
: "Subtle gray fill for quieter grouped surfaces."}
))}
);
}
```
## Composition
Compose headers, supporting text, content, and actions only when the card needs them. Comfortable density uses spacing 4 on every outer edge (`px-4`, `pt-4`, and `pb-4`), while adjacent regions meet without duplicate padding. A header followed by content keeps `pb-4` (`pb-3` at compact density). A header-only card keeps the same balanced inset.
```tsx
import { Button, Card, Text } from "@zentara-co/zenos-ui";
function CardCompositionExample() {
return (
Security postureLast evaluated 8 minutes ago18 controls passed and two need review.
Review findings
Dismiss
);
}
```
## Media
`Card.Media` frames a photo or video inside the card. A 4px inset on the sides, and on the edge that meets the card, is tighter than the copy padding, so the picture reads as framed. The frame radius is the card radius minus that inset and the card border, which keeps the corners concentric. Put overlay badges inside the frame so they anchor to the picture. The frame is `aspect-video`. Pass another ratio with `className`. The image or video is a direct child and fills the frame.
```tsx
import { Badge, Button, Card, Stack } from "@zentara-co/zenos-ui";
function CardMediaExample() {
return (
Best seller
Interior kit48 rooms, 6 moods, every one editable.
View kit
Mountain retreatMedia can close the card too.
);
}
```
## Density
Card supports `density="comfortable | compact"` and inherits the nearest `DensityProvider` when the prop is omitted. Compact density reduces region padding and title scale without changing the selected surface or radius. Buttons and inputs nested in the card inherit the same preset unless they set an explicit `size`.
See the [Density foundation](/foundations/density/) for comparison and provider examples.
## Custom styling
Pass `className` on `Card` (or `Card.Root`) to replace the surface, border, or layout. Prefer semantic tokens so light and dark themes stay coherent. Override title or description color on `Card.Title` and `Card.Description` when the root uses a tinted fill.
Layout-only utilities such as `max-w-md` or `w-full` leave the built-in variant untouched. Custom classes merge last on the root.
```tsx
import { Card, Text } from "@zentara-co/zenos-ui";
function CardCustomExample() {
return (
Quarterly campaign
Three audiences and 24 published assets.
Override the root surface with semantic tokens; header spacing and title scales stay the
same.
);
}
```
## Card or another component
Use [ClickableCard](/components/clickable-card/) when the whole surface should activate one action or link. Use [SelectableCard](/components/selectable-card/) for checkbox or radio selection inside forms. Keep static summaries and read-only metrics on `Card`.
## Anatomy
```text
Card.Root
Card.Header
Card.Title
Card.Description
Card.Action
Card.Content
Card.Media
Card.Footer
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| grey \| white | default | Default uses neutral card fill; grey uses accent gray subtlest fill; white uses background-default and follows the active theme. |
| density | comfortable \| compact | comfortable | Controls Card spacing and title scale. Inherits from the nearest DensityProvider when omitted. |
| tooltip | ReactNode | — | Optional information tooltip on Card.Title. |
| Media className | string | — | Merged last on Card.Media. The frame is aspect-video; pass another ratio here. |
| className | string | — | Merged last on the root. Use semantic tokens to replace surface and border while keeping internal spacing. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
`Card` is a structural `div` and does not add interaction semantics. Use headings in a logical order, keep action labels meaningful, and use `ClickableCard` or `SelectableCard` when the whole surface needs to be interactive.
Source: https://zenos-ui.pages.dev/components/card/
---
# Clickable Card
A keyboard-accessible card that behaves as one action.
A keyboard-accessible card that behaves as one action.
```tsx
import { ClickableCard, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function ClickableCardExample() {
const [lastOpened, setLastOpened] = useState("None");
return (
setLastOpened("Workspace")}
>
WorkspaceView project activity. setLastOpened("Audit log")}
>
Audit logReview security events. setLastOpened("Reports")}
>
ReportsBrowse saved reports.Compliance reportAvailable after the first scan.
Last opened: {lastOpened}
);
}
```
## Import
```tsx
import { ClickableCard } from "@zentara-co/zenos-ui";
```
## Anatomy
ClickableCard reuses the Card compound parts, including `ClickableCard.Media`. A visually hidden native button (or link when `href` is set) owns activation; clicking the card surface forwards to that control unless the event target is another interactive element.
```tsx
{/* photo or video */}WorkspaceView project activity.
```
## Media
`ClickableCard.Media` uses the same inset frame as [Card.Media](/components/card/#media). The card stays one action, so leave buttons out of the frame. A badge laid over the picture is decorative and still activates the card.
```tsx
import { Badge, ClickableCard, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function ClickableCardMediaExample() {
const [lastOpened, setLastOpened] = useState("None");
return (
setLastOpened("Interior kit")}
>
Best seller
Interior kit
48 rooms, 6 moods, every one editable.
setLastOpened("Mountain retreat")}
>
Mountain retreatMedia can close the card too.
Last opened: {lastOpened}
);
}
```
## Variants and states
`variant` accepts the same values as [Card](/components/card/): `default` (neutral card fill), `grey` (accent gray subtlest fill), and `white`. White cards use `background-default` in light mode and match the default card's `background-neutral-card` in dark mode. Hover and press use the active theme's gray fills.
Disabled cards use muted background and border, `opacity-50`, and muted title and description text. They expose `aria-disabled` and cannot be activated.
The preview above shows default, grey, and white cards plus a disabled example.
## Link card
Provide `href` when activation represents navigation. The hidden control becomes a native link with your `label` as its accessible name, while visible content keeps the Card layout.
```tsx
import { ClickableCard } from "@zentara-co/zenos-ui";
function ClickableCardLinkExample() {
return (
Workspace documentationNavigate using native link semantics.Open the API reference on this page.
);
}
```
## Custom styling
Add `className` on the root to define your own surface, border, and hover or active fills. Classes merge after the built-in interactive styles, so you can replace default hover colors with token-based utilities such as `hover:bg-background-accent-teal-subtlest-hover`.
Style `ClickableCard.Title` and `ClickableCard.Description` when the root uses a strong accent fill. Focus ring and keyboard activation behavior are unchanged.
```tsx
import { ClickableCard } from "@zentara-co/zenos-ui";
function ClickableCardCustomExample() {
return (
undefined}
>
Campaign workspace
Custom hover and press fills on the root replace the default neutral treatment.
);
}
```
## ClickableCard or another component
Use ClickableCard for a single primary action or navigation target on the card surface. Use [SelectableCard](/components/selectable-card/) when users toggle or choose among options. Use [Card](/components/card/) for read-only content.
## Anatomy
```text
ClickableCard.Root
ClickableCard.Header
ClickableCard.Title
ClickableCard.Description
ClickableCard.Action
ClickableCard.Content
ClickableCard.Media
ClickableCard.Footer
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| label | string | — | Accessible name for the card's primary action. |
| href | string | — | Uses native link semantics for the primary action. |
| onClick | MouseEventHandler | — | Runs for pointer, Enter, and Space activation. |
| disabled | boolean | false | Prevents activation and applies muted, reduced-opacity styling. |
| variant | default \| grey \| white | default | Card surface; hover and press fills match the chosen variant. |
| className | string | — | Merged last on the root. Override surface, border, and hover or active fills with semantic tokens. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
`label` names the card's primary button or link for assistive technology. Use `href` for navigation and `onClick` for an action. Nested controls remain independently interactive and do not activate the card. Disabled cards expose `aria-disabled` and cannot be activated.
Source: https://zenos-ui.pages.dev/components/clickable-card/
---
# Code Block
A readable, copyable source-code surface with optional tokenization.
Code Block displays source, terminal output, logs, and diffs. Use the automatic API for a concise highlighted block or compose its parts when the header, actions, lines, and footer need application-specific controls.
```tsx
import { CodeBlock } from "@zentara-co/zenos-ui";
function CodeBlockExample() {
return (
);
}
```
## Import
```tsx
import {
CodeBlock,
CodeBlockActions,
CodeBlockContent,
CodeBlockCopyButton,
CodeBlockFooter,
CodeBlockHeader,
CodeBlockLine,
CodeBlockTitle,
} from "@zentara-co/zenos-ui";
```
## Composition
Use `CodeBlock.Header` for a title and persistent actions. `CodeBlock.Content` is keyboard-focusable and always reads left to right, while the header continues to follow the document direction.
```tsx
import { CodeBlock } from "@zentara-co/zenos-ui";
const codeBlockTerminalOutput = `$ pnpm build
> zenos build
✓ Compiled successfully
✓ Generated component documentation`;
function CodeBlockCompositionExample() {
return (
Terminal{codeBlockTerminalOutput}
Completed in 1.8s
);
}
```
```tsx
Terminal{output}Completed
```
Passing `code`, `language`, and the existing display props remains the shortest way to render tokenized source. Consumer code can migrate to composition only when it needs the additional slots.
## Actions and wrapping
Place `CodeBlock.Actions` directly under the root to float it at the logical top end. Floating actions appear on hover, keyboard focus, and touch devices. Wrapping is controlled so applications can connect it to any button or preference.
```tsx
import { Button, CodeBlock } from "@zentara-co/zenos-ui";
import { useState } from "react";
function CodeBlockActionsExample() {
const [wrap, setWrap] = useState(false);
const output =
"Error: The generated response exceeded the available context window. Remove older messages or summarize the conversation before trying again.";
return (
setWrap((current) => !current)}
>
Wrap
{output}
);
}
```
## Line numbers and diffs
For plain string content, set `lineNumbers` and optionally `startLine` on `CodeBlock.Content`. For per-line emphasis, compose `CodeBlock.Line` with `variant="highlighted"`, `"added"`, or `"removed"`. Diff markers and line numbers are excluded from text selection.
```tsx
import { CodeBlock } from "@zentara-co/zenos-ui";
function CodeBlockDiffExample() {
return (
components/greeting.tsx
{"return
Hello, {name}
;"}
{'return
Hello, {name}!
;'}
{"// Keep the new greeting compact."}
);
}
```
## Automatic line numbers and highlights
Use line numbers for source references and `highlightLines` to direct attention to a specific change.
```tsx
import { CodeBlock } from "@zentara-co/zenos-ui";
const codeBlockSample = `type Finding = {
id: string;
severity: "low" | "high";
};
const finding: Finding = {
id: "F-1042",
severity: "high",
};`;
function CodeBlockHighlightedExample() {
return (
);
}
```
## Sizes
The `sm`, `md`, and `lg` sizes change the code type scale and line height.
```tsx
import { CodeBlock, Stack } from "@zentara-co/zenos-ui";
function CodeBlockSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
))}
);
}
```
## Containers
`card` provides complete surface chrome. `section` removes the outer border and background for embedding in an existing surface.
```tsx
import { CodeBlock, Stack } from "@zentara-co/zenos-ui";
function CodeBlockContainersExample() {
return (
);
}
```
## Long content
Wrap long lines when horizontal scrolling would interrupt the surrounding layout. Collapsible blocks keep lengthy examples compact while preserving an accessible disclosure control.
```tsx
import { CodeBlock, Stack } from "@zentara-co/zenos-ui";
function CodeBlockLongContentExample() {
const longCode = Array.from(
{ length: 12 },
(_, index) => `const rule${index + 1} = evaluateControl("security-control-${index + 1}");`,
).join("\n");
return (
);
}
```
Use a `max-h-*` and `overflow-y-auto` class on composed `CodeBlock.Content` when a log needs a fixed height. Put a show-more control in `CodeBlock.Footer` when expanding content is more appropriate than an inner scrollbar.
## Destructive output
Set `variant="destructive"` on the root for failed commands, stack traces, or other error output. The treatment uses semantic danger tokens in both light and dark themes.
## RTL
The header and floating actions use logical positioning and follow the page direction. Code content always uses `dir="ltr"` so source, terminal output, and line gutters retain their expected reading order.
## Anatomy
```text
CodeBlock.Root
CodeBlock.Header
CodeBlock.Title
CodeBlock.Actions
CodeBlock.CopyButton
CodeBlock.Content
CodeBlock.Line
CodeBlock.Footer
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| code | string | — | Source rendered in the block. |
| children | ReactNode | — | Composable header, actions, content, lines, and footer. |
| variant | default \| destructive | default | Semantic surface treatment for ordinary or failed output. |
| language | string | plaintext | Language label and tokenizer hint. |
| title | string | — | Optional header title. |
| size | sm \| md \| lg | md | Code type scale. |
| hasLanguageLabel | boolean | true | Shows the normalized language name in the header. |
| hasLineNumbers | boolean | false | Shows line-number gutter. |
| hasCopyButton | boolean | true | Shows the copy action. |
| highlightLines | number[] | [] | One-based line numbers to emphasize. |
| onCopy | () => void | — | Runs after the source is copied successfully. |
| container | card \| section | card | Outer chrome. |
| Content lineNumbers / startLine | boolean / number | false / 1 | Numbers composed string content from the requested first line. |
| Content wrap | boolean | false | Wraps composed output instead of scrolling it horizontally. |
| Line variant | default \| highlighted \| added \| removed | default | Emphasizes a line or renders it as part of a diff. |
| isWrapped / isCollapsible | boolean | false | Long-line and long-snippet behavior. |
| collapsibleThreshold | number | 10 | Minimum line count before the collapse control appears. |
| maxHeight / width | number \| string / string | — | Constrains the scroll pane height and root width. |
| highlightMode | auto \| ranges \| spans | auto | Identifies how highlighting metadata is interpreted. |
| tokenizer | CodeBlockTokenizer | — | Optional syntax tokenizer. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Code is rendered with native `pre` and `code` elements. The scrollable content is keyboard-focusable, line numbers and diff markers are hidden from assistive technology, and copy controls announce both “Copy code” and their successful “Copied” state. Collapsible automatic blocks expose their expanded state with `aria-expanded`.
The composable behavior is informed by the [shadcn Code Block](https://ui.shadcn.com/docs/components/base/code-block) while retaining Zenos tokenization, semantic colors, sizing, and legacy convenience props.
Source: https://zenos-ui.pages.dev/components/code-block/
---
# Color Picker
Choose solid colors with an HSV area, hue and alpha controls, channel fields, presets, and composable popover support.
Color Picker provides the complete solid-color workflow in one panel. It keeps HSV as its working model while exposing HEX, RGB, and HSL fields, so switching the visible format never changes the selected color.
```tsx
import { ColorPicker, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function ColorPickerExample() {
const [color, setColor] = useState("#d31510");
return (
{color}
);
}
```
## Import
```tsx
import { ColorPicker } from "@zentara-co/zenos-ui";
```
## Controlled value
Use `value` and `onValueChange` when another owner needs the selected color. Values are normalized to six-digit HEX while opaque and eight-digit HEX when alpha is below 100%.
```tsx
const [color, setColor] = useState("#d31510");
;
```
Use `defaultValue` for an uncontrolled picker. Three- and four-digit HEX inputs are accepted and normalized.
## Formats
The format switcher changes only the visible channel fields. `onValueChange` always receives HEX, regardless of whether the person edits HEX, RGB, or HSL. Control the switcher with `format` and `onFormatChange`, or seed it with `defaultFormat`.
## Sizes and surface
`md` is the complete 324px panel. `sm` is a compact 216px panel and omits the channel field row because it does not fit comfortably at that width. Use `variant="plain"` when the picker already sits inside a card, dialog, or settings surface.
```tsx
import { ColorPicker, Stack } from "@zentara-co/zenos-ui";
function ColorPickerSizesExample() {
return (
);
}
```
## Alpha and presets
Alpha and preset colors are enabled by default. Set `showAlpha={false}` for opaque-only selection, `showPresets={false}` to remove the palette, or pass `presets` with application-owned HEX colors.
```tsx
```
## Composition
Passing children replaces the default layout. Every functional part remains connected to the root state, so parts can be dropped, reordered, or wrapped without adding visibility flags.
```tsx
import { ColorPicker } from "@zentara-co/zenos-ui";
function ColorPickerCompositionExample() {
return (
);
}
```
## Popover
The popover parts reuse Zenos Popover positioning, focus management, collision handling, and motion. The picker owns its card surface, so `ColorPicker.Content` adds positioning without drawing a second frame.
```tsx
import { ColorPicker } from "@zentara-co/zenos-ui";
import { useState } from "react";
function ColorPickerPopoverExample() {
const [color, setColor] = useState("#6366f1");
return (
} />
);
}
```
## Color utilities
The package exports `normalizeColorHex`, `hexToHsva`, `hsvaToHex`, `hsvaToRgba`, `rgbaToHsva`, `hsvaToHsla`, and `hslaToHsva` for applications that need the same conversion model outside the component.
## Variants
card, plain
## Sizes
sm, md
## Anatomy
```text
ColorPicker.Root
ColorPicker.Format
ColorPicker.Preview
ColorPicker.Area
ColorPicker.Controls
ColorPicker.HueSlider
ColorPicker.AlphaSlider
ColorPicker.Fields
ColorPicker.Swatches
ColorPicker.Popover
ColorPicker.Trigger
ColorPicker.Content
ColorPicker.TriggerSwatch
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| value | string | — | Controlled HEX color. |
| defaultValue | string | #d31510 | Initial uncontrolled HEX color. |
| onValueChange | (value: string) => void | — | Receives normalized six- or eight-digit HEX. |
| format / defaultFormat | hex \| hsl \| rgb | hex | Controlled or initial channel-field format. |
| onFormatChange | (format: ColorPickerFormat) => void | — | Runs when the visible channel format changes. |
| size | sm \| md | md | 216px compact panel or 324px complete panel. |
| variant | card \| plain | card | Draws the panel surface or inherits its surrounding surface. |
| showAlpha / showInput / showPresets | boolean | true | Includes each optional part in the default composition. |
| presets | readonly string[] | — | Application-owned HEX colors shown by the default swatch grid. |
| disabled | boolean | false | Disables the area, rails, fields, format buttons, and presets. |
| children | ReactNode | — | Replaces the default layout with a custom composition of picker parts. |
| Swatches.label | ReactNode | Colors | Renames or removes the preset section label. |
| Content side / align / offsets | Popover placement props | — | Positions the popover picker through the shared Popover behavior. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
The saturation and brightness area supports arrow keys, with Shift increasing the step. Hue and alpha use native range controls. Format and preset choices expose pressed state, every channel has an accessible name, and disabled state reaches every default interaction. Color is always returned as text rather than communicated by the swatch alone.
Source: https://zenos-ui.pages.dev/components/color-picker/
---
# Command
A searchable command palette for actions and destinations.
A searchable command palette for actions and destinations. Arrow keys move the highlight, Enter runs the active row, and focus stays in the search field.
Backed by Base UI Combobox and{" "}
Dialog for filtering, keyboard
navigation, and the modal shell. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { GearIcon, HouseIcon, LifebuoyIcon, MagnifyingGlassIcon, PlusIcon, UsersIcon } from "@phosphor-icons/react";
import { Command, InputGroup, Kbd, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
const commandActions = [
{ value: "new-project", label: "New project", keywords: ["create"] },
{ value: "invite", label: "Invite teammate" },
];
const commandIcons = {
"new-project": ,
invite: ,
dashboard: ,
account: ,
support: ,
};
function CommandDialogExample() {
const [open, setOpen] = useState(false);
const [lastRun, setLastRun] = useState("None");
return (
setOpen(true)}>
{
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
setOpen(true);
}
}}
/>
No results found.
{(action: (typeof commandActions)[number]) => (
{action.label}
)}
Last run: {lastRun}
);
}
```
## Import
```tsx
import { Command } from "@zentara-co/zenos-ui";
```
## Anatomy
`Command` is the inline palette. `Command.Dialog` renders that same palette in a modal. Pass `items` as a flat list or as groups, and render the filtered rows from `Command.List`.
```tsx
{(action) => (
{action.label}
)}
No results found.
```
Each row's searchable identity is its `value`. Add `keywords` on the item for synonyms. A row that does not match is removed, and a group with no remaining rows is removed with it. Disabled rows stay visible and drop out of keyboard navigation.
## Inline
Use `Command` directly to embed the palette in a page. It brings its own surface. Pass `icon` on `Command.Item` for a leading glyph. The shortcut hint on the search row is decorative.
```tsx
import { GearIcon, HouseIcon, LifebuoyIcon, PlusIcon, UsersIcon } from "@phosphor-icons/react";
import { Command, Kbd, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
const commandIcons = {
"new-project": ,
invite: ,
dashboard: ,
account: ,
support: ,
};
const commandGroups = [
{
label: "Create",
items: [
{ value: "new-project", label: "New project", keywords: ["create"] },
{ value: "invite", label: "Invite teammate" },
],
},
{
label: "Navigate",
items: [
{ value: "dashboard", label: "Dashboard" },
{ value: "account", label: "Account" },
{ value: "support", label: "Support", disabled: true },
],
},
];
function CommandInlineExample() {
const [lastRun, setLastRun] = useState("None");
return (
} />
Nothing matches that.
{(group: (typeof commandGroups)[number]) => (
{(action: (typeof group.items)[number]) => (
setLastRun(action.label)}
>
{action.label}
{"disabled" in action && action.disabled ? (
Offline
) : null}
)}
)}
Highlight with the arrow keys and run with Enter. Last run: {lastRun}
);
}
```
## Keyboard
The search field keeps focus. The active row is announced through `aria-activedescendant`. Arrow keys move the highlight, Enter runs the highlighted row, and the query stays as typed. Inside `Command.Dialog`, Escape closes the dialog. The Esc hint in the search row closes it too.
Open the dialog from a key binding in the application that owns the palette. ⌘K and Ctrl+K are the usual pair. The component does not listen for that shortcut itself.
```tsx
useEffect(() => {
function onKeyDown(event: KeyboardEvent) {
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
event.preventDefault();
setOpen((open) => !open);
}
}
document.addEventListener("keydown", onKeyDown);
return () => document.removeEventListener("keydown", onKeyDown);
}, []);
```
## Density
`density="comfortable | compact"` inherits the nearest `DensityProvider`. Compact tightens the search row and the action rows. Color and radius stay the same.
```tsx
import { Command, Stack, Text } from "@zentara-co/zenos-ui";
const commandActions = [
{ value: "new-project", label: "New project", keywords: ["create"] },
{ value: "invite", label: "Invite teammate" },
];
function CommandDensityExample() {
return (
{(["comfortable", "compact"] as const).map((density) => (
{density}
{(action: (typeof commandActions)[number]) => (
{action.label}
)}
))}
);
}
```
## Command or another component
Use Command for an open-ended, searchable list of actions or destinations. Use [Combobox](/components/combobox/) or [Select](/components/select/) when the person is choosing a value for a field. Use [Dropdown Menu](/components/dropdown-menu/) for a short fixed set of actions.
## Anatomy
```text
Command.Root
Command.Input
Command.List
Command.Empty
Command.Group
Command.GroupLabel
Command.Item
Command.Separator
Command.Shortcut
Command.Dialog
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| items | Item[] \| { items: Item[]; label?: string }[] | — | Flat rows or groups. A row is a string or { value, label, keywords, disabled }. |
| label | string | — | Accessible name for the search field and the result list. |
| search / defaultSearch / onSearchChange | string / string / (search: string) => void | — | The query, controlled or uncontrolled. |
| filter | (item, query) => boolean \| null | — | Return false to hide a row. Null shows every row. The default match includes label, value, and keywords. |
| onSelect | (value: string) => void | — | Runs after the chosen row's own onSelect. |
| Item.onSelect | (value: string) => void | — | Runs when that row is chosen with the pointer or Enter. |
| Item.icon | ReactNode | — | Leading icon for the row. The label stays in the children. |
| density | comfortable \| compact | comfortable | Controls the search row and item padding. Inherits from DensityProvider when omitted. |
| Dialog.open / defaultOpen / onOpenChange | boolean / boolean / (open: boolean) => void | — | Dialog open state. |
| Dialog.closeOnSelect | boolean | true | Closes the dialog after a row is chosen. |
| Dialog.title / description | string | — | Visually hidden names for the dialog. |
| className | string | — | Merged last on every part. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
`label` names the search field and the result list. Give the dialog its own `title` and `description`; both are visually hidden. Keep empty-state text meaningful, and name each group with `heading` or `Command.GroupLabel` so arrow keys can move through its rows.
Source: https://zenos-ui.pages.dev/components/command/
---
# Context Menu
A pointer and keyboard menu opened from a contextual gesture.
A pointer and keyboard menu opened from a contextual gesture.
Backed by Base UI Context Menu for
upstream behavior and configuration. Zenos owns the public API, styling, and composition shown on
this page.
```tsx
import { ContextMenu } from "@zentara-co/zenos-ui";
function ContextMenuExample() {
return (
Right-click this card
ProjectOpenRenameArchive
);
}
```
## Import
```tsx
import { ContextMenu } from "@zentara-co/zenos-ui";
```
Use Context Menu for actions associated with a specific surface. Keep important actions available elsewhere because contextual gestures are less discoverable than visible controls.
## Selection items
Checkbox items manage independent options. Radio items belong to a group and select one value.
```tsx
import { ContextMenu } from "@zentara-co/zenos-ui";
import { useState } from "react";
function ContextMenuSelectionExample() {
const [showDetails, setShowDetails] = useState(true);
const [density, setDensity] = useState("comfortable");
return (
Right-click for view options
View
Show details
DensityCompactComfortable
);
}
```
## Submenus and shortcuts
Shortcut text communicates an existing application command. It does not register the keyboard handler.
```tsx
import { ContextMenu } from "@zentara-co/zenos-ui";
function ContextMenuSubmenuExample() {
return (
Right-click for project actions
Rename ⌘RMove toDesignEngineeringOperationsArchive locked project
);
}
```
## Motion
Context menus and submenus fade, scale, and move from their resolved side when opening, then reverse that movement when closing. Reduced-motion preferences remove the animation automatically.
Right-click each card. The first menu animates in and out. `disableMotion` makes the second appear and disappear immediately.
```tsx
import { ContextMenu, Grid } from "@zentara-co/zenos-ui";
function ContextMenuMotionExample() {
return (
Right-click for motion
OpenRenameArchive
Right-click without motion
OpenRenameArchive
);
}
```
## Custom styling
Every compound part accepts `className`. Style the trigger directly, then style `ContextMenu.Content` separately because the popup is rendered in a portal. Stable `data-slot` attributes and Base UI's `data-highlighted` state can target items, labels, separators, and shortcuts without replacing menu behavior.
```tsx
import { ContextMenu } from "@zentara-co/zenos-ui";
function ContextMenuCustomStylingExample() {
return (
Right-click the project card
Project actions
Open details Enter
Duplicate ⌘DMove to archive
);
}
```
## Anatomy
```text
ContextMenu.Root
ContextMenu.Trigger
ContextMenu.Content
ContextMenu.Item
ContextMenu.CheckboxItem
ContextMenu.RadioGroup
ContextMenu.RadioItem
ContextMenu.Sub
ContextMenu.Separator
ContextMenu.Shortcut
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial uncontrolled state. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when visibility changes. |
| side / align | Base UI position values | — | Popup placement supplied on Content. |
| Content.disableMotion | boolean | false | Disables enter and exit motion on Content or SubContent. |
| checked / onCheckedChange | boolean / (checked: boolean, eventDetails) => void | — | Controls a CheckboxItem selection. |
| value / onValueChange | string / (value: string, eventDetails) => void | — | Controls the selected RadioGroup item. |
| disabled | boolean | false | Prevents an item from receiving selection. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Base UI supplies menu roles, roving focus, typeahead, disabled semantics, and dismissal. A focused trigger can open the menu with the platform context-menu key or Shift+F10; arrow keys move through items and Escape closes it. Do not make a context menu the only path to essential functionality.
Source: https://zenos-ui.pages.dev/components/context-menu/
---
# Date Input
A standalone text field for parsing and formatting dates.
A standalone text field for parsing and formatting dates.
```tsx
import { DateInput, Field } from "@zentara-co/zenos-ui";
function DateInputPreviewExample() {
return (
Start date} />
);
}
```
```tsx
import { DateInput } from "@zentara-co/zenos-ui";
```
## Sizes
DateInput uses the shared Zenos `sm`, `md`, and `lg` control scale from Input.
```tsx
import { DateInput, Stack } from "@zentara-co/zenos-ui";
function DateInputSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
))}
);
}
```
## Variants
Surfaces match Input: `default` (standard), `filled` (subtle), and `none` (borderless).
```tsx
import { DateInput, Stack } from "@zentara-co/zenos-ui";
type CatalogVariantProps = { limit?: number };
const limited = (items: readonly T[], limit?: number) =>
limit === undefined ? items : items.slice(0, limit);
const formControlSurfaceVariants = ["default", "filled", "none"] as const;
function DateInputVariantsExample({ limit }: CatalogVariantProps = {}) {
const sample = new Date(2026, 8, 24);
if (limit !== undefined) {
return (
{limited(formControlSurfaceVariants, limit).map((variant) => (
))}
);
}
return (
{formControlSurfaceVariants.map((variant) => (
))}
);
}
```
## States
Empty, filled, invalid, and disabled treatments are inherited from Input. Invalid matches Input. Compose with `Field` for labels, descriptions, and errors. DateInput also sets `invalid` when typed text fails parsing on blur.
```tsx
import { DateInput, Stack } from "@zentara-co/zenos-ui";
function DateInputStatesExample() {
return (
);
}
```
## Controlled value and validation
Valid text updates the date immediately. Invalid text remains editable and becomes invalid on blur, while clearing the control emits `undefined`.
```tsx
import { DateInput, Field, Stack, Text } from "@zentara-co/zenos-ui";
import { useState } from "react";
function DateInputControlledExample() {
const [date, setDate] = useState(new Date(2026, 8, 24));
const [invalid, setInvalid] = useState(false);
return (
Deployment date}
/>
Use YYYY-MM-DD.Enter a valid calendar date.
Value:{" "}
{date
? `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`
: "None"}
);
}
```
## Custom format and parser
Provide `format` and `parse` together when a product uses a different typed-date convention.
```tsx
import { DateInput, Field } from "@zentara-co/zenos-ui";
function DateInputCustomFormatExample() {
const format = (date: Date) =>
`${String(date.getDate()).padStart(2, "0")}/${String(date.getMonth() + 1).padStart(2, "0")}/${date.getFullYear()}`;
const parse = (text: string) => {
const match = /^(\d{2})\/(\d{2})\/(\d{4})$/.exec(text.trim());
if (!match) return undefined;
const day = Number(match[1]);
const month = Number(match[2]);
const year = Number(match[3]);
const date = new Date(year, month - 1, day);
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day
? date
: undefined;
};
return (
Local date
}
/>
Displayed and parsed as DD/MM/YYYY.
);
}
```
## Variants
default, filled, none
## Sizes
sm, md, lg
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| value | Date \| undefined | — | Controlled parsed date. |
| defaultValue | Date \| undefined | — | Initial uncontrolled date. |
| onValueChange | (date: Date \| undefined) => void | — | Runs after valid parsing or clearing. |
| variant | default \| filled \| none | default | Surface treatment inherited from Input (`default` = standard, `filled` = subtle, `none` = borderless). |
| size | sm \| md \| lg | md | Control height inherited from Input. |
| format | (date: Date) => string | — | Custom date formatter. |
| parse | (text: string) => Date \| undefined | — | Custom date parser. |
| invalid | boolean | — | Controls the invalid presentation. |
| onInvalidChange | (invalid: boolean) => void | — | Runs when validity changes, including validation on blur. |
| onChange | ChangeEventHandler | — | Runs for every text edit before parsing completes. |
| native props | React.InputHTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
DateInput remains a native text input with numeric input mode. Give it a visible Field label or another accessible name, provide format instructions in `Field.Description`, and connect validation feedback through `Field.Error`. The component preserves native `required`, `disabled`, `name`, autocomplete, and focus behavior.
Source: https://zenos-ui.pages.dev/components/date-input/
---
# Direction
Provide left-to-right or right-to-left behavior to Zenos components and hooks.
Direction connects an application's reading direction to Zenos and the underlying Base UI behavior. Use it for keyboard navigation, popup alignment, sliders, menus, and other interactions that need to distinguish logical start from logical end.
```tsx
import { ArrowRightIcon } from "@phosphor-icons/react";
import { Badge, Button, Card, DirectionProvider, Field, Input, Stack, Switch, Text, useDirection } from "@zentara-co/zenos-ui";
import { useState } from "react";
type DirectionLanguage = "en" | "ar";
const directionContent = {
en: {
direction: "ltr",
language: "en",
title: "Workspace access",
description: "Enter your details to continue to the workspace.",
email: "Email address",
remember: "Remember me",
action: "Continue",
},
ar: {
direction: "rtl",
language: "ar",
title: "الوصول إلى مساحة العمل",
description: "أدخل بياناتك للمتابعة إلى مساحة العمل.",
email: "البريد الإلكتروني",
remember: "تذكرني",
action: "متابعة",
},
} as const;
function CurrentDirection() {
const direction = useDirection();
return (
{direction.toUpperCase()}
);
}
function DirectionExample() {
const [language, setLanguage] = useState("ar");
const content = directionContent[language];
return (
setLanguage("en")}
>
English
setLanguage("ar")}
>
العربية
{content.title}{content.description}
{content.email}}
/>
{content.remember}
}>
{content.action}
);
}
```
## Import
```tsx
import { DirectionProvider, useDirection } from "@zentara-co/zenos-ui";
```
## Application direction
Set the document's native `dir` attribute and the provider direction from the same application state. The HTML attribute controls browser layout and text flow; the provider controls direction-aware component behavior.
```tsx
import { DirectionProvider } from "@zentara-co/zenos-ui";
export function App({ children }: { children: React.ReactNode }) {
return (
{children}
);
}
```
Zenos does not update `document.documentElement` automatically. The application owns language selection, persistence, server-rendered attributes, and hydration, so it should keep both values synchronized.
## Read the current direction
[`useDirection`](/hooks/use-direction/) returns the nearest provider value. Without a provider it returns `ltr`.
```tsx
import { useDirection } from "@zentara-co/zenos-ui";
function DirectionStatus() {
const direction = useDirection();
return Current direction: {direction};
}
```
Use this hook when custom interaction behavior changes with direction. Pure layout should usually rely on logical CSS properties and utilities such as `start`, `end`, `ms`, `me`, `ps`, and `pe`.
## Scoped direction
Direction can change inside a subsection without changing the entire application. Put the DOM attribute and provider on the same boundary.
```tsx
```
Use an explicit direction for interactive component trees. Reserve `dir="auto"` for isolated text whose writing direction is not known in advance.
## Portals
Place `DirectionProvider` above dialogs, menus, selects, popovers, tooltips, and other portalled components. Context keeps their positioning and keyboard behavior aligned even when the popup is mounted outside the local DOM subtree. The document-level `dir` value still controls the portal's text flow and logical CSS.
## Anatomy
```text
DirectionProvider
useDirection
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| direction | ltr \| rtl | ltr | Reading direction supplied to Zenos and Base UI behavior. |
| children | ReactNode | — | Component tree that inherits the configured direction. |
| useDirection() | () => ltr \| rtl | — | Returns the nearest provider direction, falling back to ltr. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Set a matching `lang` attribute so assistive technology uses the correct language and pronunciation. Test focus order, arrow keys, text alignment, mirrored directional icons, and popup placement in both directions. Direction alone does not translate labels or make physical `left` and `right` styles logical.
For layout guidance, directional icons, mixed-direction content, and a testing checklist, see the broader [RTL foundation guide](/foundations/rtl/).
Source: https://zenos-ui.pages.dev/components/direction/
---
# Empty State
A composed placeholder for zero data, filtered results, and first-run experiences.
Empty State explains why a collection or result region has nothing to show and, when useful, gives the user one clear next step.
```tsx
import { PlusIcon, TrayIcon } from "@phosphor-icons/react";
import { Button, EmptyState } from "@zentara-co/zenos-ui";
function EmptyStatePreviewExample() {
return (
No projects yet
Create your first project to organize tasks, files, and conversations in one place.
}>
Create project
);
}
```
## Import
```tsx
import { EmptyState } from "@zentara-co/zenos-ui";
```
## Anatomy
Compose only the parts the message needs. `EmptyState.Header` keeps the decorative media and copy on a readable measure. `EmptyState.Actions` is optional.
```tsx
{/* decorative icon */}No projects yetCreate a project to get started.{/* optional action */}
```
## Choose the right message
Use Empty State for a valid zero-data result: a new workspace, an empty inbox, or a search with no matches. Lead with the condition, explain it in one short sentence, and add an action only when there is a useful next step.
Do not use it while data is still loading; use [Skeleton](/components/skeleton/) or [Loader](/components/loader/). Use [Alert](/components/alert/) for recoverable inline feedback that should not replace the whole content region. When a failed request does replace the region, a destructive empty state may include one retry action.
## Semantic variants
The variant colors only `EmptyState.Media`. The surrounding layout, title, and description stay neutral so status color supports the message instead of becoming the entire surface. Icons are decorative and hidden from assistive technology.
```tsx
import { CheckCircleIcon, MagnifyingGlassIcon, WarningCircleIcon } from "@phosphor-icons/react";
import { EmptyState, Grid } from "@zentara-co/zenos-ui";
function EmptyStateVariantsExample() {
const states = [
{
variant: "info",
icon: ,
title: "No results",
description: "Nothing matched your current search and filters.",
},
{
variant: "destructive",
icon: ,
title: "Couldn't load projects",
description: "Check your connection, then try loading this view again.",
},
{
variant: "success",
icon: ,
title: "All caught up",
description: "There are no outstanding reviews in your queue.",
},
] as const;
return (
{states.map((state) => (
{state.icon}{state.title}{state.description}
))}
);
}
```
## Actions
Prefer one small outline action. A primary action is appropriate when the empty state is a first-run experience and the next step is unambiguous. Avoid menus or several competing calls to action; link secondary guidance from the description or the surrounding page instead.
Empty State does not own button behavior. Compose [Button](/components/button/) or [Link](/components/link/) inside `EmptyState.Actions`, preserving their native focus, disabled, and navigation behavior.
## Density
`density="comfortable"` is the default for page and panel states. `density="compact"` reduces the minimum height, padding, media size, and type scale for smaller cards, table regions, and popovers. Density also inherits from `DensityProvider`.
```tsx
import { TrayIcon } from "@phosphor-icons/react";
import { EmptyState, Grid } from "@zentara-co/zenos-ui";
function EmptyStateDensityExample() {
return (
{(["comfortable", "compact"] as const).map((density) => (
{density}
Density changes spacing and type scale without changing the message.
))}
);
}
```
## Custom styling
The root is intentionally surface-free. Add a border, background, radius, or width with `className` to match its container. Every part—`Root`, `Header`, `Media`, `Title`, `Description`, and `Actions`—accepts `as`, `className`, `style`, native attributes, event handlers, and a correctly typed ref. Each also exposes a stable `data-slot`, and local classes merge last.
`EmptyState.Media` owns its default bottom margin directly, with no hidden wrapper, so a class such as `mb-0` or `mb-6` can replace it. Use `as` when the default element does not fit the page semantics—for example, render `Title` as `h2`, `Description` as `div`, or `Actions` as `footer`. Prefer semantic tokens to keep light and dark themes aligned.
```tsx
import { PlusIcon } from "@phosphor-icons/react";
import { Button, EmptyState } from "@zentara-co/zenos-ui";
function EmptyStateCustomExample() {
return (
Build your workspace
Add teammates when you are ready. Custom classes change the presentation without changing
the compound anatomy.
Invite teammates
);
}
```
## Variants
default, primary, success, warning, info, destructive
## Anatomy
```text
EmptyState.Root
EmptyState.Header
EmptyState.Media
EmptyState.Title
EmptyState.Description
EmptyState.Actions
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| primary \| success \| warning \| info \| destructive | default | Changes the decorative media color while leaving the title, description, and layout neutral. |
| density | comfortable \| compact | comfortable | Controls minimum height, spacing, media size, and type scale. Inherits from DensityProvider when omitted. |
| as | ElementType | — | Changes the rendered element on Root, Header, Media, Title, Description, or Actions and supplies its native prop and ref types. |
| role / aria-live | native ARIA attributes | — | Opt into a live status only when an existing result region changes to an empty state. |
| className | string | — | Merged last on every part for custom surfaces, borders, dimensions, and media treatment. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
`EmptyState.Title` renders an `h3` by default; keep it in the page's heading order or change it with `as` to match the surrounding section. `EmptyState.Media` is decorative and uses `aria-hidden="true"`, so the title and description must carry the meaning.
The root has no live-region role by default. For an empty state that replaces existing search results after an interaction, keep the region mounted and add `role="status"` with `aria-live="polite"`. Do not announce a static first-run state or duplicate a nearby status message.
Source: https://zenos-ui.pages.dev/components/empty-state/
---
# File Card
A composed attachment surface for file identity, metadata, actions, upload progress, and status.
File Card represents one file with its identity, metadata, upload state, and related actions. Compose rows into attachment lists or use tiles in upload trays and media browsers.
```tsx
import { DownloadSimpleIcon, TrashIcon } from "@phosphor-icons/react";
import { FileCard, IconButton, Stack } from "@zentara-co/zenos-ui";
function FileCardPreviewExample() {
return (
research-notes.pdfPDF · 2.4 MBproduct-review.pptx
);
}
```
## Import
```tsx
import { FileCard, fileTypeFromName } from "@zentara-co/zenos-ui";
```
## When to use
Use File Card when the file itself is the object a user needs to inspect, upload, open, download, retry, or remove. It is well suited to message attachments, form uploads, import queues, and lightweight file browsers.
Use [Thumbnail](/components/thumbnail/) when the media preview is the primary object and you only need preview or remove behavior. Use [File Tree](/components/file-tree/) for hierarchical navigation. Use a standard [Card](/components/card/) when the content is not specifically a file.
## Anatomy
Use either `FileCard.Icon` for a file-type illustration or `FileCard.Thumbnail` for visual media. `Content` groups the name, metadata, and optional progress bar; status and actions remain trailing siblings so the row stays easy to scan.
```tsx
research.pdfPDF · 2.4 MB{/* icon buttons */}
```
## File illustration and thumbnail
`FileCard.Icon` provides a built-in document illustration for common file families. The [File Icons](/foundations/file-icons/) page lists every family, its tone, and the extensions `fileTypeFromName` recognizes. Derive the type from a filename with `fileTypeFromName(name)`, or set `type` explicitly when the MIME type is more reliable. Use `label` only when a product-specific extension needs a different short name.
Use `FileCard.Thumbnail` when the image itself helps someone recognize the file. Its `alt` prop is required: describe useful visual content, or use the filename when that is the clearest available label.
```tsx
import { TrashIcon } from "@phosphor-icons/react";
import { FileCard, IconButton, Stack } from "@zentara-co/zenos-ui";
function FileCardMediaExample() {
return (
moraine-lake.jpg4.8 MB · 2400 × 1600circuit-closeup.jpg2.1 MB · 3000 × 2000
);
}
```
### Derive a file type from its name
`fileTypeFromName` recognizes common document, spreadsheet, presentation, archive, image, video, audio, and source-code extensions. It normalizes letter case and returns `"default"` for an unknown or extensionless filename. Prefer a trusted MIME type when one is already available; filenames can be incomplete or misleading.
```tsx
import { FileCard, fileTypeFromName, Grid } from "@zentara-co/zenos-ui";
function FileCardFileTypesExample() {
const files = [
"research.pdf",
"project-brief.docx",
"forecast.xlsx",
"launch-deck.pptx",
"brand-assets.zip",
"component.tsx",
];
return (
{files.map((name) => (
{name}{fileTypeFromName(name)}
))}
);
}
```
```tsx
const type = fileTypeFromName(file.name);
;
```
## Content hierarchy
Keep `FileCard.Name` to the real filename, including its extension. It truncates visually in narrow rows, so preserve the complete name in the DOM and avoid shortening the underlying string.
Use one concise `FileCard.Meta` line for the information needed to distinguish the file: format, size, modified date, owner, or upload result. Put the most useful facts first and separate them consistently, for example `PDF · 2.4 MB`. Do not repeat the filename, progress percentage, or status text in the meta line.
## Upload states
Set `state` on the root so `FileCard.Progress` and `FileCard.Status` stay synchronized. Uploading shows activity, success confirms completion, and error applies a danger surface and progress color. Keep a failed upload in place so the user can identify it and retry or remove it.
`FileCard.Progress` renders its percentage by default. Set `hideValue` when `FileCard.Value` displays that number elsewhere in the row; do not announce the same percentage twice.
```tsx
import { FileCard, Stack } from "@zentara-co/zenos-ui";
function FileCardStatesExample() {
return (
launch-film.mp442%forecast.xlsxUpload complete · 940 KBsource-files.zip
);
}
```
For a live upload, keep `value` between 0 and 100 and update the same mounted card instead of replacing it on every tick. Move to `state="success"` only after the server confirms completion. For an error, replace progress detail with an actionable reason when available and place retry or remove controls in `FileCard.Actions`.
## Layout, density, and variants
The default `layout="row"` is best for attachment lists and form uploads. Use `layout="tile"` when previews are the primary scanning cue. `density="compact"` reduces the card and media dimensions for dense trays; when omitted, density inherits from `DensityProvider`.
Choose `default` for most product surfaces, `outline` for flatter groups, `elevated` when the file needs stronger separation, and `ghost` when a surrounding container already provides the surface.
Use `variant="white"` for a white attachment surface in light mode and the default card background in dark mode. It uses `background-default` in light mode and `background-neutral-card` in dark mode, with names, metadata, icons, and status text following the active theme. Error-state styling takes precedence over this fill.
```tsx
import { FileCard, Grid } from "@zentara-co/zenos-ui";
function FileCardVariantsExample() {
return (
{(["default", "outline", "elevated", "ghost", "white"] as const).map((variant) => (
{variant} surfaceDocument · 620 KB
))}
);
}
```
## Interaction model
Keep the root non-interactive when it contains download, remove, overflow, or retry controls in `FileCard.Actions`. This preserves separate keyboard targets and clear action names.
When the whole card has exactly one destination, render it as a native link with `as="a"`, provide `href`, and set `interactive`. Do not nest buttons or links inside an interactive root.
```tsx
import { ArrowRightIcon, DownloadSimpleIcon, TrashIcon } from "@phosphor-icons/react";
import { FileCard, IconButton, Stack } from "@zentara-co/zenos-ui";
function FileCardInteractionExample() {
return (
accessibility-audit.pdfOpen file · PDF · 1.8 MBmeeting-notes.docxDOCX · 340 KB
);
}
```
### Actions
Prefer icon buttons for familiar, repeated actions in attachment lists. Give every icon-only action a file-specific accessible name such as “Download research notes” rather than “Download.” Keep destructive removal separate from opening the file, and confirm removal only when recovery is difficult or the effect extends beyond the current draft.
Avoid hiding essential actions only on hover. Touch, keyboard, zoomed, and reduced-pointer interfaces must retain a discoverable way to reach them.
## Responsive behavior
Rows should remain the default on narrow screens. Let the filename and metadata truncate while media, status, and actions keep their usable size. When a row cannot accommodate several trailing controls, move secondary actions into a labeled overflow menu rather than shrinking the touch targets.
For tile collections, let the parent grid decide the column count. File Card owns its internal tile layout, not the width of the collection.
## Custom styling
Every part exposes a stable `data-slot`, and `className` merges last. Prefer semantic surface, border, text, and icon tokens so customization remains legible in light and dark themes.
```tsx
import { DownloadSimpleIcon } from "@phosphor-icons/react";
import { FileCard, IconButton } from "@zentara-co/zenos-ui";
function FileCardCustomExample() {
return (
tokens.jsonJSON · Updated just now
);
}
```
## Variants
default, outline, elevated, ghost, white
## Anatomy
```text
FileCard.Root
FileCard.Icon
FileCard.Thumbnail
FileCard.Content
FileCard.Name
FileCard.Meta
FileCard.Value
FileCard.Actions
FileCard.Progress
FileCard.Status
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| outline \| elevated \| ghost \| white | default | Surface treatment for the file attachment. |
| layout | row \| tile | row | Horizontal attachment row or vertical media tile. |
| state | idle \| uploading \| success \| error | idle | Upload lifecycle consumed by Progress and Status. |
| density | comfortable \| compact | comfortable | Controls spacing and media size. Inherits from DensityProvider when omitted. |
| interactive | boolean | false | Adds focus, hover, and pointer affordances for an interactive root. |
| as | ElementType | div | Renders the root as a semantic element such as an anchor or button. |
| Icon.type | default \| pdf \| document \| spreadsheet \| presentation \| archive \| image \| video \| audio \| code | default | File family controlling the built-in illustration label and semantic tint. |
| Icon.label | string | — | Overrides the short extension label in the built-in illustration. |
| Thumbnail.alt | string | — | Required alternative text for an image thumbnail. |
| Progress.value | number | — | Upload percentage, clamped visually between 0 and 100. |
| Progress.label / hideValue | ReactNode / boolean | Uploading / false | Progress caption and control for the internal percentage label. |
| Status.status | idle \| uploading \| success \| error | — | Overrides the nearest root state. Idle renders nothing. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Use a real button or link for each action and give icon-only controls a specific accessible name such as “Download research notes.” `FileCard.Status` includes polite status text for the current lifecycle state, while `FileCard.Progress` exposes native progressbar semantics and the current numeric value.
The built-in file illustration is decorative because the filename carries the identity. Image thumbnails require useful alternative text. Avoid making a card interactive when its content already contains controls, and keep visible focus on whole-card links or buttons.
## Review checklist
Before shipping a File Card experience, verify:
- [ ] The complete filename and extension remain available to users.
- [ ] Metadata is concise and does not repeat the filename or progress value.
- [ ] The illustration type comes from a trusted MIME type or a safely derived extension.
- [ ] Meaningful thumbnails have accurate alternative text.
- [ ] Upload progress has one visible percentage and a useful label.
- [ ] Success appears only after the upload is confirmed.
- [ ] Failed files remain identifiable and offer an appropriate retry or removal path.
- [ ] Whole-card interaction uses a native link or button and contains no nested controls.
- [ ] Separate icon actions have file-specific accessible names.
- [ ] Keyboard focus remains visible in light and dark themes.
- [ ] Narrow layouts preserve readable content and usable action targets.
Source: https://zenos-ui.pages.dev/components/file-card/
---
# File Tree
Nested folders and files with disclosure carets and indented children.
File Tree presents a small explorer hierarchy. A folder discloses its children. A file is a label in that hierarchy.
```tsx
import { FileTree, Stack, Text } from "@zentara-co/zenos-ui";
function FileTreeExample() {
return (
Explorer
);
}
```
## Import
```tsx
import { FileTree } from "@zentara-co/zenos-ui";
```
## Composition
```tsx
```
```text
FileTree.Root
├── FileTree.Folder
│ ├── FileTree.File
│ └── FileTree.Folder
└── FileTree.File
```
Folders may be empty. Nesting is the children of `FileTree.Folder`, so a closed folder hides every row inside it.
## Icons
Each row includes a folder or file glyph. Pass `icon` to replace that glyph with your own, or `icon={null}` to remove it. The disclosure caret stays on the folder trigger.
## Open state
`defaultOpen` sets the initial uncontrolled state. Use `open` and `onOpenChange` when another part of the interface must read or drive a folder. `disabled` keeps the folder visible and prevents it from opening.
## Anatomy
```text
FileTree.Root
FileTree.Folder
FileTree.File
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| Folder.label | ReactNode | — | Folder name and trigger label. |
| Folder.icon | ReactNode \| null | — | Replaces the folder glyph. null removes it. |
| Folder.defaultOpen | boolean | false | Initial uncontrolled open state. |
| Folder.open | boolean | — | Controlled open state. |
| Folder.onOpenChange | (open: boolean, eventDetails) => void | — | Runs when the folder opens or closes. |
| Folder.disabled | boolean | false | Keeps the folder closed and prevents activation. |
| File.label | ReactNode | — | Visible file name. |
| File.icon | ReactNode \| null | — | Replaces the file glyph. null removes it. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
A folder trigger is a button and exposes `aria-expanded`. Enter and Space toggle it. File rows are text, not controls, so they are not in the tab order. Decorative glyphs are hidden from assistive technology. Motion-reduction preferences disable the caret rotation and the height transition.
Use [Collapsible](/components/collapsible/) when the region is a single disclosure rather than a file hierarchy.
Source: https://zenos-ui.pages.dev/components/file-tree/
---
# Item
A composable content row for media, titles, descriptions, metadata, and actions.
Item presents a compact piece of content with optional media and actions. Use it for settings rows,
resource summaries, navigation destinations, and other content that is smaller than a Card but does
not have form-control semantics.
```tsx
import { ShieldPlusIcon } from "@phosphor-icons/react";
import { Button, Item } from "@zentara-co/zenos-ui";
function ItemExample() {
return (
Workspace protection is activeSecurity scans run automatically before every release.
Review
);
}
```
## Import
```tsx
import { Item } from "@zentara-co/zenos-ui";
```
## Composition
Build an Item from only the parts the content needs.
```tsx
Account...Profile verifiedYour identity check is complete....Updated today
```
`Item.Header` and `Item.Footer` occupy full rows. Media, content, and actions share the middle row,
and long titles or descriptions shrink without pushing actions outside the container.
## Item or Field
Use [Field](/components/field/) when the composition contains an input, checkbox, radio, select, or
validation message. Use Item for descriptive content and related actions. Item does not provide a
label relationship, validation state, or form semantics.
## Variants
`default` stays transparent, `outline` creates a bounded surface, and `muted` gives secondary
content a quiet background. `white` adds a bordered surface using `background-default`: white in light mode and dark in dark mode. Text and icons follow the active theme. White links and buttons retain hover, pressed, and keyboard-focus feedback.
```tsx
import { FolderIcon } from "@phosphor-icons/react";
import { Item, Stack } from "@zentara-co/zenos-ui";
function ItemVariantsExample() {
return (
{(["default", "outline", "muted", "white"] as const).map((variant) => (
{variant[0].toUpperCase() + variant.slice(1)} itemA reusable content row using the {variant} surface.
))}
);
}
```
White items support the same `render` composition as other variants:
```tsx
import { Item, Stack } from "@zentara-co/zenos-ui";
import { useState } from "react";
function ItemWhiteExample() {
const [enabled, setEnabled] = useState(false);
return (
}>
Accessibility guidanceRead the interaction and labeling guidance. setEnabled(!enabled)}
/>
}
>
Weekly summary{enabled ? "Enabled" : "Disabled"}
);
}
```
## Sizes
Use `sm`, `md`, or `lg` to coordinate the row spacing and icon or image scale. The default is `md`.
```tsx
import { FolderIcon } from "@phosphor-icons/react";
import { Item, Stack } from "@zentara-co/zenos-ui";
function ItemSizesExample() {
return (
{(["sm", "md", "lg"] as const).map((size) => (
{size.toUpperCase()} itemSpacing and media scale follow the item size.
))}
);
}
```
## Groups and separators
Use `Item.Group` to collect related rows and `Item.Separator` when a visible boundary helps users
scan the group.
```tsx
import { ArrowRightIcon } from "@phosphor-icons/react";
import { Item } from "@zentara-co/zenos-ui";
function ItemGroupExample() {
const destinations = [
["Workspace", "Manage members, roles, and workspace details."],
["Notifications", "Choose which security events should reach you."],
["API access", "Create and rotate credentials for integrations."],
] as const;
return (
{destinations.map(([title, description], index) => (
{index > 0 ? : null}
}>
{title}{description}
))}
);
}
```
## Links and actions
Compose the root onto an anchor with `render`. The entire row then receives the hover and
focus-visible treatment.
```tsx
}>
SettingsManage workspace preferences.
```
Do not put buttons or other interactive controls inside an Item rendered as a link. For a row with
`Item.Actions`, keep the root non-interactive and give each action its own accessible control.
## Media
Use `variant="icon"` for a framed glyph and `variant="image"` for a cropped image. The default media
slot leaves its child styling untouched, which makes it suitable for Avatar, Badge, or custom media.
## RTL
Item uses logical spacing and alignment. Actions move to the logical end, and directional icons can
use `rtl:rotate-180` when their meaning should mirror.
## Variants
default, outline, muted, white
## Sizes
sm, md, lg
## Anatomy
```text
Item.Root
Item.Group
Item.Separator
Item.Header
Item.Media
Item.Content
Item.Title
Item.Description
Item.Actions
Item.Footer
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| outline \| muted \| white | default | Transparent, bordered, quiet, or white surface treatment. White adapts to a dark surface in dark mode. |
| size | sm \| md \| lg | md | Coordinates row spacing and icon or image scale. |
| render | ReactElement \| ((props, state) => ReactElement) | — | Composes Item props onto another element, such as an anchor. |
| Media.variant | default \| icon \| image | default | Unstyled media, framed icon, or cropped image presentation. |
| Group / Header / Content / Title / Description / Actions / Footer | native element props | — | Composable slots with forwarded refs, classes, and native attributes. |
| Separator | HTMLAttributes | — | Horizontal separator with separator semantics. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
- Choose meaningful native semantics through `render`, such as an anchor for navigation.
- Give icon-only actions an accessible name.
- Do not rely on the variant or media color to communicate status.
- Keep heading hierarchy outside Item unless a title genuinely introduces a document section.
- Item Group is presentational by default; apply list semantics only when the surrounding content
is truly a list.
The component is adapted to Zenos conventions from the [shadcn Item pattern](https://ui.shadcn.com/docs/components/base/item).
Source: https://zenos-ui.pages.dev/components/item/
---
# Kbd
Composable keycaps for keyboard keys and shortcuts.
Display a keyboard key with `Kbd`, or combine several keys with `Kbd.Group`. Keycaps are informational: the application owns shortcut registration and handling.
```tsx
import { Kbd, Stack } from "@zentara-co/zenos-ui";
function KbdExample() {
return (
CtrlShiftEnterEscCtrl+K
);
}
```
## Import
```tsx
import { Kbd } from "@zentara-co/zenos-ui";
```
## Group
Use `Kbd.Group` to keep the keys of a shortcut together. Each `Kbd` renders a native `kbd` element; the group renders a span. Separators are optional and belong to the content you compose. Import only `Kbd` to use both keycaps and groups. `Kbd.Root` is an alias for `Kbd`.
```tsx
Ctrl+K
```
```tsx
import { Kbd, Text } from "@zentara-co/zenos-ui";
function KbdGroupExample() {
return (
Press{" "}
Ctrl+K{" "}
to open the command menu.
);
}
```
Groups inherit text direction from their container. Set native `dir="rtl"` when a group needs right-to-left presentation independently of the page.
## Inside a button
Place a keycap next to an action label without adding another focusable control. The button keeps its native keyboard behavior; the keycap does not install a shortcut.
```tsx
import { Button, Kbd } from "@zentara-co/zenos-ui";
function KbdButtonExample() {
return (
Accept Enter
);
}
```
## Tooltip
Combine an action description and keycaps inside `Tooltip.Content`. Keep the trigger's accessible name meaningful even when the tooltip is closed.
```tsx
import { Button, Kbd, Stack, Tooltip } from "@zentara-co/zenos-ui";
function KbdTooltipExample() {
return (
}>Save
Save changes{" "}
CtrlS
);
}
```
## Input group
Use `InputGroup.Addon` to show shortcut hints beside a field. Label the input independently; the keycaps do not replace its accessible name.
```tsx
import { InputGroup, Kbd } from "@zentara-co/zenos-ui";
function KbdInputGroupExample() {
return (
CtrlK
);
}
```
## Custom styling
Use the usual `className` prop to override keycap appearance or group spacing. No `variant` or `color` props are required. Classes apply after the defaults, and native props, styles, and refs are forwarded to the rendered element.
```tsx
import { Kbd } from "@zentara-co/zenos-ui";
function KbdCustomExample() {
return (
Ctrl
K
);
}
```
## Platform-aware shortcuts
The optional `keys` shorthand remains available for automatic key labels. Join tokens with `+`; use `plus` for a literal plus key. `mod` displays Command on Apple platforms and Control elsewhere, with a matching spoken label. When `keys` is supplied, it takes precedence over children.
```tsx
import { Kbd, Stack, Text } from "@zentara-co/zenos-ui";
function KbdShortcutListExample() {
return (
Open command menuCreate new itemClose overlay
);
}
```
Recognized names include `mod`, `ctrl`, `alt`, `shift`, `enter`, `escape`, `tab`, `backspace`, the four arrow directions, and `plus`. Other tokens render as uppercase text. Literal children, such as `Ctrl`, are displayed exactly as supplied and are not platform-dependent.
```tsx
import { Kbd, Stack } from "@zentara-co/zenos-ui";
function KbdSpecialKeysExample() {
return (
);
}
```
## Anatomy
```text
Kbd
Kbd.Root
Kbd.Group
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| children | ReactNode | — | Literal key text or an icon rendered in a native kbd keycap. Group multiple keys with Kbd.Group. |
| className | string | — | Custom keycap styles or group spacing. No variant or color props are required. |
| keys | string | — | Optional platform-aware shortcut shorthand. Tokens are separated by +; use plus for a literal plus key. When supplied, it takes precedence over children. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Children-based keycaps use native keyboard-input semantics and leave their text available to assistive technology. Spell out ambiguous key symbols or pair a decorative symbol with visually hidden text. `Kbd.Group` only groups content and does not add interaction or focus.
The `keys` shorthand exposes the whole shortcut as one accessible image label and hides the individual visual keycaps from assistive technology. Neither form listens for keyboard commands. Keep the related action clear in nearby text and only advertise shortcuts that the application implements.
Source: https://zenos-ui.pages.dev/components/kbd/
---
# Label
A native label with Zenos typography and disabled-state styling.
A native label with Zenos typography and disabled-state styling.
```tsx
import { Grid, Input, Label, Stack } from "@zentara-co/zenos-ui";
function LabelExample() {
return (
);
}
```
## Import
```tsx
import { Label } from "@zentara-co/zenos-ui";
```
## Control association
Use `htmlFor` with a matching control `id`, or wrap a native labelable control. Clicking either label moves focus to or activates its associated control.
```tsx
import { Checkbox, Input, Label, Stack } from "@zentara-co/zenos-ui";
function LabelAssociationsExample() {
return (
);
}
```
## Label or Field.Label
Use standalone Label for a simple native association. Use `Field.Label` when the control also needs generated IDs, a description, an error, or inherited required, disabled, and invalid semantics.
```tsx
import { Field, Grid, Input, Label, Stack } from "@zentara-co/zenos-ui";
function LabelVsFieldExample() {
return (
Notification email} />
Receives incident notifications.
);
}
```
## Required, optional, and tooltip
Pass `required` to show the design-system asterisk, `optional` (or a custom string) for `(Optional)` copy, and `tooltip` with `tooltipLabel` for an info trigger that opens supporting text.
## Disabled and required presentation
Standalone `Label` uses the same header layout and affordances as `Field.Label`. Pass `required`, `optional`, and `tooltip` on the label itself, and set `disabled` (or `data-disabled`) when the paired control is disabled so the asterisk, optional copy, and info trigger match field styling.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| htmlFor | string | — | ID of the labelled form control. |
| required | boolean | — | Shows a required asterisk after the label text. |
| optional | boolean \| string | — | Shows optional copy beside the label. true renders (Optional). |
| tooltip | ReactNode | — | Tooltip content for the info trigger beside the label. |
| tooltipLabel | string | — | Accessible name for the info trigger. |
| disabled | boolean | — | Mutes the label and affordances to match a disabled control. |
| data-disabled | boolean \| string | — | Alternative disabled presentation hook when not using the disabled prop. |
| native props | React.LabelHTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Label renders a native `label`. Keep its text concise and specific, and do not replace it with placeholder text. Every `htmlFor` must match one labelable control’s `id`. Wrapped controls preserve the browser’s native click behavior.
Source: https://zenos-ui.pages.dev/components/label/
---
# Lightbox
A modal image and video viewer with gallery navigation.
A modal image and video viewer with gallery navigation.
Backed by Base UI Dialog for upstream
behavior and configuration. Zenos owns the public API, styling, and composition shown on this
page.
```tsx
import { Button, Lightbox } from "@zentara-co/zenos-ui";
import { useState } from "react";
const thumbnailPhotos = {
moraineLake: {
src: "https://images.unsplash.com/photo-1669604120699-eeba651ac235?auto=format&fit=crop&w=1600&q=80",
alt: "Turquoise Moraine Lake surrounded by evergreen forest and mountains",
label: "moraine-lake.jpg",
},
lakeMatheson: {
src: "https://images.unsplash.com/photo-1768160864911-90f7837453a2?auto=format&fit=crop&w=1600&q=80",
alt: "Snow-capped Southern Alps reflected in Lake Matheson",
label: "lake-matheson.jpg",
},
architecture: {
src: "https://images.unsplash.com/photo-1761600577035-c9cb717c7059?auto=format&fit=crop&w=1600&q=80",
alt: "Minimal modern building with strong geometric shadows",
label: "architecture.jpg",
},
} as const;
function LightboxExample() {
const [open, setOpen] = useState(false);
return (
<>
setOpen(true)}>
View image
>
);
}
```
The examples use photographs from Unsplash by [ConfinedRiley](https://unsplash.com/photos/a-lake-surrounded-by-mountains-mIj8Cn3oNDg), [Tim G](https://unsplash.com/photos/snow-capped-mountains-reflected-in-a-calm-lake-BrFSOHMGuak), and [Sebastian Schuster](https://unsplash.com/photos/modern-building-exterior-with-strong-geometric-shadows-A-13PmQkP1o).
## Import
```tsx
import { Lightbox } from "@zentara-co/zenos-ui";
```
Lightbox is a controlled or uncontrolled fullscreen viewer. The application owns the trigger so the same viewer can open from a button, thumbnail, or other product-specific surface.
## Gallery
Pass an ordered media array to enable previous, next, counter, and arrow-key navigation. Control `index` when external triggers must open a specific item.
```tsx
import { Button, Lightbox, Stack } from "@zentara-co/zenos-ui";
import { useState } from "react";
const thumbnailPhotos = {
moraineLake: {
src: "https://images.unsplash.com/photo-1669604120699-eeba651ac235?auto=format&fit=crop&w=1600&q=80",
alt: "Turquoise Moraine Lake surrounded by evergreen forest and mountains",
label: "moraine-lake.jpg",
},
lakeMatheson: {
src: "https://images.unsplash.com/photo-1768160864911-90f7837453a2?auto=format&fit=crop&w=1600&q=80",
alt: "Snow-capped Southern Alps reflected in Lake Matheson",
label: "lake-matheson.jpg",
},
architecture: {
src: "https://images.unsplash.com/photo-1761600577035-c9cb717c7059?auto=format&fit=crop&w=1600&q=80",
alt: "Minimal modern building with strong geometric shadows",
label: "architecture.jpg",
},
} as const;
const lightboxGallery = [
{ ...thumbnailPhotos.moraineLake, caption: "Moraine Lake, Banff" },
{ ...thumbnailPhotos.lakeMatheson, caption: "Lake Matheson, New Zealand" },
{ ...thumbnailPhotos.architecture, caption: "Geometric architecture" },
];
function LightboxGalleryExample() {
const [open, setOpen] = useState(false);
const [index, setIndex] = useState(0);
return (
<>
{lightboxGallery.map((item, itemIndex) => (
{
setIndex(itemIndex);
setOpen(true);
}}
>
{item.caption}
))}
>
);
}
```
## Zoom and pan
Set `hasZoom` for images that benefit from close inspection. Users can double-click, press Enter or Space, or use `+` and `−` to change zoom. Arrow keys pan while zoomed, and pointer dragging is also supported.
```tsx
import { Button, Lightbox } from "@zentara-co/zenos-ui";
import { useState } from "react";
const thumbnailPhotos = {
moraineLake: {
src: "https://images.unsplash.com/photo-1669604120699-eeba651ac235?auto=format&fit=crop&w=1600&q=80",
alt: "Turquoise Moraine Lake surrounded by evergreen forest and mountains",
label: "moraine-lake.jpg",
},
lakeMatheson: {
src: "https://images.unsplash.com/photo-1768160864911-90f7837453a2?auto=format&fit=crop&w=1600&q=80",
alt: "Snow-capped Southern Alps reflected in Lake Matheson",
label: "lake-matheson.jpg",
},
architecture: {
src: "https://images.unsplash.com/photo-1761600577035-c9cb717c7059?auto=format&fit=crop&w=1600&q=80",
alt: "Minimal modern building with strong geometric shadows",
label: "architecture.jpg",
},
} as const;
function LightboxZoomExample() {
const [open, setOpen] = useState(false);
return (
<>
setOpen(true)}>
Open zoomable image
>
);
}
```
## Video
Set a media item's `type` to `"video"` to render native video controls. `hasAutoPlay` requests playback when the viewer opens; browser autoplay policy still applies.
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| media | LightboxMedia \| LightboxMedia[] | — | A single image or video, or an ordered gallery. |
| open | boolean | — | Controlled open state. |
| defaultOpen | boolean | false | Initial uncontrolled state. |
| onOpenChange | (open: boolean, eventDetails) => void | — | Runs when visibility changes. |
| index / defaultIndex | number | 0 | Controlled or initial gallery index. |
| onIndexChange | (index: number) => void | — | Runs when gallery navigation requests another item. |
| hasZoom | boolean | false | Enables image zoom and pan. |
| hasAutoPlay | boolean | false | Starts video playback automatically. |
| className / style | string / CSSProperties | — | Customizes the fullscreen viewer popup. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Lightbox uses Base UI Dialog for modal focus management, Escape handling, outside interaction, and focus restoration. Every media item requires meaningful `alt` text, which also names the dialog and video. Captions describe the active item. Left and Right Arrow navigate a gallery when focus is on the viewer, and the counter announces index changes politely. Reduced-motion preferences disable viewer animations.
Source: https://zenos-ui.pages.dev/components/lightbox/
---
# Link
A semantic anchor with Zenos visual treatments and sizes.
A semantic anchor for standalone navigation and links embedded in running text.
```tsx
import { Link, Stack, Text } from "@zentara-co/zenos-ui";
type CatalogVariantProps = { limit?: number };
const limited = (items: readonly T[], limit?: number) =>
limit === undefined ? items : items.slice(0, limit);
function LinkVariantsExample({ limit }: CatalogVariantProps = {}) {
return (
{limited(["default", "muted", "prose"] as const, limit).map((variant) => (
{variant}
{variant === "prose" ? (
Build readable layouts with the{" "}
composition guide
{" "}
and keep the link in the flow of the sentence.
) : (
{variant === "default" ? "Read documentation" : "View release notes"}
)}
))}
);
}
```
## Import
```tsx
import { Link } from "@zentara-co/zenos-ui";
```
## Link or Button
Use Link when activation navigates to another URL, file, or page location. Use Button for actions that change local state, submit data, or open an overlay. Styling an action like a link does not change its required semantics.
## Variants
Use `default` for standalone navigation at the surrounding text's full emphasis. It shifts to the link accent on hover. Use `muted` when a secondary destination should begin at a lower emphasis, then gain the same accent on interaction.
Use `prose` inside paragraphs and other running text. It inherits the surrounding text color, stays underlined, and uses inline layout so a long link can wrap naturally with the sentence. Its underline and text both move to the link accent on hover.
`subtle` remains available as a compatibility alias for `muted`. Use `contrary` only for links placed on an inverse surface.
## Sizes
Sizes use the matching design-system body typography and scale SVGs placed inside `Link.Icon`.
```tsx
import { Link, Stack } from "@zentara-co/zenos-ui";
function LinkSizesExample() {
return (
Small link
Medium link
Large link
);
}
```
## Underline
Standalone links default to `none` because their color change and surrounding navigation context provide the affordance. Use `hover` to reveal an underline on hover and keyboard focus, or `always` when the destination needs a persistent cue. `prose` always remains underlined, even when `underline="none"` is supplied.
```tsx
import { Link, Stack } from "@zentara-co/zenos-ui";
function LinkUnderlineExample() {
return (
Underline on hover
Always underlined
No underline
);
}
```
## Icons
Place `Link.Icon` before or after the label according to meaning. The icon is decorative and hidden from assistive technology, so the link text must remain understandable on its own.
```tsx
import { ArrowLeftIcon, ArrowRightIcon } from "@phosphor-icons/react";
import { Link, Stack } from "@zentara-co/zenos-ui";
function LinkIconExample() {
return (
Previous page
View documentation
External resource
↗
);
}
```
## Custom styling
Use `className` with semantic tokens when a navigation treatment needs a distinct surface. Native anchor props and the Link focus treatment remain intact.
```tsx
import { ArrowRightIcon } from "@phosphor-icons/react";
import { Link } from "@zentara-co/zenos-ui";
function LinkCustomExample() {
return (
Campaign guide
);
}
```
## Composition
Link renders a native anchor. Use `render` to apply the same color, size, underline, and focus treatment to another component, such as a router link, without wrapping it in a second anchor. Actions that change local state still belong on Button.
```tsx
import { Link, Stack } from "@zentara-co/zenos-ui";
import { forwardRef, type AnchorHTMLAttributes } from "react";
const WorkspaceLink = forwardRef<
HTMLAnchorElement,
{ to: string } & AnchorHTMLAttributes
>(function WorkspaceLink({ to, ...props }, ref) {
return ;
});
function LinkRenderExample() {
return (
}>Workspace settings
}
>
Activity log
);
}
```
Put `href`, `target`, and `rel` on the rendered element when that element owns the destination. Link still accepts those anchor props when it renders its own anchor. Base UI joins `className` and `style`, runs both event handlers, and merges refs. If you pass a function, spread its props argument onto your element so the classes, data attributes, and ref stay attached.
The component you render must forward its ref and the props it receives to a DOM node. Do not put another link or button inside it. Place the label in Link's children. If the rendered element already has children, those children are the visible label.
## External destinations
For links that open a new tab, use `target="_blank"` with the appropriate `rel` policy and make the destination change clear through the label, surrounding copy, or a trailing icon. `Link.Icon` is decorative, so do not rely on the icon alone to communicate that context. The same `target` and `rel` pairing applies when those props live on the element passed to `render`.
## Variants
default, muted, prose, subtle, contrary, underline: hover, underline: always, underline: none
## Sizes
sm, md, lg
## Anatomy
```text
Link
Link.Icon
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| muted \| prose \| subtle \| contrary | default | Treatment for standalone, secondary, inline prose, or inverse-surface navigation. Subtle is a compatibility alias for muted. |
| underline | hover \| always \| none | none | Optional underline behavior; hover also underlines on keyboard focus. Prose always stays underlined. |
| size | sm \| md \| lg | md | Body typography and composed SVG icon size. |
| render | ReactElement \| ((props, state) => ReactElement) | — | Composes Link styling onto another element, such as a router link. Base UI merges classes, styles, handlers, and refs. |
| Link.Icon | HTMLAttributes | — | Decorative leading or trailing icon wrapper hidden from assistive technology. |
| native props | React.AnchorHTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Link renders a native anchor by default and preserves `href`, `target`, `rel`, download, ARIA, event, and ref behavior. With `render`, that contract moves to the element you supply, which must forward props and its ref. Use text that describes the destination instead of generic phrases such as “click here.” The visible focus ring supplements, but does not replace, a meaningful accessible name. Prefer the persistently underlined `prose` variant when color alone would be the only cue inside body copy.
Source: https://zenos-ui.pages.dev/components/link/
---
# Loader
The Zenos animated SVG progress mark.
The Zenos animated SVG progress mark.
```tsx
import { Loader, Stack } from "@zentara-co/zenos-ui";
function LoaderExample() {
return (
);
}
```
## Import
```tsx
import { Loader } from "@zentara-co/zenos-ui";
```
## Variants
All variants share the same 5×5 SVG grid and use per-dot timing maps. They inherit `currentColor`, require no runtime animation dependency, and settle into a calm static pattern when reduced motion is enabled.
```tsx
import { Grid, Loader, Stack, Text } from "@zentara-co/zenos-ui";
function LoaderVariantsExample() {
const variants = [
["cross-expand", "Cross Expand"],
["diagonal-scan", "Diagonal Scan"],
["column-scan", "Column Scan"],
["orbit", "Orbit"],
["scan-line", "Scan Line"],
["cipher", "Cipher"],
["pendulum", "Pendulum"],
["aperture", "Aperture"],
["static", "Static"],
] as const;
return (
{variants.map(([variant, label]) => (
{label}
{variant}
))}
);
}
```
Use the `variant` prop with semantic names: `cross-expand` (default), `diagonal-scan`, `column-scan`, `orbit`, `scan-line`, `cipher`, `pendulum`, `aperture`, and `static`. Several patterns are adapted from the MIT-licensed [dot/matrix animation set](https://dot-matrix-animations.vercel.app/).
```tsx
```
## Size and color
Loader uses `currentColor`, so semantic text utilities control its tone. Its default size is 56px; use `className` for contextual sizing without changing the SVG view box.
```tsx
```
## Variants
cross-expand, diagonal-scan, column-scan, orbit, scan-line, cipher, pendulum, aperture, static
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | LoaderVariant | cross-expand | Dot-matrix animation pattern. |
| aria-label | string | Loading | Accessible name and SVG title for the current operation. |
| native props | React.SVGProps | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Loader exposes an SVG image with a title derived from `aria-label`. Name the operation rather than the graphic—for example, “Saving changes” instead of “Animated dots.” For frequently updating status text, place Loader beside a separate live region; the animation itself does not announce progress. Every variant respects `prefers-reduced-motion`.
Source: https://zenos-ui.pages.dev/components/loader/
---
# Marker
An inline conversation status, bordered event row, or labeled separator.
Marker presents lightweight system notes and boundaries inside a conversation. Compose it with
[Message](/components/message/) or place it directly in a
[Message Scroller](/components/message-scroller/) between turns.
```tsx
import { CircleNotchIcon, GitBranchIcon, MagnifyingGlassIcon } from "@phosphor-icons/react";
import { Marker, Stack } from "@zentara-co/zenos-ui";
function MarkerExample() {
return (
Switched to a new branchThinking...Conversation compactedExplored 4 files
);
}
```
## Import
```tsx
import { Marker } from "@zentara-co/zenos-ui";
```
## Composition
Marker has a decorative icon slot and a content slot.
```tsx
Explored 4 files
```
`Marker.Icon` always uses `aria-hidden="true"`. Put the marker's meaning in `Marker.Content`, or add
an accessible label to the root for an icon-only marker.
## Variants
- `default` is an inline status or note.
- `border` adds a decorative bottom boundary while keeping the same layout.
- `separator` centers a visible label between two decorative divider lines.
The labeled separator intentionally has no default `role`. A separator role makes descendants
presentational, which would prevent the visible text from being announced as ordinary content.
## Status updates
Add `role="status"` when a marker reports streaming or in-progress work that should be announced.
Avoid adding a live-region role to historical markers that are already present when the page loads.
```tsx
import { GearIcon, PulseIcon } from "@phosphor-icons/react";
import { Marker, Stack } from "@zentara-co/zenos-ui";
function MarkerStatusExample() {
return (
Running security checksCompacting conversation
);
}
```
## Labeled separators
Use separator markers for dates, elapsed time, compacted history, or other readable boundaries.
```tsx
import { Marker, Stack } from "@zentara-co/zenos-ui";
function MarkerSeparatorExample() {
return (
TodayWorked for 42 secondsConversation compacted
);
}
```
## Links and buttons
Use `render` to compose Marker onto a native anchor or button. Interactive markers receive hover
and focus-visible affordances while keeping their native semantics.
```tsx
import { ArrowRightIcon, GearIcon } from "@phosphor-icons/react";
import { Marker, Stack } from "@zentara-co/zenos-ui";
function MarkerInteractiveExample() {
return (
}>
View the pull request undefined} />}>
Retry the workspace sync
);
}
```
```tsx
}>
View the pull request
```
## RTL
Marker relies on flex gaps rather than physical margins, so icons and content follow document
direction automatically. Divider lines remain balanced in both directions. Mirror directional icons
with `rtl:rotate-180` when their meaning changes direction.
## Variants
default, border, separator
## Anatomy
```text
Marker.Root
Marker.Icon
Marker.Content
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| border \| separator | default | Inline note, bordered event row, or labeled divider layout. |
| render | ReactElement \| ((props, state) => ReactElement) | — | Composes Marker props onto an anchor, button, or another element. |
| role | AriaRole | — | Use status for live progress; no role is supplied by default. |
| Icon | HTMLAttributes | — | Decorative icon slot that is always hidden from assistive technology. |
| Content | HTMLAttributes | — | Visible marker text with long-content wrapping. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
- Use `role="status"` only for live progress or streaming updates.
- Do not add `role="separator"` to a labeled separator; keep its text readable to assistive tech.
- Give an icon-only root an `aria-label`.
- Render interactive markers as real anchors or buttons through `render`.
- Do not rely on icon shape, border treatment, or position alone to communicate meaning.
The component is adapted to Zenos conventions from the [shadcn Marker pattern](https://ui.shadcn.com/docs/components/base/marker).
Source: https://zenos-ui.pages.dev/components/marker/
---
# Message
A conversation row for avatars, message surfaces, sender context, and metadata.
Message lays out one conversational entry. It owns the row, avatar, sender context, and footer while leaving the visible message surface to [Bubble](/components/bubble/).
```tsx
import { Avatar, Bubble, Message, Text } from "@zentara-co/zenos-ui";
function MessageExample() {
return (
Deploying the release now.
Delivered
Rina
Send me the build report when it finishes.
14:42
);
}
```
## Import
```tsx
import { Avatar, Bubble, Message } from "@zentara-co/zenos-ui";
```
## Composition
Compose an optional avatar beside `Message.Content`. Place `Message.Header`, a Bubble, and `Message.Footer` inside the content column.
```tsx
RinaThe report is ready.Read
```
Message is a presentational row rather than a transcript or scroll container. Put conversation-level semantics such as `role="log"` and an accessible label on the surrounding region.
## Alignment and RTL
Set `align="start"` or `align="end"` on Message to move the avatar to the matching logical side. Give the composed Bubble the same alignment when its surface should follow the row. Logical layout automatically mirrors in an RTL document or `DirectionProvider`.
```tsx
Deploying now.Delivered
```
## Consecutive messages
Use `Message.Group` for consecutive entries. An empty avatar slot on earlier messages preserves alignment when the final message displays the sender avatar.
```tsx
import { Avatar, Bubble, Message, Text } from "@zentara-co/zenos-ui";
function MessageGroupExample() {
return (
I checked the registry output.The component metadata is up to date.
Read
);
}
```
## Header and footer
Use `Message.Header` for sender context. Use `Message.Footer` for timestamps, delivery status, or message-level actions. End-aligned rows place footer content on the logical end automatically.
## Anatomy
```text
Message.Root
Message.Group
Message.Avatar
Message.Content
Message.Header
Message.Footer
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| align | start \| end | start | Logical alignment of the message row and avatar. |
| Group | HTMLAttributes | — | Stacks consecutive messages from the same conversation. |
| Avatar | HTMLAttributes | — | Bottom-aligned slot for an Avatar or another sender marker. |
| Content | HTMLAttributes | — | Wraps the header, message surface, and footer. |
| Header / Footer | HTMLAttributes | — | Sender context and message-level metadata or actions. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
Message does not add chat semantics by itself. Keep sender names and status text meaningful, label icon-only footer actions, and use a live region only for updates that should be announced. Do not rely on alignment or color alone to identify the sender.
Source: https://zenos-ui.pages.dev/components/message/
---
# Message Scroller
A user-respecting transcript scroller for live replies, saved conversations, and long message history.
Message Scroller manages the scrolling behavior around a conversation without owning the message UI. It follows new content only while the reader is at the live edge, preserves their position when older history is prepended, and exposes commands for navigation.
```tsx
import { ArrowClockwiseIcon, ArrowUpIcon, ChatCircleDotsIcon, PlusIcon } from "@phosphor-icons/react";
import { useChat } from "@ai-sdk/react";
import type { ChatTransport, TextUIPart, UIMessage, UIMessageChunk } from "ai";
import { Bubble, Center, IconButton, Message, MessageScroller, Stack, Text, Textarea, VisuallyHidden } from "@zentara-co/zenos-ui";
import { useState } from "react";
const messageScrollerInitialPrompt =
"I'm building a chat for our app and the scroll behavior is driving me nuts. Every time the AI streams a reply, the whole thread jumps around.";
const messageScrollerMockReply =
"That is the classic streaming scroll problem. MessageScroller follows new content only while the reader is already at the live edge. If they scroll up, their position stays put while the response continues below. The jump button brings them back whenever they are ready.";
const messageScrollerChunkDelay = 24;
function waitForMessageScrollerChunk(signal?: AbortSignal) {
return new Promise((resolve) => {
if (signal?.aborted) {
resolve(false);
return;
}
const timer = window.setTimeout(() => {
signal?.removeEventListener("abort", handleAbort);
resolve(true);
}, messageScrollerChunkDelay);
const handleAbort = () => {
window.clearTimeout(timer);
resolve(false);
};
signal?.addEventListener("abort", handleAbort, { once: true });
});
}
const messageScrollerMockTransport = {
async sendMessages({ abortSignal, messages }) {
const messageNumber = messages.length;
const messageId = `assistant-${messageNumber}`;
const textId = `assistant-text-${messageNumber}`;
return new ReadableStream({
async start(controller) {
controller.enqueue({ type: "start", messageId });
controller.enqueue({ type: "text-start", id: textId });
for (const delta of messageScrollerMockReply.split(/(?<=\s)/)) {
if (!(await waitForMessageScrollerChunk(abortSignal))) {
controller.enqueue({ type: "abort" });
controller.close();
return;
}
controller.enqueue({ type: "text-delta", id: textId, delta });
}
controller.enqueue({ type: "text-end", id: textId });
controller.enqueue({ type: "finish", finishReason: "stop" });
controller.close();
},
});
},
async reconnectToStream() {
return null;
},
} satisfies ChatTransport;
function getMessageScrollerText(message: UIMessage) {
return message.parts
.filter((part): part is TextUIPart => part.type === "text")
.map((part) => part.text)
.join("");
}
function MessageScrollerExample() {
const [draft, setDraft] = useState(messageScrollerInitialPrompt);
const { messages, sendMessage, setMessages, status } = useChat({
transport: messageScrollerMockTransport,
});
const isBusy = status === "submitted" || status === "streaming";
const handleSubmit = async (event: { preventDefault: () => void }) => {
event.preventDefault();
const text = draft.trim();
if (!text || isBusy) return;
setDraft("");
await sendMessage({ text });
};
return (
);
}
```
The preview uses `useChat` from `@ai-sdk/react` with a local scripted `ChatTransport`. It exercises
the same message, status, and streamed-part shapes as an AI-backed application without sending a
network request or requiring an API key. Replace the mock transport with your application transport
when connecting a real model.
## Import
```tsx
import { Message, MessageScroller } from "@zentara-co/zenos-ui";
import { useChat } from "@ai-sdk/react";
```
## Composition
Give the root a height-constrained parent, then compose the viewport, live-region content, and stable message items. `MessageScroller.Button` appears after the reader moves away from the latest message.
```tsx
```
## Following live replies
`autoScroll` defaults to `true`. Appended content follows the live edge only while the reader is already there. Scrolling upward releases that behavior, so a streamed response cannot pull the reader away from older content. Set `autoScroll={false}` when the application should never follow appended content automatically.
```tsx
{/* transcript */}
```
## Opening saved conversations
Choose the initial position with `defaultScrollPosition`:
- `"end"` opens at the newest message.
- `"start"` opens at the beginning.
- `"last-anchor"` opens at the latest item marked with `scrollAnchor`.
Use `scrollPreviousItemPeek` to control the space shown above an anchored turn.
```tsx
{/* transcript */}
```
## Loading older history
`preserveScrollOnPrepend` defaults to `true`. When older items are inserted before the current list, the viewport compensates for the added height so the visible message stays in place. Keep every `messageId` stable across pagination.
## Scroll commands
Use `useMessageScroller` inside the provider for transcript navigation. `scrollToMessage` returns `false` when the requested ID is not mounted.
```tsx
function TranscriptControls() {
const { scrollToEnd, scrollToMessage, scrollToStart } = useMessageScroller();
return (
<>
scrollToStart({ behavior: "smooth" })}>First scrollToMessage("message-42", { block: "center" })}>
Jump to result
scrollToEnd({ behavior: "smooth" })}>Latest
>
);
}
```
## Visibility
`useMessageScrollerVisibility` returns `visibleMessageIds` and the nearest visible `currentAnchorId`. Use that state for a transcript outline, unread markers, or a synchronized search result list.
## RTL
The jump button uses logical positioning and mirrors automatically in a `dir="rtl"` region or `DirectionProvider`. Message alignment remains the responsibility of the composed `Message` and `Bubble` parts.
## Anatomy
```text
MessageScroller.Provider
MessageScroller.Root
MessageScroller.Viewport
MessageScroller.Content
MessageScroller.Item
MessageScroller.Button
```
## API
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| autoScroll | boolean | true | Follows appended content while the reader remains at the live edge. |
| defaultScrollPosition | start \| end \| last-anchor | end | Initial position when the transcript is mounted. |
| preserveScrollOnPrepend | boolean | true | Preserves the visible position when older history is prepended. |
| scrollPreviousItemPeek | number | 48 | Space above an item when a turn anchor is positioned. |
| messageId | string | — | Stable Item identifier used by commands and visibility tracking. |
| scrollAnchor | boolean | false | Marks an Item as a conversation-turn boundary. |
| target | start \| end | end | Transcript boundary targeted by MessageScroller.Button. |
| native props | React.HTMLAttributes | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.
## Accessibility
The viewport is keyboard-focusable and labeled “Conversation” by default. Content uses `role="log"` with a polite live region for additions. Keep sender names and message status in readable text, provide stable IDs, and avoid announcing large batches when loading historical messages.
The behavior is informed by the [shadcn Message Scroller](https://ui.shadcn.com/docs/components/base/message-scroller) while using Zenos tokens, compound APIs, and direction conventions.
Source: https://zenos-ui.pages.dev/components/message-scroller/
---
# Native Select
A native HTML select styled with Zenos form surfaces and browser-native behavior.
Native Select styles the platform `