Skip to content

Components

The dashboard is built from a library of React components, exported from alinea/components. Use them in custom fields, Field.view sections and custom entry or root views, so your additions look and behave like the rest of the dashboard, in light and dark mode.

import {Button, Dialog, Table} from 'alinea/components'

Actions and navigation

Forms

  • <TextField>
  • <NumberField>
  • <SearchField>
  • Status
    <Select>4 parts
  • Materials
    Linen
    Oak
    <MultipleSelect>2 parts
  • <ComboBox>2 parts
  • <Checkbox>
  • Locales
    <CheckboxGroup>
  • Visibility
    <RadioGroup>2 parts
  • <Switch>
  • Publish date
    9232026
    <DateField>
  • Opening time
    0930
    <TimeField>
  • Launch date
    <DatePicker>
  • Sale period
    <DateRangePicker>
  • Delivery date, September 2026

    30
    31
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    1
    2
    3
    <Calendar>2 parts
  • Tags
    Linen
    Bedroom
    Summer
    Sale
    <TagGroup>2 parts
  • <ColorSwatchPicker>3 parts
  • Or drag and drop images here.
    <DropZone>3 parts
  • Horizontal focal point of the hero image
    <Field>5 parts

Collections

  • Image
    Title
    Status
    <Table>2 variants
  • Linen shirtMaya Janssens · 10:48
    Draft
    Oak dining chairTom Verbeke · Yesterday
    Published
    <List>9 parts
  • HeroAutumn collection
    ProductsNew in linen
    QuoteFrom the workshop
    <SortableList>13 parts
  • Home
    Products
    Linen shirt
    Oak dining chairDraft
    Journal
    <Tree>2 parts
  • Status
    Published
    Created by
    Maya Janssens
    Path
    /products/linen-shirt
    <DataList>4 parts
  • <ContentGrid>2 parts
  • <ContentCard>2 variants
  • Oak dining chair
    <MediaPreview>

Overlays

  • Delete “Linen shirt”?

    This can’t be undone.

    <Dialog>9 parts
  • <DropdownMenu>14 parts
  • Choose where this entry is shown.
    <Popover>4 parts
  • Open preview in a new tab
    <Tooltip>3 parts
  • Text
    Image
    Hero
    Quote
    <Command>7 parts

Feedback and text

  • Not translated yet
    This product page has no French version.
    <Alert>3 variants
  • PublishedDraftPage
    <Badge>2 sizes
  • No blog posts yet
    Posts you write in the journal show up here.
    <Empty>2 variants
  • <Spinner>3 sizes
  • Published
    Last edited
    <Timestamp>
  • Oak dining chair

    Materials

    Care instructions

    Visual size is independent of the element

    <Heading>5 sizes
  • Stonewashed linen that softens with every wash.

    Our Linen shirt is cut from European flax.

    Last edited by Maya Janssens

    In stockLow stockSold out
    <Text>4 sizes
  • The product lives at /products/linen-shirt in the Products root.

    const Product = Config.document('Product', {
      fields: {
        title: Field.text('Title'),
        price: Field.number('Price')
      }
    })
    <Code>3 variants
  • ⌘ KEscSave a draft with ⌘ S
    <Kbd>2 sizes
  • We build every chair to outlast the table it stands at.
    <Blockquote>
  • <Icon>
  • <FoldIcon>

Layout

  • Shipping
    Free delivery on orders over €150.
    Belgium · 2 days
    <Surface>2 variants
  • Machine wash at 40°C.

    Tumble dry low, iron while damp.

    <Collapsible>3 parts
  • Linen shirt

    Draft
    <Page>7 parts
  • Oak & Loom

    Linen shirt

    <AppShell>2 parts
  • Oak & Loom
    Pages
    Home
    Products
    Linen shirt
    <Sidebar>8 parts
  • <NavRail>5 parts
  • Pages
    Linen shirt
    Details
    <ResizablePanelGroup>3 parts
  • <PreviewFrame>2 parts

Entry points

Custom dashboard code imports from two entry points:

  • alinea/components: generic UI building blocks, such as buttons, inputs, dialogs and tables. They don't know about your content and work anywhere inside the dashboard.

  • alinea/cms: what is tied to the CMS, such as the hooks that read and write field values, the entry being edited and the signed-in user, FieldChrome and the prop types of field, type and root views. See the alinea/cms API in Custom fields.

A custom stock overview panel in the pricing tab, calculated from the price and finishes of the productA custom stock overview panel in the pricing tab, calculated from the price and finishes of the product
A stock overview panel in the demo, a custom view built with alinea/components.

Usage

fields/Priority.view.tsx
import {type FieldViewProps, useField, useFieldOptions} from 'alinea/cms'
import {Select, SelectItem} from 'alinea/components'
import type {Priority, PriorityField} from './Priority'

export function PriorityView({field}: FieldViewProps<PriorityField>) {
  const [value, setValue] = useField(field)
  const options = useFieldOptions(field)
  return (
    <Select
      label={options.label}
      value={value}
      onValueChange={next => setValue((next ?? 'normal') as Priority)}
      readOnly={options.readOnly}
    >
      <SelectItem value="low">Low</SelectItem>
      <SelectItem value="normal">Normal</SelectItem>
      <SelectItem value="high">High</SelectItem>
    </Select>
  )
}

The components are styled by the dashboard's stylesheet and theme, so they are meant for code that runs inside the dashboard.

Conventions

The API follows shadcn/ui and Radix, so the names will feel familiar:

  • Compound components are named after their parts: Dialog, DialogTrigger, DialogContent, DialogTitle.

  • Controlled and uncontrolled state use the same prop names everywhere: value, defaultValue and onValueChange; checked and onCheckedChange; open, defaultOpen and onOpenChange.

  • Form controls take label, description, error, required, disabled, readOnly, icon and shared, and render their label and messages with Field.

  • Dates and times are ISO strings (2026-09-23, 14:30). Collection keys are strings or numbers, and a selection is a Set of keys or 'all'.

  • Every component accepts className and style. Each rendered part has a data-slot attribute (data-slot="dialog-content"), and variants are exposed as data-variant and data-size, which gives your CSS stable hooks.

  • Colors, fonts and radii come from CSS variables such as --alinea-fg, --alinea-bg, --alinea-border, --alinea-primary and --alinea-radius. Use them in your own styles to follow the theme.

The props of every component are typed, so your editor shows what each one accepts. Types shared between components, such as Selection, Key and IconType, are exported as types from alinea/components too.

Icons

Components with an icon prop take an icon component (any component that renders an <svg>, such as those from react-icons or copied from Icones) or an element. The icons of the dashboard itself are exported from alinea/dashboard/icons.