npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ozaco/ui

v0.0.1

Published

Polymorphic, variant-driven React primitives for ozaco

Readme

@ozaco/ui

Preset-driven React primitives built with a typed component builder.

Layout

ambient.d.ts              `*.svg` imports are strings (`with { type: 'text' }` / `?raw`) in the sources of
                          this package; not published
src/
  shared/                 cross-cutting code: no components, and JSX in one file only (utils/build.tsx)
    index.ts              the only barrel of the folder
    types/component.ts    namespace Component { Variants, VariantProps, Compound, Slots, Tag, OwnProps,
                                                RenderProps, Context, Config, Built, Builder }
    types/polymorphic.ts  namespace Polymorphic { AsProp, ElementProps, ElementRef, Props, Component };
                          `ElementProps<typeof X>` reads the props of a builder component from the types it
                          carries: use it there, never `ComponentProps<typeof X>`, which reads `any`
    types/icon.ts         namespace Icon { Mode, Parsed }
    types/motion.ts       namespace Motion { Of } — props of `motion.create(RacComponent)`
    types/messages.ts     namespace Messages { Entry, Table, Of, Overrides } — the strings the library
                          supplies, as tables a consumer can replace
    types/<topic>.ts      the types of the utils file of the same name, a namespace each: Clipboard,
                          Disclosure, Media, Paging, Scroll, Storage, Time
    types/helpers.ts      namespace Helpers — internal, not exported from the root
    constants/svg.ts      the svg standard: svgSizes/svgStrokes/svgCaps, strokeSvg(), solidSvg(), svgCanvas()
    utils/component.ts    component(): the builder          utils/build.tsx  build(): config → component
    utils/merge.ts        mergeVariants(), mergeConfig()    utils/icon.ts    icon(): raw svg → component
    utils/presets.ts      shared interaction classes        utils/svg.ts     parseSvg(), recolorSvg()
    utils/number.ts       clamp(), clampPercent(), sameNumbers()             utils/list.ts    sameList()
    utils/guard.ts        isRecord(), isThenable()          utils/node.ts    isEmptyNode(), nodeText()
    utils/tokens.ts       readToken(s)                      utils/object.ts  compact()
    utils/color.ts        parseCssColor(), toHex(), withAlpha(), oklch ↔ srgb
    utils/a11y.ts         decorativeA11y, imgA11y, graphicA11y, statusA11y, meterA11y, sliderA11y
    utils/<topic>.ts      media, motion, storage and messages are two files each: `<topic>.ts` is plain code a
                          Server Component can call, `<topic>-react.ts` holds what needs React (hooks,
                          context, motion elements); the barrel exports both halves
    utils/motion.ts       springs, durations, easings, tweens, variants, slide, stagger, anime,
                          press(isPressed), prefersReducedMotion(), motionOk(), motionAllowed() (pure);
                          motion-react.ts: motionOf(), motionTag(tag) (motionOf for a tag, typed as motion's
                          own; both hold the `initial` of an entrance back on the server and through
                          hydration), useEntrance(), useMotionOk() (follows prefers-reduced-motion while
                          mounted), usePressScale()
    utils/scroll.ts       scrollTo(target) — a px offset, 'top', 'end' or an item — scrollToTop/End/Item,
                          scrollBy, scrollPosition (pure), pageScroller(), atScrollEnd(box, threshold) (pure),
                          jumpToEnd(box) (at once; scrollToEnd is the smooth one a user asks for)
    utils/media.ts        mediaMatches(query), watchMedia(query, listener); media-react.ts:
                          useMediaQuery(query, { defaultValue })
    utils/hydration.ts    useHydrated(): false on the server and through hydration, true from the first render
                          of a component mounted in the browser
    utils/clipboard.ts    copyText(text) → Promise<boolean> (never rejects), useClipboard({ timeout }) →
                          { copied, copy, reset }
    utils/storage.ts      readStorage/writeStorage/removeStorage (never throw), watchStorage;
                          storage-react.ts:
                          useLocalStorage(key, initial, { serialize, deserialize, storage }) →
                          [value, setValue, remove] (in sync across hooks and tabs)
    utils/disclosure.ts   useDisclosure({ open, defaultOpen, onOpenChange }) →
                          { open, setOpen, show, hide, toggle }
    utils/ref.ts          assignRef(ref, node): hands a node to a `ref` of either shape (callback or object),
                          or to none
    utils/messages.ts     mergeMessages(defaults, ...overrides) (pure: later wins, undefined never blanks a
                          default, an entry keeps the kind of its default; the answer has the defaults' type
                          alone); messages-react.ts: MessagesContext (group name → partial table),
                          useMessages(group, defaults) → the group's table with the consumer's entries laid
                          over it (same identity while neither changes)
    utils/paging.ts       pageSizeOf(pageSize, fallback), pageLimitOf(limits, key, pageSize),
                          raisePageLimit(limits, key, { pageSize, count }): a long run drawn a page at a time
                          (DiffView, JsonView)
    utils/path.ts         pathExtension(path): lower case, read off the last segment of either slash, without
                          what follows a `?` or a `#`, '' for none
    utils/time.ts         one zone-aware calendar for the groups that tell days and distances (ActivityFeed,
                          NotificationCenter, ChatList): toTimestamp, isoTime, knownTimeZone,
                          hydratedZone(timeZone, hydrated), calendarDay, dayKey, startOfDay, daysAgo,
                          groupByDay, dayLabel(day, now, { today, yesterday, locale, timeZone }),
                          absoluteTime, relativeDistance(at, now) → { unit, count, ahead }, nextClock; dayMs,
                          relativeNow, relativeSteps
  theme.css               Tailwind v4 `@theme`: the `--ui-*` seeds, the derived tokens, keyframes
  components/
    index.ts              root barrel: every group below

Each group is a folder with the same shape: index.ts (its barrel), the component .tsx files, and the public non-component code beside them — types.ts (or types/<topic>.ts) and the group's own topic modules (chart/engine.ts, chart/palette.ts, chart/plain.ts, chart/inspect.ts, live/failure.ts, overlay/presence.ts, display/highlight.ts, provider/theme.ts, …). A group has no utils and no constants: its class maps, glyph tables, preset bags and pure helpers are src/internal/<group>/constants.ts and utils.ts (a directory of <topic>.ts files where one file is not enough: internal/chart/utils/, internal/display/constants/). No barrel exports anything of internal/; the components and the tests import those files by path, and a helper that is part of the API lives in a topic module. A .tsx file holds components and their JSX helpers only; anything exported that is not a component lives in a .ts file, and anything used by more than one group lives in shared/.

