Rime

FolderTabs and SegmentedControl

Folder tabs that sit on a glass panel with always-visible counts, and a segmented control for views.

FolderTabs switch between queues of the same list (Open, In review, Cancelled). Each tab shows its count so the workload reads without opening each; the panel's top-left corner squares off so the tabs sit on it.

SegmentedControl switches the view of the same content (Chart or Table, List or Board). The active segment is a white key lifted out of a recess.

Installation

npx shadcn@latest add KezLahd/rime/tabs

Also installs: base, glass-panel.

Usage

import { FolderTabs, SegmentedControl } from "@/components/ui";

<SegmentedControl aria-label="View" value={view} onChange={setView} options={[{ value: "chart", label: "Chart" }, { value: "table", label: "Table" }]} />

Examples

Folder tabs

Showing the open queue.

Segmented control

API

Generated from the component's TypeScript types and JSDoc (scripts/gen-ui-registry.mjs), so it always matches the source.

FolderTabs

FolderTabs props
PropTypeDefaultDescription
tabsRequiredReadonlyArray<FolderTab>
valueRequiredstring
onChangeRequired(id: string) => void
aria-labelRequiredstring
childrenRequiredReactNodeContent of the active tab's panel.
panelPaddingGlassPanelProps["padding"]"md"
panelVariantGlassPanelProps["variant"]"page"
classNamestring

SegmentedControl

SegmentedControl props
PropTypeDefaultDescription
optionsRequiredReadonlyArray<SegmentedOption<V>>
valueRequiredV
onChangeRequired(value: V) => void
aria-labelRequiredstring
size"sm" | "md""md"
classNamestring

Theme tokens

Per-component tokens are undeclared by default, so the default shown is the fallback the CSS uses. Set one at :root (or in theme.css) to restyle every instance. Live values are read from this page, so they follow the Rime Studio.

FolderTabs and SegmentedControl per-component tokens
TokenDefaultLive value
--r-flatmax(0px, calc(var(--segmented-radius, var(--r-sm)) - 3px))…
--segmented-radiusvar(--r-sm)…
--tab-brand-active-from#fdfcff…
--tab-brand-active-to#f3eefb…
--tab-brand-from#f7f4fc…
--tab-brand-ink#4e3470…
--tab-brand-rgb78, 52, 112…
--tab-brand-to#efe9f8…
--tab-pad-xcalc(20px * var(--density))…
--tab-radiusvar(--r-md)…

System tokens it reads

FolderTabs and SegmentedControl system tokens
TokenDefaultLive value
--danger-inktokens.css…
--densitytokens.css…
--durtokens.css…
--dur-fasttokens.css…
--easetokens.css…
--focus-colortokens.css…
--focus-ringtokens.css…
--ink-bodytokens.css…
--ink-brandtokens.css…
--ink-disabledtokens.css…
--ink-mutedtokens.css…
--ink-secondarytokens.css…
--r-mdtokens.css…
--r-smtokens.css…
--recess-filltokens.css…
--rgb-brandtokens.css…
--rgb-contacttokens.css…
--rgb-whitetokens.css…
--shadow-paneltokens.css…
--shadow-recesstokens.css…
--shadow-speculartokens.css…
--success-inktokens.css…
--surface-solidtokens.css…
--text-captiontokens.css…
--text-smalltokens.css…
--warning-inktokens.css…

Accessibility

  • FolderTabs implement the ARIA tabs pattern: role="tablist", arrow keys move between tabs, the panel is role="tabpanel".
  • SegmentedControl is a radiogroup: arrow keys change the value.

Do and don't

Do

  • Always show counts on folder tabs.

Don't

  • Don't use folder tabs for page navigation; that is the sidebar.

For AI agents

This page as markdown, rendered from the same registry entry. Point an agent at it (or add .md to this page's URL), or at /llms.txt for the index.

Open tabs.md