Skip to content

Stable component parts

Components exposes two related styling surfaces:

  • Typed pt keys use camel case and accept ordinary HTML attributes for one component instance.
  • DOM part values appear in data-cratis-part and use kebab case where a name contains several words.

They are documented separately because not every DOM part needs a pt key, and the spellings are intentionally different (headerRow versus header-row).

<Dialog
title='Edit account'
pt={{
backdrop: { className: 'account-dialog-backdrop' },
root: { className: 'account-dialog' },
content: { className: 'account-dialog-content' },
}}
>
Content
</Dialog>
Component/typeTyped pt keysElement types
ButtonParts / IconButtonPartsroot, icon, label, spinnerbutton, spans
TextInputParts / TextAreaPartsrootnative input or textarea
NumberInputPartsroot, group, input, prefix, suffix, step, description, errorowned number-field composition
CheckboxParts / RadioPartsroot, input, box, indicator, labellabel, native input, spans
SwitchPartsroot, input, control, handle, labellabel, native input, spans
SurfacePartsrootdiv, section, or article
DialogPartsbackdrop, positioner, root, header, title, subtitle, close, content, footer, confirm, canceldivs/header/heading/footer/buttons
ToggleGroupPartsroot, option, icon, labelgroup/buttons
TabsPartsroot, list, tab, paneldivs/tabs/panels
TagGroupPartsroot, list, tag, remove, inputdiv/list/tags/buttons/input
BreadcrumbsPartsroot, item, link, separatornav/ol/li/links
DropdownPartsroot, input, select, trigger, value, clear, indicator, popover, listbox, option, filter, multiplewrapper, input/button, spans, popover/listbox/options, select
ComboBoxPartsroot, input, trigger, popover, listbox, option, optionLabel, optionDescription, loading, empty, failure, action, description, errorwrapper, input, button, popover/listbox/options, status text
DatePickerInputPassThroughroot, group, input, placeholder, segment, trigger, popover, dialog, calendar, header, heading, previous, next, grid, cell, buttonBar, today, cleardivs, segmented field, buttons, calendar grid/cells
DataTablePartsroot, search, searchInput, tableContainer, table, head, headerRow, headerCell, body, row, cell, emptyRow, emptyCell, loadingRow, loadingCell, failureRow, failureCelldiv/input/table sections/rows/cells
ColumnFilterMenuParts (Column.filterPt)trigger, popover, menu, matchMode, input, actions, clear, applybutton, overlay/menu, inputs, actions
TablePaginatorPartsroot, range, info, first, previous, next, lastnavigation div, spans, and Button parts
StepperPartsroot, list, step, header, number, title, separator, panels, paneldiv, ordered list, list item, button, spans, section
ChatSidebarPartsbackdrop, root, header, title, back, close, contentbackdrop/panel divs, header, heading, buttons
EventsViewPartstimeline, event, separator, marker, connector, contenttimeline divs and event elements
ToasterPassThroughregion, toast, icon, content, title, description, close, actionregion/article/divs/spans/buttons
ToolbarParts / ToolbarButtonPartstoolbar root; button root, icon, labeltoolbar div and native buttons/spans
ToolbarGroupParts / ToolbarLayoutPartsroot, slot, incoming, outgoinggroup/layout and transition measurement divs
ToolbarSectionPartsroot, contextanimated section and named context divs
ToolbarSeparatorPartsrootnative separator div
ToolbarFolderParts / ToolbarFanOutPartsroot, trigger, panelcomposition div, native trigger, and inert collapsed panel
ActionMenubar ptthe ButtonParts keys applied to each actionbutton and spans
Query table / DataPage paginatorPtTablePaginatorPartspaginator surface
DataPage tablePtDataTablePartstable surface
DataPage menubarPtButtonPartsaction buttons

Command field part keys:

FieldTyped keys
InputText / TextArearoot (the native control; see the DOM note below)
Numberroot, input
NumberInputroot, group, input, prefix, suffix, step, description, error
Checkboxroot, input, box, indicator
ToggleSwitchroot, input, control, handle
Passwordroot, input, toggle
RadioButtonroot, input, box, indicator
RadioGrouproot, option, input, box, indicator
Sliderroot, input, value
Chipsroot, item, remove, input
ColorPickerroot, input, value
Ratingroot, option, input, star
CalendarDatePickerInputPassThrough keys
Dropdown / MultiSelectDropdownParts keys

InputTextParts.root applies to the native element carrying data-cratis-part='input'; TextAreaParts.root applies to data-cratis-part='textarea'. The typed key is retained for source compatibility, but there is no extra field-root DOM wrapper.

