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
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, close, content, footer, confirm, canceldivs/header/heading/footer/buttons
DropdownPartsroot, input, select, trigger, value, clear, indicator, popover, listbox, option, filter, multiplewrapper, input/button, spans, popover/listbox/options, select
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, emptyCelldiv/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
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
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; choices use root, input, label, plus box/indicator or control/handle
Dialogbackdrop, positioner, root, header, title, close, content, footer, confirm, cancel
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, filter-trigger, filter-popover, filter-menu, filter-actions, body, row, cell, empty-row, empty-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, box, control, handle, indicator, option, item, remove, value, star, toggle)
Displaycomponent roots plus image, fallback, remove, indicator, range, track, and labels where applicable
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

header-content, sort, 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-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.