Component library

All components registered in lib/controls/registry.ts. Each has a detail page at /documentation/components/{slug}.

Content (12)

SlugComponentDescription
accordionAccordionExpandable section with animated panel
accordion-groupAccordionGroupMultiple accordions with shared or independent open state
cardCardBordered content container
data-gridDataGridTabular data with column configuration
empty-stateEmptyStatePlaceholder for empty lists or search results
panelPanelSurface panel with optional heading
show-moreShowMoreTruncated text with expand/collapse
sidebarSidebar, SidebarGroup, SidebarLink, SidebarNavIcon-led side navigation surface
skeletonSkeletonLoading placeholder shapes
tableTableSemantic HTML table wrapper
tabsTabsTabbed content panels
top-navigationTopNavigation, TopNavigationMenuApplication menu bar with dropdown menus

Sidebar exports

import {
  Sidebar,
  SidebarGroup,
  SidebarHeader,
  SidebarLink,
  SidebarNav,
} from "@/components/fields";

Top navigation exports

import {
  TopNavigation,
  TopNavigationMenu,
  useTopNavigation,
  defaultTopNavigationMenus,
} from "@/components/fields";

TopNavigationMenu accepts label and items (or custom children for mega-menu panels). It wraps DropdownMenu internally.


Forms (25)

Forms controls use FieldShell unless noted. Button variants share the Button component.

SlugComponentNotes
buttonButtonStandalone button, multiple variants
submit-buttonButtontype="submit"
reset-buttonButtontype="reset"
checkboxCheckboxFieldRound or square shape
switchSwitchFieldToggle switch
radio-groupRadioGroup, RadioSingle choice from a set
color-pickerColorFieldNative colour input
date-pickerDateFieldtype="date"
time-pickerDateFieldtype="time"
datetime-pickerDateFieldtype="datetime-local"
month-pickerDateFieldtype="month"
week-pickerDateFieldtype="week"
email-inputTextFieldtype="email"
url-inputTextFieldtype="url"
search-inputTextFieldtype="search"
file-uploadFileFieldFile picker with drag area
hidden-inputHiddenFieldVisually hidden input
number-inputNumberFieldNumeric input with step controls
password-inputTextFieldtype="password"
range-sliderRangeFieldRange slider
selectSelectFieldDropdown select
text-inputTextFieldSingle-line text
textareaTextAreaFieldMulti-line text
rich-text-fieldRichTextFieldFormatted text editor with toolbar
theme-toggleThemeToggleFieldLight/dark toggle with sun/moon icons

FieldShell modes

ModeBehaviour
stackedLabel above control
flaggedCompact inline label

Label position (left / right) applies in flagged mode.


Overlays (10)

SlugComponentDescription
command-paletteCommandPaletteKeyboard-driven command search
context-menuContextMenuProvider, ContextMenuTargetRight-click menu (provider pattern)
dialogDialogConfirmation / prompt dialog
drawerDrawerSlide-in panel from an edge
dropdown-menuDropdownMenuClick-triggered menu
modalModalCentred overlay dialog
popoverPopoverAnchored floating panel
alertAlertInline status message (info, success, warning, error)
toastToast, ToastProviderTransient notification (provider pattern)
tooltipTooltipHover/focus help text

Provider patterns

Toast — wrap the app (or section) in ToastProvider, then call useToast().show(...):

<OpusThemeProvider theme="dark">
  <ToastProvider>
    {children}
  </ToastProvider>
</OpusThemeProvider>

Context menu — same pattern with ContextMenuProvider + ContextMenuTarget:

<ContextMenuTarget items={[...]} onSelect={...}>
  {children}
</ContextMenuTarget>

Both providers read theme from OpusThemeProvider via useOpusTheme().


Playground controls

  • The source/preview split width persists between sessions and is restored before the split view becomes visible, avoiding a load-time width jump.
  • The source pane can be reduced to 15% of the Playground width.
  • Use Cmd+A on macOS or Ctrl+A elsewhere to select all source while the editor is focused.
  • Reset preview is a frame-level action in the Preview options menu. It clears saved preview-layout state and remounts the rendered example without adding controls to preview content.
  • Open External opens the current Playground code in a dedicated browser window.

Source files

Each registry entry lists its sourceFiles — the React component and CSS module that implement it. Open the detail page for a component to see the live preview and generated usage code.