Named behavior props override conflicting part attributes. Part classes and styles merge with component structure. DropdownParts.input and select are narrow Components 3 migration aliases for class, style, id, and ARIA values; attach event handlers and other ordinary attributes to the current trigger, filter, multiple, listbox, or option part instead.

Use the exact kebab-case value in CSS or tests:

Surfacedata-cratis-part values
Buttonroot, icon, label, spinner
Basic controlstext inputs and surfaces use root; NumberInput uses root, group, input, prefix, suffix, step, description, error; choices use root, input, label, plus box/indicator or control/handle
Dialogbackdrop, positioner, root, header, title, subtitle, close, content, busy-scope, footer, confirm, cancel
ComboBoxroot, input, trigger, popover, listbox, option, optionLabel, optionDescription, loading, empty, failure, action, description, error
ToggleGrouproot, option, icon, label
Tabsroot, list, tab, panel
TagGrouproot, list, tag, remove, input
Breadcrumbsroot, item, link, separator
Dropdownroot, trigger, value, clear, indicator, filter, popover, listbox, option, multiple
DatePickerroot, group, input, placeholder, segment, trigger, popover, dialog, calendar, header, heading, previous, next, grid, cell, button-bar, today, clear
DataTableroot, search, search-input, table-container, table, head, header-row, header-cell, header-content, sort, select-all, filter-trigger, filter-popover, filter-menu, filter-actions, body, row, cell, empty-row, empty-cell, loading-row, loading-cell, failure-row, failure-cell
TablePaginatorroot, range, info; paginator buttons expose the documented Button parts
Stepperroot, list, step, header, number, title, separator, panels, panel
Toasterregion, toast, icon, content, title, description, action, close
Tooltippopup; a standalone trigger uses trigger, while a composed child preserves its own component part and gains data-cratis-tooltip-trigger
Command fieldsroot, plus the typed field-specific values listed above (input, textarea, group, box, control, handle, indicator, option, item, remove, value, star, toggle)
Displayevery component has root; Avatar adds image, fallback; Chip adds icon, label, remove; Message adds icon, text; ProgressBar adds indicator, label; ProgressSpinner adds svg, track, range; Tag adds icon, label
Chat sidebarbackdrop, root, header, title, back, close, content
Event timelinetimeline, event, separator, marker, connector, content
Toolbarroot, button, icon, label, fanout-root, fanout-trigger, fanout-panel, toolbar-group, toolbar-separator, toolbar-layout, toolbar-section, toolbar-context, toolbar-slot, toolbar-slot-incoming, toolbar-slot-outgoing, toolbar-folder, toolbar-folder-trigger, toolbar-folder-panel

busy-scope wraps the Dialog content and footer in a fieldset that is disabled while the dialog is busy; it has no DialogParts key. ComboBox is the one surface whose multi-word DOM values keep the camel-case spelling of its keys (optionLabel, optionDescription); match them exactly.

The DataTable root exposes data-busy and the native table exposes aria-busy="true" during a refetch with rows. A failure row exposes data-reason="failed" or "unauthorized"; loading and failure messages have an inner status or alert element, not a role on the row.

header-content, sort, select-all (the multiple-selection header checkbox), and filter-trigger are DOM targets but are not DataTableParts keys. Customize them with CSS rather than claiming a nonexistent typed key.

Tooltip enhances the actual focusable child. If that child already has a component-specific data-cratis-part (for example button, toolbar-folder-trigger, or fanout-trigger), Tooltip preserves it and adds data-cratis-tooltip-trigger. It uses data-cratis-part='trigger' only for a child without its own stable part.

[data-cratis-part='header-cell'] {
text-transform: uppercase;
}
[data-cratis-part='row'][data-selected='true'] {
background: var(--product-selected-row);
}

State attributes are component-specific. Common values include:

AttributeMeaning
data-activeActive filter, step, or action.
data-selectedSelected row, option, or value.
data-invalidValidation error state.
data-disabledDisabled component state.
data-readonlyRead-only date/control state.
data-loadingLoading toast/action.
data-positionOverlay, timeline, or region position.
data-placementDialog viewport placement: center, start, end.
data-orientationHorizontal/vertical layout.
data-sizeComponent size variant.
data-severitySemantic status tone.

Do not assume an attribute exists on every component; use its documented parts/type and inspect the rendered Cratis contract in tests.

ptOptions and unstyled remain accepted temporarily for Components 3 source compatibility. They have no effect: typed Cratis attributes always merge, and styling is always CSS-owned.