Every string a group says by itself is in its messages.ts and nowhere else: the table <group>Messages and its type <Group>Messages (navMessages / NavMessages), one line in the group's barrel. A table module is words only: it imports types and nothing else. Every group below has one except base, bg, icons and motion, which supply no string of their own; the entries do not say it again. See Messages.

    base/                 Box (root of everything), Section (page band: 20px rails + vertical annotation
                          lanes; `fill` scrolls its content in a Scrollable, named by `scrollLabel` or by a
                          `label` that is text), Text + Heading, Spinner (`variant`: the type SpinnerVariant),
                          Progress (`orientation='vertical'` stands a graphic bar up, the fill growing
                          from the top; `showValue` prints the percentage in the locale of react-aria's
                          `useLocale()`; `formatValue(value)` prints the caller's words in its place, read out
                          as `aria-valuetext` when they are text), Svg, Scrollable (contains overscroll on the
                          axis it scrolls and on no other — a wheel turned across the box moves the page — and
                          only while that axis really overflows: a box whose content fits hands the wheel on
                          to the page. Measured in the browser from the element's `ref` callback, no hook; the
                          element carries `data-overflow-x` / `data-overflow-y` while it has something to
                          scroll. `className='overscroll-auto'` hands the wheel on always,
                          `className='not-data-overflow-y:overscroll-y-contain'` contains a box that fits as
                          well. It takes the focus with the library ring (`presets.focusNative`), drawn inside
                          the box under `fade`, or with `className='focus-visible:ring-inset'` where a parent
                          clips; never give it an `outline` of your own, both would paint: move the ring.
                          `label` names the box and makes it a tab stop for as long as it has something to
                          scroll, with `role='group'` on an element that says nothing of what it is; a box
                          that fits carries none of it), Masonry (items of different heights in columns:
                          `columns` 1–6 or a responsive preset sm · md · lg, `order` column — CSS columns, no
                          JS — · row — dealt round-robin into flex columns —, `balance` in row order:
                          measured, each item to the shortest column, moved without being remounted)
    button/               Button (while `loading` its spinner is a react-aria ProgressBar named `loadingLabel`
                          or the `buttonLoading` message, so the button says it is busy), ToggleButton +
                          ToggleButtonGroup, ButtonGroup, SplitButton (`loadingLabel` forwarded)
    field/                Label, LabelText (the red asterisk of a required field, on any caption: Label and
                          FieldLegend are built on it, a Checkbox and a Switch use it for their own text;
                          generated content with an empty alternative text, so never part of an accessible
                          name; `requiredMark={false}` on a caption, a field, a Fieldset or a Form, or
                          `data-required-mark='false'` on any element around them, turns it off through one
                          inherited property, `--required-mark`, which also takes another glyph), Description,
                          FieldError (as wide as its field and never the reason the field is wide: the message
                          wraps under the control; a field laid out as a row, `layout='row'`, keeps it beside
                          the control at its own width; a `className` with a width of its own opts out),
                          Field, FieldFrame/FieldInput/FieldButton/Adornment, Form (schema · onDirtyChange ·
                          requiredMark; names with an index — `contacts[1].email` — are rows, validated as an
                          array of objects; `onSubmit` and `onValidSubmit` get the submit event as
                          FormSubmitEvent: `SubmitEvent<HTMLFormElement>` where the installed React types have
                          it — @types/react 19.2.10 and later —, `FormEvent<HTMLFormElement>` before),
                          Fieldset/FieldLegend, TextField, PasswordField (showLabel · hideLabel name the
                          reveal toggle), TextArea, NumberField (stepper: stacked · inline · none),
                          SearchField (clearLabel; read-only, its clear button stays on show, disabled and
                          dimmed), MaskField, PinField (variant: corner · border · borderless; the active box
                          draws the focus ring and a caret), FileField (list: inline · below; clearLabel; two
                          tab stops: the drop zone — react-aria's hidden button, named by what the frame says
                          and then by the field's label — and the browse button), TagField (value string[]:
                          chips in the frame before the input; delimiters, caseSensitive, max, validate,
                          suggestions), InlineEdit (text that turns into an input in place: press · Enter ·
                          F2; multiline, controls, async onCommit, validate), FieldArray (rows of fields under
                          stable keys on a Fieldset: add · remove · reorder, min · max, a render prop per
                          row), FormStatusBar (the sticky "unsaved changes" bar), UnsavedChangesDialog (stay ·
                          discard); inline-edit-state.ts: createInlineEdit (pure), useInlineEdit;
                          field-array-state.ts: useFieldArray; dirty.ts: useFormDirty, useUnsavedChanges
                          (beforeunload + confirm()), createUnsavedChanges (pure); control.ts: focusControl
                          (the `onPointerDown` of any frame: a press on the frame focuses its control),
                          validityOf (the ValidityState a hand-built field hands to FieldErrorContext);
                          debounce.ts: createDebouncer, useDebouncedCallback
    choice/               Checkbox(+Group), Radio(+Group), Switch, Select, ComboBox (each typed by its option
                          keys: `Select<K>` / `ComboBox<K>` carry `value` / `defaultValue` / `onChange`),
                          ListBox/Option/OptionGroup (`ListBox virtualized` draws only the rows in sight, for
                          hundreds or thousands of options: react-aria's `Virtualizer`, rows measured as they
                          come into sight; `ComboBox` and `MultiComboBox` take the same `virtualized` for
                          their list, which is then as wide as the field), TagGroup/Tag, Slider,
                          RangeSlider (the Slider with two
                          thumbs: value [low, high], minDistance, output `20 – 80`, thumbLabels, separator,
                          name for both inputs or one each), Rating (0…max marks, step 1 · 0.5; a slider to
                          the keyboard, the pointer rates the mark it is on, hover previews, clearable;
                          isReadOnly shows any fraction; slots icon · fillIcon · halfIcon; valueText),
                          SegmentedControl (a radio group as joined segments with a thumb that slides to the
                          picked one: options, size, tone, fit), MultiComboBox (picks SEVERAL options by
                          typing: the picks are removable chips in the frame before the input; value string[],
                          `items` or Option / OptionGroup children, max, allowsCustomValue + onCreate,
                          isLoading, filter false · fn, clearable; `labelOf(key)` names a picked key no option
                          on the list does: a value loaded with a record while a server filters), Autocomplete
                          (free text with suggestions under the field: the value is the TEXT; suggestions
                          string[] or rows, menuTrigger input · focus, isLoading + onInputChange, filter
                          false · fn). The error message of a control that is only as wide as its own marks
                          (Checkbox, Switch, CheckboxGroup, RadioGroup, Rating, SegmentedControl, TagGroup)
                          keeps its own width, on one line
    color/                ColorPicker (swatch button + Popover, or `inline`; CSS string in/out, `format`
                          hex|rgb|hsl|oklch), ColorArea, ColorSlider (hue, alpha over a checkerboard, any
                          channel), ColorField (hex), ColorSwatch, ColorSwatchPicker/Item; value.ts:
                          useColorValue
    date/                 Calendar, RangeCalendar (size, headingLevel), DateField, TimeField, DateInput,
                          DatePicker, DateRangePicker (calendarSize, headingLevel, animate), TimeColumns (a
                          Time as listbox columns: hours · minutes · seconds · AM/PM, the pick on the middle
                          line; minuteStep/secondStep, minValue/maxValue), TimePicker (TimeField + a popover
                          of TimeColumns: now · done, `presets` slot), TimePreset, DateTimePicker (DatePicker
                          to the minute: Calendar + TimeColumns in one popover, stacked when narrow: now ·
                          clear · done, calendarSize, headingLevel; the calendar follows every pick)
    file/                 FileTrigger (animate), DropZone (its hidden first tab stop is named by the zone's
                          line: a line of text as it stands, a line with an element in it as react-aria's
                          label; `aria-label` wins), FileList/FileListItem (meta slot: the words of a row's
                          status line; labels: uploading · done · failed · remove · progress, the ones with a
                          value in them a word or a function of the value; focusTarget: what takes the focus
                          when the last row is removed, else the list itself), FileUpload (DropZone + FileList
                          as an uploader: queued · uploading · done · error rows with retry/cancel/remove,
                          concurrency, autoUpload + "upload all"; multiple={false} holds one file and a new
                          pick replaces it in one change; labels + messages replace every word; a button that
                          goes away from under the focus hands it on), FileViewer, FileKindIcon (files.ts:
                          validateFiles, fileAccepted, rejectionMessages, uploadSentences, fileSummary,
                          fileEntries, totalBytes, formatBytes, formatPercent — pure, what FileField is built
                          on; source.ts: useObjectUrl, useFileText; uploads.ts: createUploads — the pure
                          upload queue: add, replace, remove, retry, cancel, start, clear, its own `messages`
                          (failed · missing · cancelled) — and useUploads)
    overlay/              Popover (a modal one, and the menu, the list or the dialog in it, also carries the
                          text of what labels it from outside as its `aria-label`: the trigger and the field's
                          label are inert while it is open), Modal + Dialog + AlertDialog (`headingLevel` 1–6:
                          the element of the title, h2 unless told otherwise, its size does not follow; while
                          a Dialog's body has something to scroll it is a tab stop named after the dialog, so
                          a body of text scrolls from the keyboard), Drawer, Tooltip (`relation` description ·
                          label · none: what it is to its trigger for assistive tech; `label` for a tooltip
                          that only says what an icon button is called, so that name is not read twice),
                          Menu/MenuItem/MenuSection/MenuSeparator/Submenu (typeahead finds a row by its text
                          children; `textValue` for a row whose children hold an element), ContextMenu (right
                          click, same items), toast + Toaster (overlay.css: drawer/toast keyframes),
                          PresenceBoundary (resets motion's presence context above an overlay root: every
                          motion root of the group renders in one, so an overlay opens visibly under any
                          `AnimatePresence initial={false}` — a Collapse open at load, a ChipGroup; the
                          content of an `animate={false}` Popover, Tooltip, Modal and Drawer sits in one of
                          its own; wrap a motion overlay of your own in it); presence.ts: useOverlayPresence
                          (an overlay stays mounted until motion reports its exit done, or until
                          `exitDeadline()` when it never does; `opening` counts the times it was reopened
                          while it left, and `openingKey` makes that the key of an overlay that takes the
                          focus, so it opens anew), useOpenings (counts every opening of an overlay that
                          leaves on react-aria's CSS exit, an `animate={false}` root: with `openingKey` its
                          key, so one pressed open again within its exit opens anew), overlayExit, enterExit,
                          useOpenState and the pure phase helpers
    notification/         NotificationCenter: the list of a notification store behind a bell — in a Popover, a
                          Drawer (`presentation='drawer'`) or in place (`inline`): "mark all as read", an
                          all · unread filter, rows grouped by day on Timeline (a press marks read and follows
                          `href`; mark read / unread and remove per row), `empty` and `footer` slots,
                          `headingLevel` (4: the panel's heading, the day headings one below), `timeZone` (the
                          zone a day is told in; without it the browser's own, and UTC on a server until the
                          page has hydrated: what the server wrote of its own clock is then written anew, so
                          give `timeZone`, `locale` and `now` where that correction must not be seen),
                          arrivals said by a polite live region — by ONE centre per store: the first that
                          mounted, the next in line when that one unmounts; `announce` true · false settles it
                          by hand. NotificationBell: the icon Button with the unread count on a badge (99+)
                          and in its name. createNotifications (store.ts, pure: add, markRead, markUnread,
                          markAllRead, remove, clear, `max`, `storageKey`) / useNotifications,
                          useNotificationsSnapshot (state.ts); notify(store, input, { toast }) (notify.ts)
    nav/                  Link (`title` reaches the element), Tabs/TabList/Tab/TabPanel, Breadcrumbs,
                          Pagination (an arrow that arrives at the first or the last page hands its focus to
                          that page's button), Disclosure/Accordion (DisclosureTrigger `level` 1–6: the
                          heading around the button, h3 by default; a collapsed DisclosurePanel stays in the
                          document, hidden until found, so `aria-controls` names it and its children mount
                          with the section), Toolbar, AppShell/Sidebar/SidebarItem, Command (palette: Esc
                          closes the modal at once, whatever is typed; `inline` has nothing to close, and Esc
                          there only clears the text), TableOfContents (the "on this page" list: entries
                          nested by heading level along a rail, the current one marked, a press scrolls there;
                          size, collapse, hash), BackToTop (appears past a threshold; position fixed ·
                          absolute · sticky · static, placement, progress text · border; a press hands the
                          focus on: to `focusTarget`, else to the container, else, for the page, back to the
                          document at its start), ScrollProgress (a Progress that follows the scroll);
                          scroll-spy.ts: useScrollSpy (controller: current, pin, measure), useScrollProgress,
                          tocFromHeadings / useTocItems; motion.tsx: LayoutScope (`root`), LayoutMarker — the
                          mark of a control's current item (tab marker, pager fill, sidebar fill, TOC mark),
                          measured inside its control, so a control that moves takes its mark along;
                          layout-root.ts: useLayoutRoot (the control's element, kept beside the consumer's own
                          `ref`, for `LayoutScope root`)
    hotkey/               Keyboard shortcuts: useHotkey(combo, handler, options) / useHotkeys(map, options) —
                          'mod+k', 'shift+?', a sequence 'g i', a physical key 'code:KeyK'; options enabled ·
                          scope · preventDefault · allowInInputs · allowRepeat · target · description · group.
                          Unless it `allowInInputs`, a plain character fires nothing where characters are
                          taken: a field, a list box, a menu, a tree, the grid of a react-aria collection
                          (Table, GridList, Tree, TagGroup), the button of a Select; it does fire on the days
                          of a Calendar and on a menu button whose menu is closed. createHotkeys() (store.ts,
                          pure) and `hotkeys`, the page's store; HotkeyProvider (a registry apart, platform,
                          timeout), HotkeyScope / useHotkeyScope (a modal's hotkeys shadow the page's),
                          useHotkeyState, useHotkeyStore, useHotkeyPlatform (state.ts); format.ts:
                          formatHotkey(combo, platform, { separator, sequence, spoken, messages }) ('⌘ K' ·
                          'Ctrl K'), hotkeyKeys(combo, platform, messages): `messages` are the caps that are
                          words (Ctrl, Esc, Space) and the keys by name. HotkeyHint (Kbd tiles for one combo;
                          variant tile · plain), HotkeyList (the registered hotkeys by group, searchable; or
                          `items`; `headingLevel` 5 for its group headings), HotkeyHelp (the list in a Modal,
                          opened by '?' or a useDisclosure() controller; `headingLevel` 2 is its title's, the
                          groups one below)
    split/                Split: resizable panes — two or more SplitPane children side by side or stacked
                          (orientation), with a SplitHandle between every two: a focusable `separator`,
                          dragged or moved with the keys (arrows by `step`, Shift by `largeStep`, Home/End,
                          Enter or a double press collapses); look line · grip. Sizes are percentages drawn as
                          inline `flex-basis`, the same on the server; a pane takes defaultSize,
                          minSize/maxSize (percent or px; a maxSize under the minSize is the minSize, so leave
                          room between the two), collapsible + collapsedSize, label; a pane that scrolls
                          (`overflow` `auto`, `x` or `y`) shows the focus ring inside it and, with a `label`,
                          is a `group` by that name. useSplit (state.ts — controller: sizes + collapsed,
                          setSizes, setLayout, collapse, expand, toggle, reset, isCollapsed; which panes are
                          collapsed is STATE, never read off a size — collapsed/onCollapsedChange beside
                          sizes/onSizesChange; storageKey keeps both), SplitPlaceContext (context.ts); the
                          maths is pure, in internal/split/utils.ts
    collection/           Table/TableHeader/Column/TableBody/Row/Cell (+ selection helpers; `scroll` ·
                          `maxHeight` · `resizable` put the table in a box that scrolls it and draws the
                          grid's focus ring and the `layer` frame; bare inside a VirtualList), GridList
                          (`GridListItem pinned`: in a list with drag and drop the row stays where it is — not
                          picked up, its grip off, `data-pinned` — and is otherwise a row like the others),
                          Tree, VirtualList (a virtualized Table takes the heading's height as scroll padding,
                          `scroll-pt-[<headingHeight>px]`, or a row reached by arrowing up parks under the
                          pinned heading), DataTable: a Table with its chrome — search, columns menu, sort,
                          pager + page size, bulk action bar, empty state, loading skeletons — over rows held
                          in memory (text sorted in the locale of react-aria's `useLocale()`, so a server and
                          a browser order the rows alike) or `manual` (the server searches, sorts and pages);
                          `selectionBehavior='replace'`: no checkbox column, a press replaces the whole
                          selection, rows picked on other pages included (Shift and Cmd/Ctrl extend it within
                          the page, Escape empties it; `toggle` gathers across pages); the pager is worded by
                          the group's own messages (`dataTablePagination` · `dataTablePrevious` ·
                          `dataTableNext` · `dataTablePage`; `labels`: pagination · previous · next · page),
                          not by `nav`'s; data-table-state.ts: useDataTable (controller; its `messages` are
                          the group's words as the hook read them, which the DataTable parts, calling no hook,
                          draw), dataTableReducer / dataTableView (pure). SortableList: a GridList put in
                          another order — by dragging, from the keyboard, or with move-up / move-down buttons
                          (`moveButtons`); items + onReorder(items, move), or defaultItems; `isItemDisabled`
                          pins a row (`GridListItem pinned`: not picked up, grip and move buttons off, still
                          reached by the arrow keys and selectable), `disabledKeys` switches a row off
                          altogether (react-aria's disabled row; it does not move either), `isDisabled` stops
                          every move; after a drag the focus is on the row that was dragged; the render prop
                          gets the row's own moves
    board/                Board: the kanban board — columns of cards dragged within a column and from one to
                          another (react-aria drag and drop between collections), a line where the card lands,
                          an empty column as a drop target, a WIP limit per column (count/limit, the column
                          marked over it), header actions and an "add" row per column (columnActions ·
                          columnAdd), a card drawn by a render prop inside the library Card; `isCardDisabled`
                          pins a card: it cannot be picked up (its grip is off) and is not activated, but the
                          arrow keys reach it and the controls drawn in it work; every column scrolls its own
                          cards and the board scrolls sideways. useBoard (state.ts — controller: itemsOf,
                          stateOf, move, canMove, add, remove, setItems; the `canMove(move)` option is the
                          veto), BoardDropIndicator
    display/              Card (variant · tone · wash · orientation · selected; given `href` or `onPress` it
                          is a link with the keyboard focus ring, the hover wash and the press nudge come with
                          `interactive`), CopyButton (a Button on useClipboard: text · label · copiedLabel;
                          slots copyIcon · copiedIcon for another glyph), Badge/Chip (a chip's remove button
                          is named after it, "Remove react"; a chip that goes while that button holds the
                          focus hands it to the next chip's, else the one before, else the ChipGroup, else the
                          control before where it stood; `isDisabled` dims the chip as a whole), ChipGroup,
                          Dot, Avatar/AvatarGroup, Kbd (`keys` drawn for a `platform`; left out, the server's
                          legend — `other`: Ctrl — is rendered first and an Apple device switches to ⌘ once it
                          has hydrated; a cap that is a word — Ctrl · Alt · Win · Esc · Space — is the hotkey
                          group's message for it, the entry HotkeyHint writes the same key from),
                          Code/CodeBlock (Shiki; a token's colour is a `var(--color-…)` reference, so a block
                          follows the scheme and the seeds of where it is rendered; a block whose code
                          overflows is a tab stop the arrow keys scroll, named `scrollLabel`, and one that
                          fits is not), Quote / Pullquote (`pad` sets a block's room; a Pullquote's side room
                          is its own), Separator, Skeleton, EmptyState, Stat, Meter, Alert/Banner (dismissed
                          while its close button holds the focus, it hands it to `focusTarget` or the control
                          before it), Timeline/TimelineItem (marker: dot · icon · avatar · number; tone; align
                          start · alternate; density; max → "show N more"; pending), ActivityFeed (on
                          Timeline: entries grouped by day under sticky headings, relative times read against
                          `now`; `timeZone` names the zone the days are told in: without it a server tells
                          them in UTC and the browser's zone follows once the page has hydrated, when every
                          time and day heading is written anew from the browser's clock; `headingLevel` 3 for
                          the day headings), DescriptionList/DescriptionItem = KeyValue (layout stacked ·
                          inline · grid 1–4, dividers, size, truncate, copy, copyLabel per entry),
                          LoadingOverlay (a veil over a positioned region, or `fullscreen`: veil wash ·
                          scrim · none; shows after `delay`, stays `minDuration`; what it covers is inert +
                          aria-busy) on useLoadingDelay (loading.ts), ErrorBoundary (a class: fallback node |
                          ({ error, reset }) => node, onError, onReset, resetKeys) + ErrorView (variant
                          block = EmptyState · inline = Alert; tone; details: causes + stack; onRetry),
                          ComparisonTable (features against plans: sticky head row + first column, highlighted
                          column, collapse → one Card per plan; headingLevel) + FeatureMark (check / dash),
                          PricingCard (a Card: name, badge, price · period · originalPrice, features, action,
                          highlighted, headingLevel) + PricingGrid (columns 1–4); context.ts:
                          TimelinePlaceContext, DescriptionContext
    markdown/             Markdown: a SUBSET of Markdown rendered with the library's own components (Heading,
                          Text, Link, Code/CodeBlock, Quote, Separator, a read-only Checkbox for tasks, a
                          plain table in the Table look). Nothing is ever injected as HTML: the text is
                          parsed into a typed tree and elements are built from it; raw markup shows as text.
                          headingOffset, size xs · sm · md · lg, externalLinks, allowImages, breaks,
                          highlight, copy, components (a renderer per node type), labels. parse.ts:
                          parseMarkdown / parseMarkdownInline (pure, linear, nesting capped at 16); url.ts:
                          sanitizeUrl (http · https · mailto · tel · relative only), isExternalUrl
    json/                 JsonView: a collapsible tree for any JSON-like value — objects, arrays, Map, Set,
                          typed arrays and class instances open and close; leaves in the code blocks' colours,
                          a cycle as `[circular $.path]`, what throws when it is read (a getter, an item, a
                          revoked Proxy) as a row of its error. A closed container shows a summary, a long one
                          its first `pageSize` entries and a "show more" row; the row under the pointer or the
                          focus has two CopyButtons (the value as JSON, the path). A hand-built `tree` of
                          `treeitem`s; `onSelect(path, value)` / `selected`, `rootLabel`, `sortKeys`,
                          `quoteKeys`, `stringLimit`, `size`, `maxHeight`, `grouping` (the counts in the
                          digits of the locale, plain with `false`; a number of the data is never formatted).
                          useJsonView (state.ts — controller: expanded paths, expandAll(depth?), collapseAll,
                          toggle, showMore), jsonPath / parseJsonPath / appendJsonPath (path.ts, pure)
    diff/                 DiffView: a text diff as a table of lines, no editor and no dependency — `before` +
                          `after` compared line by line (Myers; a coarser, bounded comparison past a budget),
                          or a `patch` (a unified diff, every file of it) drawn as it is. unified · split,
                          line numbers of both sides, the words that differ in a changed pair marked (`ins` /
                          `del`), unchanged runs folded into a row a press opens, a hunk or an opened fold
                          longer than `pageSize` (2000 rows) drawn a page at a time behind a "show more" row,
                          the view as a whole bounded too (`rowLimit`: 4000 lines it draws by itself, over all
                          its runs and the files of a patch; one last row brings the rest a page at a time,
                          lines a press asked for come on top, `Infinity` lifts it), `wrap`, `maxHeight`,
                          Shiki colours, a header with names, +N -M, copy buttons, the layout switch and
                          `actions`; state.ts: useDiffView (controller: mode, wrap, folds), diffViewReducer /
                          diffViewState (pure)
    chat/                 ChatMessage: one message — `from` user (end side) · assistant · system (centred),
                          avatar / author / time / actions slots, status sending · sent · error with retry,
                          streaming (ChatCaret, aria-busy), variant bubble · plain, tone, grouped. ChatList:
                          the transcript as a polite log that stays at the newest message until the reader
                          scrolls up, then a jump button (inert while it leaves; a focus on it goes to the
                          transcript); grouping, day separators, each named after its caption (`timeZone`
                          names the zone; without it the browser's own, and UTC on a server until the page has
                          hydrated), typing (ChatTyping) · empty · earlier slots. ChatComposer: a text that
                          grows to maxRows, Enter / Cmd+Enter send, send · stop, attachments as chips
                          (FileTrigger), maxLength counter. useChatScroll (state.ts): the list's scroll
                          controller, atEnd · unread · scrollToEnd()
    carousel/             Carousel + CarouselSlide: a native scroll-snap strip of slides — slidesPerView
                          1 · 2 · 3 · auto, gap, align start · center, horizontal or vertical — with
                          previous/next, dots (CarouselDots), a counter, arrow keys · Home · End on the track
                          and its controls, and autoplay with its pause button (waits while hovered, focused
                          or in a hidden tab; starts paused under reduced motion). useCarousel (state.ts —
                          controller: index, count — positions, not slides —, canPrev/canNext, prev/next/goTo,
                          playing, play/pause), createCarousel (store.ts, pure)
    chart/                SVG charts on a shared engine: Line, Area, Bar, Histogram,
                          Sparkline/SparkBar/SparkWin, Donut/Pie, Gauge, ProgressRing, RadialBar, Bullet,
                          Heatmap, Scatter, the Text… charts (TextBarChart, TextSparkline, TextHistogram, …),
                          ChartEmpty/ChartSkeleton; frame (Chart, Legend, Axis, Grid, HoverLayer). A chart is
                          laid out in the pixels its plot has: `Chart` / `ChartFrame` take a function of the
                          plot (`ChartDraw`) as children, measured in the browser (the server draws the
                          rectangle of the aspect preset, at rest), so the type keeps its size at any width
                          and a narrow chart gets fewer ticks. A chart hydrated from server markup does not
                          play its entrance again; one mounted in the browser does. A chart nobody named is
                          called by the group's messages: ChartFrame `wording`, HoverLayer `subject`.
                          engine.ts: scales, ticks, stacks, bins; paths.ts: linePath, areaPath, arcPath,
                          shapePath, polar, and coord / polarPoint (rounded, for an attribute); palette.ts:
                          chartTones, seriesColor, the class maps of a tone; inspect.ts: useChartIndex (the
                          inspector's controller); plain.ts: the text charts as plain strings (textBarLines,
                          textColumn, textTable, textTree, textTimeline, textLine, textWinLoss, textSparkline,
                          textSpark, textSparkGroup, textHeatmap, textCalendar, textGauge, textProgress,
                          textDonut)
    icons/                the ONE place an icon is defined: the curated Remix Icon set (PlusIcon,
                          ChevronDownIcon, … + Fill twins) via remix() + iconSet, and every icon a
                          component of the library draws itself — check marks, chevrons, close,
                          transport (media.tsx), loaders, the EffectTrace marks (effect.tsx). No
                          other file holds a `<path>` of an icon
    bg/                   Stripes, Dots backdrops (shared.ts: tone/strength/animation/speed presets); Ascii,
                          the animated character field — 11 patterns (ribbon, rain, waves, plasma, ripple,
                          tunnel, drift, scan, mesh, spiral, stars), glyph ramps and dithering in
                          ascii-field.ts (pure: a frame is a function of cols/rows/t); types.ts: AsciiCell,
                          AsciiPattern, AsciiPatternName, AsciiRampName, AsciiDither, AsciiSpeedName,
                          AsciiFrame
    motion/               Fade, Slide, Scale, Collapse, Presence, Stagger, Reveal, Crossfade, PageTransition
                          (the content of a page entering whenever `id` — a route, a hash — changes: `preset`,
                          `initial` for the page at mount, `exit` + `mode` + `onExitComplete` where the page
                          that leaves keeps its content until it is gone; off under Next's app router, whose
                          layout `children` follow the route), Counter (digits in the locale of react-aria's
                          useLocale(), or its own `locale`), TextReveal, Draw, Pulse, Shake, Marquee
                          (motion/react + animejs primitives)
    provider/             Provider: RouterProvider + I18nProvider + MotionConfig + theme seeds + the library's
                          own strings (`messages`) in one wrapper; MessagesProvider: that prop by itself, for
                          a subtree. Both lay their messages over what is provided above, group by group and
                          entry by entry. ui-messages.ts: UiMessages (a translation: each group's entries
                          under the group's name, all optional), UiMessageTables + uiMessages (every group's
                          English table), defineMessages (types a translation where it is written); theme.ts
                          (plain code): themeVars / themeStyle / themeProps, applyTheme, applyScheme,
                          readScheme, resolveScheme, onThemeChange, schemeScript; use-theme.ts: useTheme;
                          ThemeToggle
    effect/               EffectTrace: a recorded @ozaco/std/effect run played back — task tree +
                          timeline and events left, source right; `autoPlay` true · false · 'inView'
                          (starts when the panel scrolls into sight, stops when it leaves), `loop` +
                          `loopDelay` (ms of rest at the end before it starts again); the line under the
                          header and the lanes scrub the clock (press, drag — holding a running clock
                          until release —, ←/→ a mark, Home/End); EffectTaskTree/Events/Code/Controls/
                          Legend, useEffectClock; playback.tsx + scrub.ts (not in the barrel): the parts
                          the panel is made of — header, progress line, transport, log, code — and
                          useScrubber
    live/                 Effect-native bindings for std operations and flows, their tasks halted on unmount:
                          useLive (a Flow folded into state; status, reconnect), useOperation (an Operation
                          run and rendered: data · failure, refresh, polling, a keyed cache), useAction (a run
                          on demand), usePaged, useInvalidate (state.ts); LiveScope (the scope, the query
                          cache and `onFailure` for the hooks below), LiveInvalidator (re-runs keyed reads
                          from a change feed), LiveIndicator (a status Dot and its word); store.ts:
                          createOperationStore, createQueryCache, createActionStore (framework-free);
                          failure.ts: failureOf, failureText, unwrapOrThrow (a Result's value, or a thrown
                          Error whose cause is the Failure)
    terminal/             Terminal: a line-based scrollback + prompt rendered from a controller the consumer
                          owns — createTerminal() (store.ts, pure: write, writeln, print, update, remove,
                          clear, submit, lock, history, limit) / useTerminal(), useTerminalSnapshot
                          (state.ts), TerminalRow; `readOnly` drops the prompt: the view is then the log
                          itself and a tab stop, and with a prompt it shows the focus ring while the input has
                          the focus
    stepper/              Stepper: the step indicator of a multi-step flow — an ordered list of markers
                          (number · dot · icon), titles and connectors that fill as steps complete,
                          horizontal or vertical, pressable where the flow allows; a row is a container (give
                          it a width where its parent hugs its content) and folds to the current step's
                          words, then to markers only, before it overflows. Wizard + WizardStep: the
                          indicator, the panel of the step on screen (keepMounted, focus, slide) and a footer
                          with back/next/finish; `form={id}` makes next/finish the submit buttons of a Form.
                          useStepper (controller: linear or free, validate — sync or async — busy, setError),
                          createStepper (store.ts, pure: dispose), checkStepFields (fields.ts)
    tour/                 Tour: the guided introduction — steps anchored to elements, the page dimmed and
                          blurred around a cut-out, a card with back/next/skip (`headingLevel` 1–6: the
                          element of a step's title, h5 unless told otherwise; its size does not follow);
                          useTour (controller), TourCard, TourBackdrop
  internal/<group>/       constants and helpers of the group of the same name (and of `editor`): not exported
  icons/                  `@ozaco/ui/icons`: the full @remixicon/react + @radix-ui/react-icons sets,
                          `Icon as={…}`, `ri()`
  editor/                 `@ozaco/ui/editor`: Monaco CodeEditor/DiffEditor, `ozaco` + `ozaco-muted` themes in
                          both schemes (`vs-dark` · `vs` base, rebuilt on every theme change; Monaco themes
                          are global, so an editor inside a `data-theme` island keeps the page's theme);
                          options.ts: editorOptions, viewerOptions, diffEditorOptions, mergeEditorOptions;
                          workers.ts: setupMonacoWorkers (monaco is an optional peer dependency); palette.ts:
                          editorPalette / viewerPalette, their `--color-*` tokens and resolveEditorPalette
                          (nothing of Monaco: Code and CodeBlock read them); themes.ts: createEditorTheme,
                          defineOzacoThemes (typed with Monaco); languages.ts: editorLanguage(path), the
                          Monaco language id of a path, and languageLabel(id, plainText), handed the word for
                          a text with no language; status.ts: useMonacoStatus; frame.tsx: EditorHeader,
                          EditorFooter, EditorLoading, EditorFailed; messages.ts: editorMessages /
                          EditorMessages, the frame's own words under the group name `editor`; types/:
                          editor · monaco · palette

Live demo of every component and use case: apps/ui-demo (moon run ui-demo:dev). Visual regression runs through it: moon run ui-demo:visual-baseline before a change, moon run ui-demo:visual after it (every page in both schemes, held against the baseline: see apps/ui-demo/README.md).

Getting started

Requirements:

  • React 19 (react and react-dom, peer dependencies).
  • Tailwind CSS 4.1 or newer (a peer dependency): the classes use the pointer-coarse: variant, which 4.0 does not have.
  • TypeScript 5.4 or newer: the declarations use NoInfer, and so do react-aria-components' own.
  • moduleResolution bundler, node16 or nodenext: the package has an exports map only, so the legacy node10 resolution finds no types.
  • For @ozaco/ui/editor only: @monaco-editor/react 4.7 and monaco-editor 0.56 or newer, optional peer dependencies (the worker imports setupMonacoWorkers is handed resolve from 0.56 on).
@import 'tailwindcss';
@import '@ozaco/ui/theme.css'; /* tokens, keyframes, overlay.css */
@source '../node_modules/@ozaco/ui/dist';
import { Provider, Toaster, toast, Button } from '@ozaco/ui/components'

<Provider navigate={navigate} locale='tr-TR'>   {/* once, around the app */}
  <App />
  <Toaster placement='bottom-right' />          {/* once, if you use toast.* */}
</Provider>

<Button tone='primary' onPress={() => toast.success('Saved')}>save</Button>

Every interactive component is a styled react-aria component: RAC prop names pass through untouched (onPress, isDisabled, isSelected, onSelectionChange, isOpen, …) and the styles read RAC's data attributes (data-hovered, data-pressed, data-focus-visible, data-selected, data-invalid, data-entering/data-exiting). Shared interaction classes live in presets (@ozaco/ui/shared): focus, focusNative (the same ring on :focus-visible, for a plain element), focusWithin, focusInset / focusInsetNative (the ring drawn inside the element: rows, options, a scroll box), press, disabled, dimOnce (a disabled element inside a disabled one that dims keeps its full opacity, so the two are dimmed once; disabled and field hold it), hover, selected, field, input, floating.

Fields (TextField, Select, DatePicker, …) take FieldProps: label, description, errorMessage, and render Label → control → Description → FieldError. Validation comes from RAC (isRequired, validate, isInvalid, Form validationErrors). Every required field draws a red asterisk after its caption: generated content with an empty alternative text, so it is never part of the accessible name. requiredMark={false} on a field, a Fieldset or a Form, or data-required-mark='false' on any element around them, turns it off.

Build and Server Components

dist holds one file per source module under the same paths (dist/components/button/button.js); the four entries (components, shared, icons, editor) are barrels. With sideEffects: ["**/*.css"] a bundler keeps only the modules an app reaches.

'use client' is on the files that need it and only on those: a file that imports React, motion or react-aria, and every file that imports such a file. The entries carry no directive, so where React Server Components are in play (the Next.js App Router):

  • A Server Component can CALL the plain code: themeProps, themeStyle, schemeScript, defineMessages, uiMessages and every group's message table, mergeMessages, the pure helpers of @ozaco/ui/shared (clamp, the colour, scroll and time helpers, readStorage, …), parseMarkdown, sanitizeUrl, the chart engine and palette, the stores of live (createOperationStore, …).
  • A component imported into a Server Component renders as a client component.
  • A root layout spreads themeProps({ scheme: 'light', primary: '#2f81f7' }) on <html> and writes schemeScript('theme') into <head>. Provider messages needs a client wrapper there: see Messages.
  • The CommonJS build is the same files as .cjs; there the components entry itself is a client module. Server Components resolve the ESM build.

The build fails if provider/theme, provider/ui-messages or shared/utils/color ever reaches React: the guard is in tsdown.config.ts and names the chain.

Builder

import { component } from '@ozaco/ui/shared'
import { Box } from '@ozaco/ui/components'

export const Button = component('Button')
  .extend(Box)                                   // inherits base, variants, element, render
  .props<{ loading?: boolean }>()                // own props (type-only)
  .variants({ tone: { primary: '...', ghost: '...' }, block: { true: 'w-full' } })
  .defaults({ layout: 'inline', tone: 'primary' })
  .compound({ tone: 'primary', block: true, class: '...' })
  .slots('leading', 'trailing')                  // ReactNode props delivered as `slots`
  .polymorphic('button')                         // enables `as`, sets the default element
  .render(({ props: { loading, children, ...props }, slots, variants, Component }) => (
    <Component aria-busy={loading} {...props}>
      {slots.leading}{children}{slots.trailing}
    </Component>
  ))

<Button as='a' href='/' tone='ghost' leading={<Icon />}>Go</Button>
  • Every call returns a new builder; the generics accumulate (Props, Slots, Variants, Tag).
  • Types are reached through namespaces: Component.Builder, Component.Context, Polymorphic.Props, etc. Nothing else is exported.
  • Variant and slot props never reach the DOM. props.className inside render is the merged string (tailwind-merge; the caller's class wins).
  • render is optional for polymorphic components: build() renders <Component {...props} />.
  • .ref<T>() types ref on non-polymorphic components; polymorphic ones get it from as.
  • The finished component exposes styles(props) (class string) and config (for extend).

Theme

@ozaco/ui/theme.css is a Tailwind v4 @theme block. It removes every default Tailwind colour (--color-*: initial) and defines the palette, all values in oklch():

@import 'tailwindcss';
@import '@ozaco/ui/theme.css';
@source '../node_modules/@ozaco/ui/dist';
  • Neutrals: bg, bg-raised, bg-muted, bg-elevated, fg, fg-muted, fg-subtle, border, border-subtle, corner. html gets bg/fg and color-scheme (dark unless data-theme says otherwise); borders default to border.
  • Accents: orange, red, blue, green, navy, amber, yellow, cyan, magenta, five tones each, measured against bg / fg (WCAG 2.x):

| tone | use | guarantee | | ---- | ----------------- | ------------------------------- | | 100 | text tint | ≥ 9:1 on bg | | 200 | text | ≥ 6.5:1 on bg | | 300 | text / decoration | ≥ 4.5:1 on bg | | 400 | fill | fg on it ≥ 4.5:1, ≥ 3:1 on bg | | 500 | fill | fg on it ≥ 7:1 |

The handed-over colour sits at the slot its lightness belongs to (see comments in the file).

  • One config. Every base colour derives from seven seeds on :root: --ui-primary, --ui-success, --ui-warning, --ui-danger, --ui-info, --ui-bg, --ui-fg. Override them once and buttons, fields, charts, backdrops, the editor and syntax highlighting follow:

    :root {
      --ui-primary: #2f81f7;
      --ui-bg: #0b0f14;
    }
    <Provider theme={{ primary: '#2f81f7' }}>…</Provider>      // sets the seeds on <html>
    applyTheme({ primary: '#2f81f7' })                         // imperative, returns an undo
    <html style={themeStyle({ primary: '#2f81f7' })}>          // server rendering

    Code highlighting follows through CSS alone: a token is painted with color: var(--color-…), so nothing is highlighted again. The Monaco themes hold resolved colours and are rebuilt on onThemeChange (after every applyTheme and applyScheme). Any CSS colour works: accents take the seed's hue and chroma (in light as much of the chroma as sRGB holds, see "Two schemes") and a fixed lightness per step (--ui-l-100…500, so the contrast table below still holds); neutrals take the seed's tint. The raw hue scales (orange, cyan, …) stay fixed for charts and decoration.

  • Two schemes. Dark is the default; light is the same system mirrored. Every token is one light-dark(<light>, <dark>) value, so it follows the color-scheme of the element using it and no component knows which scheme it is in. data-theme picks it, on <html> or any subtree:

    | data-theme | scheme | | -------------- | ------------------------------- | | (none), dark | dark | | light | light | | system | the OS (prefers-color-scheme) |

    <Provider theme={{ scheme: 'light' }}>…</Provider>          // sets data-theme on <html>
    applyScheme('system')                                       // imperative, returns an undo
    <html {...themeProps({ scheme: 'light', primary: '#2f81f7' })}>   // server rendering
    <Box data-theme='dark'>…</Box>                              // a dark island in a light page

    The contrast table holds in both: 100 is the step farthest from bg, 500 the fill closest to it, text steps read on bg, fills carry fg (so a light fill carries dark text). light overlays move a surface towards fg and dark overlays towards bg in both schemes (bg-light/5 is a black wash on paper, bg-dark/30 a white well). The one overlay that does not mirror is scrim: what dims the screen behind Modal, Drawer, Command and the Tour is dark in both schemes (bg-scrim/60; dark: the black dark is, light: ink). The accent seeds serve both schemes: only their hue and chroma are read. In dark a step is the seed's hue and chroma at the step's lightness. In light a step is the seed's hue and as much of its chroma as sRGB holds at the step's lightness (--ui-light-c-100…500): at 0.36 / 0.43 / 0.52 most seeds' own chroma is outside sRGB, a browser clips that channel by channel, and clipping turns the hue (the orange seed read as red, beside danger). So on paper a vivid seed gets duller and never another colour; a seed that fits keeps all of its chroma (the red and blue defaults). The cap is CSS alone, two hue profiles (--ui-gamut-lo, --ui-gamut-hi) spliced into oklch(from <seed> …), so it holds for any seed, on <html> or on a scope, and for a ladder moved anywhere up to 0.85. It gives away a median 0.2% of the chroma sRGB holds: at the 100 and 200 steps up to 5% for blues at hue 257–263 and 16% in the one degree after pure blue; above the cusp up to 6% at 300 (purples), 13% at the 400 fill (reds) and 19% at the 500 fill (pinks and reds). Inside sRGB a step has the luminance its lightness promises: the text rows of the table (100–300 on bg) and the 500 fill hold for any seed; fg on the 400 fill of a loud pink, purple or crimson (hue 295–20, chroma from 0.2) measures 4.2–4.5. Two seeds close in hue stay close: orange and yellow, 16° apart, are 0.03–0.04 apart in OKLab at the text steps with all the chroma sRGB holds (0.04–0.05 in dark); only a duller warning, a lightness of its own or a hue further from primary parts them more. The light ladder is plain numbers (0.36, never 36%: the chroma is computed from it). --ui-light-c-<step>: c on a scope hands a step the seed's own chroma back. --ui-bg / --ui-fg seed dark; light has its own pair, --ui-light-bg / --ui-light-fg (theme={{ light: { bg, fg } }}), and its own ladder --ui-light-l-100…500. Set the scheme with data-theme, not with a color-scheme of your own: Tailwind's production build rewrites light-dark() and only the attribute carries it. tests/tokens.test.ts reads theme.css and proves the table for both schemes.

  • useTheme / ThemeToggle.

    const { scheme, resolved, setScheme, toggle } = useTheme({ storageKey: 'theme' })
    
    <ThemeToggle storageKey='theme' />                // dark ↔ light, aria-pressed
    <ThemeToggle system variant='outline' size='md' />   // dark → light → system (a monitor while it follows the OS)

    The state is data-theme on <html>, so every caller agrees without a context. storageKey keeps the choice in localStorage; put schemeScript('theme') in a <head> script so a reload never flashes the other scheme, and pass defaultScheme to say what the server rendered. ThemeToggle is a Button (variant, tone, size pass through): sun and moon swap with a turn and a pop, and the page changes as a circle growing out of the button (View Transitions API, theme-reveal in theme.css) — at once without the API, under reduced motion, or with animate={false}; reveal={false} keeps the icon swap only. The page stays live while the reveal plays: a press during it reaches what is under the pointer. onSchemeChange is called once the scheme is on the page: with the reveal a frame or two after the press, and after onPress.

  • Semantic aliases, the only colours components use: primary = orange, success = green, warning = yellow, danger = red, info = blue (bg-primary-400, text-primary-200, tint-danger-300, …). Re-tune the identity by re-pointing an alias in theme.css.

  • Fills use the 400 step under text-fg (hover 500), washes <tone>-400/20; only the neutral solid is bright (bg-fg text-bg). Text on bg uses the 200 step, borders/marks tint-*-300.

  • Terminal mapping (ANSI): black = bg, red, green, yellow, blue = navy, magenta, cyan, white = fg; "normal" is the 300 step, "bright" the 100 step. Anything that cycles colours (chart series, backdrop tones, badges) follows primary, cyan, green, yellow, magenta, blue, red, navy.

  • corners utility: ⌜ ⌝ ⌞ ⌟ right-angle marks drawn over the border at all four corners via a ::before overlay (--corners-size 8px, --corners-weight 1px). Colour defaults to corner; tint-<token> colours a scope/card in one go: border takes the token, marks derive two tones lighter (relative colour syntax). corners-<token> overrides the mark colour explicitly.

  • Box surface: layer outlined container · scope outline + corner marks, innermost boxes only. Box color: muted (bg-dark/30) sinks, bright (bg-light/5) lifts; Box blur: xs…3xl backdrop blur, independent of color; overlays compound.

  • Hierarchy: app, content and sections carry no surface; subsections are layer; innermost boxes are scope. Buttons carry no marks by default (surface='scope' opts in).

Messages

Every string the library supplies by itself (captions, placeholders, accessible names, status words, sentences with a value in them) is an entry of a table, one table per group: components/<group>/messages.ts exports navMessages / NavMessages, fileMessages / FileMessages, …, and @ozaco/ui/editor has editorMessages. A consumer replaces them in one place, without touching a prop:

// messages/tr.ts: one group, or all of them; what is left out stays English
import { defineMessages } from '@ozaco/ui/components'

export const tr = defineMessages({
  nav: {
    paginationPrevious: 'Ö