Skip to content

Pass-through (`pt`) cheat sheet

Every Cratis wrapper forwards PrimeReact’s pt, ptOptions, and unstyled props somewhere — but where depends on how much PrimeReact the wrapper composes. This page summarizes the pattern per component so you know which prop to reach for.

The wrapper renders exactly one PrimeReact widget and forwards pt / ptOptions / unstyled / className straight to it. The pt slot names are PrimeReact’s own — see the underlying component’s documentation.

WrapperUnderlying widgetpt slot reference
Dialogprimereact/dialog DialogPrimeReact Dialog pt
Dropdownprimereact/dropdown DropdownPrimeReact Dropdown pt
InputTextFieldprimereact/inputtext InputTextPrimeReact InputText pt
TextAreaFieldprimereact/inputtextarea InputTextareaPrimeReact InputTextarea pt
NumberFieldprimereact/inputnumber InputNumberPrimeReact InputNumber pt
DropdownFieldprimereact/dropdown DropdownPrimeReact Dropdown pt
RadioGroupFieldprimereact/radiobutton RadioButton (one per option)PrimeReact RadioButton pt
RadioButtonFieldprimereact/radiobutton RadioButtonPrimeReact RadioButton pt
CalendarFieldprimereact/calendar CalendarPrimeReact Calendar pt
CheckboxFieldprimereact/checkbox CheckboxPrimeReact Checkbox pt
SliderFieldprimereact/slider SliderPrimeReact Slider pt
ChipsFieldprimereact/chips ChipsPrimeReact Chips pt
MultiSelectFieldprimereact/multiselect MultiSelectPrimeReact MultiSelect pt
ColorPickerFieldprimereact/colorpicker ColorPickerPrimeReact ColorPicker pt
EventsViewprimereact/timeline TimelinePrimeReact Timeline pt

Example:

<InputTextField
value={c => c.email}
title="Email"
pt={{ root: { className: 'border-2 border-sky-500' } }}
/>

The wrapper composes more than one PrimeReact widget and exposes a sibling set of *Pt / *PtOptions / *Unstyled / *ClassName props per slot.

CommandDialog is a single Dialog and forwards pt/ptOptions/unstyled to that Dialog.

StepperCommandDialog composes a Dialog and a Stepper:

PropTargets
pt / ptOptions / unstyledThe inner PrimeReact Stepper.
dialogPt / dialogPtOptions / dialogUnstyled / dialogClassNameThe outer PrimeReact Dialog.
<StepperCommandDialog<RegisterAuthor>
command={RegisterAuthor}
title="Register author"
pt={{ stepperpanel: { content: { className: 'pt-6' } } }}
dialogPt={{ header: { className: 'bg-slate-900 text-slate-50' } }}
dialogClassName="shadow-2xl"
>
</StepperCommandDialog>

DataTableForQuery and DataTableForObservableQuery each compose a DataTable and a Paginator:

PropTargets
pt / ptOptions / unstyled / classNameThe inner DataTable.
paginatorPt / paginatorPtOptions / paginatorUnstyledThe inner Paginator.

DataPage composes a DataTable and a Menubar:

PropTargets
tablePt / tablePtOptions / tableUnstyled / tableClassNameThe inner DataTable.
menubarPt / menubarPtOptions / menubarUnstyled / menubarClassNameThe action Menubar.
<DataPage<AllAuthors, Author, never>
title="Authors"
query={AllAuthors}
tablePt={{ table: { className: 'min-w-full divide-y divide-slate-700' } }}
menubarPt={{ root: { className: 'px-3 py-2 bg-slate-900' } }}
>
<DataPage.MenuItems></DataPage.MenuItems>
<DataPage.Columns></DataPage.Columns>
</DataPage>

These wrappers render many PrimeReact widgets internally (InputText, InputNumber, Checkbox, Calendar, InputTextarea, Dropdown, Button, Menubar, …). Exposing a pt prop per inner widget would be impractical; instead, they expose className on the root for layout/positioning, and you restyle their internals via the global pt preset on CratisComponentsProvider.

WrapperWhat it acceptsHow to restyle internals
ObjectContentEditorclassNameGlobal pt on CratisComponentsProvider covering inputtext, inputnumber, checkbox, calendar, inputtextarea.
ObjectNavigationalBarclassNameGlobal pt covering button; --cratis-surface-border for the bottom border.
SchemaEditorclassNameGlobal pt covering menubar, button, datatable, dropdown, inputtext.

Example with a global preset:

<CratisComponentsProvider value={{
unstyled: true,
pt: {
inputtext: { root: { className: 'my-input' } },
inputnumber: { input: { root: { className: 'my-input' } } },
button: { root: { className: 'my-btn' } },
/* … */
}
}}>
<ObjectContentEditor object={data} schema={schema} editMode />
</CratisComponentsProvider>

A pt preset on CratisComponentsProvider flows into every PrimeReact widget rendered by every wrapper — including the internals of the large composites. Per-instance pt props on individual wrappers are merged with the global preset (PrimeReact’s ptOptions.mergeSections defaults to true).

To replace a slot’s preset entirely on a single instance, opt out of merging:

<Button label="Special" pt={{ root: { className: 'special-btn' } }}
ptOptions={{ mergeSections: false }} />

Components that do NOT accept per-instance pt

Section titled “Components that do NOT accept per-instance pt”
  • BusyIndicatorDialog — the dialog is rendered by the dialog host on demand and the request type lives in @cratis/arc.react, so no per-instance prop is plumbed through. Use the global pt on CratisComponentsProvider to restyle it.