Field
Names a control, says whether it is required, and carries the description and the error a reader hears with it.
Invoices are sent to this address.
import { Field, FieldDescription, FieldLabel } from '@slotted/react/field';import { TextField } from '@slotted/react/text-field';export default function FieldBasic() { return ( <Field required> <FieldLabel>Email</FieldLabel> <TextField type="email" autoComplete="email" /> <FieldDescription>Invoices are sent to this address.</FieldDescription> </Field> );}Installation
The packages are a 0.x beta on npm, and their public API changes between beta releases without deprecation. One line installs the binding and the default theme.
pnpm add @slotted/react @slotted/theme @slotted/themesimport { Field, FieldAction, FieldControl, FieldCounter, FieldDefaultsProvider, FieldDescription, FieldError, FieldHeader, FieldHelp, FieldIndicator, FieldLabel } from '@slotted/react';Necessity
A required field draws an asterisk after its label by default, and the control carries aria-required, so a screen reader announces “required” and never reads the asterisk. In a form where most fields are required, set necessity="optional" to mark the exception instead: (optional) appears on the fields a reader may skip and nothing appears on the rest. necessity="words" writes (required) and (optional) in full.
import { Field, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldNecessity() { return ( <Stack gap={5}> <Field required> <FieldLabel>Company name</FieldLabel> <TextField /> </Field> <Field necessity="optional"> <FieldLabel>Purchase order</FieldLabel> <TextField /> </Field> <Field necessity="words" required> <FieldLabel>Tax ID</FieldLabel> <TextField /> </Field> </Stack> );}Label placement
labelPlacement="side" puts the label in a column beside its control, so the labels of a settings form line up and the controls start on one edge. A description stays under the control, not under the label.
Invoices and payment receipts are sent here.
import { Field, FieldDescription, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldPlacement() { return ( <Stack gap={4}> <Field labelPlacement="side" required> <FieldLabel>Legal name</FieldLabel> <TextField defaultValue="Northwind Traders Ltd." /> </Field> <Field labelPlacement="side" required> <FieldLabel>Billing email</FieldLabel> <TextField type="email" defaultValue="billing@northwind.example" /> <FieldDescription>Invoices and payment receipts are sent here.</FieldDescription> </Field> <Field labelPlacement="side"> <FieldLabel>VAT number</FieldLabel> <TextField defaultValue="GB 284 9113 07" /> </Field> </Stack> );}Narrow containers
A side label stacks above its control when the field itself is narrower than 320 pixels. The field measures its own width, not the window’s, so the same field keeps its side label in a page and stacks in a two-column row, a drawer or a phone screen without a prop change.
import { Field, FieldLabel } from '@slotted/react/field';import { Grid } from '@slotted/react/grid';import { TextField } from '@slotted/react/text-field';export default function FieldNarrow() { return ( <Grid columns={2} minItemWidth="xs" gap={4}> <Field labelPlacement="side"> <FieldLabel>City</FieldLabel> <TextField defaultValue="Seattle" /> </Field> <Field labelPlacement="side"> <FieldLabel>Postal code</FieldLabel> <TextField defaultValue="98104" /> </Field> </Grid> );}Sizes
size sets the label, the messages and the counter to the step of the control they belong to: sm for dense tables and toolbars, md for most forms, lg for sparse forms. The library’s controls inside a field take the same size, so one prop sizes both.
import { Field, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldSizes() { return ( <Stack gap={5}> <Field size="sm"> <FieldLabel>SKU</FieldLabel> <TextField defaultValue="NW-CHAI-24" /> </Field> <Field size="md"> <FieldLabel>Product name</FieldLabel> <TextField defaultValue="Chai tea, 24 bags" /> </Field> <Field size="lg"> <FieldLabel>Shelf label</FieldLabel> <TextField defaultValue="Chai — spiced black tea" /> </Field> </Stack> );}States
invalid sets aria-invalid on the control and draws it in the danger tone; the label keeps its color, because the error already says what is wrong. readOnly sets the native readonly, so the value stays focusable and copyable. disabled sets the native disabled, which takes the control out of the tab order and out of form submission. Set the state on the field, not on the control.
Error:Six digits are missing.
Quote this ID when you contact support.
Only the workspace owner can change the URL.
import { Field, FieldDescription, FieldError, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldStates() { return ( <Stack gap={5}> <Field invalid required> <FieldLabel>Card number</FieldLabel> <TextField inputMode="numeric" defaultValue="4242 4242 42" /> <FieldError>Six digits are missing.</FieldError> </Field> <Field readOnly> <FieldLabel>Account ID</FieldLabel> <TextField defaultValue="acct_9f2c41" /> <FieldDescription>Quote this ID when you contact support.</FieldDescription> </Field> <Field disabled> <FieldLabel>Workspace URL</FieldLabel> <TextField defaultValue="northwind.slotted.app" /> <FieldDescription>Only the workspace owner can change the URL.</FieldDescription> </Field> </Stack> );}Description and error
A description says what to enter, and an error says what is wrong with what was entered. Both sit under the control and join its accessible description, in that order. An error that does not block submission takes tone="warning".
Printed on the invoice so your accounts team can match it.
Five digits, as on the shipping label.
Error:Enter all five digits.
Warning:Above 40% the order waits for a manager's approval.
import { Field, FieldDescription, FieldError, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldMessages() { return ( <Stack gap={5}> <Field> <FieldLabel>Purchase order</FieldLabel> <TextField defaultValue="PO-20418" /> <FieldDescription> Printed on the invoice so your accounts team can match it. </FieldDescription> </Field> <Field invalid> <FieldLabel>Postal code</FieldLabel> <TextField defaultValue="981" /> <FieldDescription>Five digits, as on the shipping label.</FieldDescription> <FieldError>Enter all five digits.</FieldError> </Field> <Field> <FieldLabel>Discount</FieldLabel> <TextField defaultValue="45%" /> <FieldError tone="warning">Above 40% the order waits for a manager's approval.</FieldError> </Field> </Stack> );}Validation on submit
Validate when the form is submitted, then set invalid and write the error. live="polite" announces the error once when it appears, and reserve keeps a line open for it, so the button below does not move. Submit the empty form, then type a valid address and submit again.
import { useState, type SubmitEvent } from 'react';import { Button } from '@slotted/react/button';import { Field, FieldError, FieldLabel } from '@slotted/react/field';import { Inline } from '@slotted/react/inline';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';function emailError(value: string): string { if (value.trim() === '') return 'Enter the address invoices are sent to.'; if (!/^\S+@\S+\.\S+$/.test(value)) return 'Enter an address like billing@company.com.'; return '';}export default function FieldValidation() { const [email, setEmail] = useState(''); const [submitted, setSubmitted] = useState(false); const [saved, setSaved] = useState(false); const error = submitted ? emailError(email) : ''; const submit = (event: SubmitEvent<HTMLFormElement>) => { event.preventDefault(); setSubmitted(true); setSaved(emailError(email) === ''); }; return ( <form noValidate onSubmit={submit}> <Stack gap={4}> <Field required invalid={error !== '' ? true : undefined}> <FieldLabel>Billing email</FieldLabel> <TextField type="email" value={email} onValueChange={(value) => { setEmail(value); setSaved(false); }} /> <FieldError live="polite" reserve> {error} </FieldError> </Field> <Inline gap={3} align="center"> <Button type="submit">Save billing details</Button> {saved ? <span role="status">Saved.</span> : null} </Inline> </Stack> </form> );}Help
A help button beside the label holds guidance that would crowd the description line. It opens a tooltip on hover and on keyboard focus, and a press keeps it open until a second press, Escape or a press elsewhere. A disabled field keeps its help operable, so it can say why the field is off.
import { Field, FieldHeader, FieldHelp, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldHelpExample() { return ( <Stack gap={5}> <Field required> <FieldHeader> <FieldLabel>Cost center</FieldLabel> <FieldHelp> The four-digit code finance assigns to your team. It appears on every invoice line. </FieldHelp> </FieldHeader> <TextField inputMode="numeric" defaultValue="4120" /> </Field> <Field disabled> <FieldHeader> <FieldLabel>Billing currency</FieldLabel> <FieldHelp>Set when the workspace was created. Contact support to change it.</FieldHelp> </FieldHeader> <TextField defaultValue="USD — US dollar" /> </Field> </Stack> );}Label row
A header holds the label with the parts that stand beside it: an indicator such as a Beta badge, and an action such as a link or a button at the end of the row. The action keeps type="button", so it never submits the form, and it stays operable when the field is disabled.
import { Badge } from '@slotted/react/badge';import { Field, FieldAction, FieldHeader, FieldIndicator, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldHeaderExample() { return ( <Stack gap={5}> <Field required> <FieldHeader> <FieldLabel>Password</FieldLabel> <FieldAction render={(props) => <a {...props} href="#reset-password" />}> Forgot password? </FieldAction> </FieldHeader> <TextField type="password" autoComplete="current-password" /> </Field> <Field> <FieldHeader> <FieldLabel>Webhook URL</FieldLabel> <FieldIndicator> <Badge size="sm" tone="accent" variant="soft"> Beta </Badge> </FieldIndicator> <FieldAction>Send test event</FieldAction> </FieldHeader> <TextField type="url" defaultValue="https://hooks.northwind.example/orders" /> </Field> </Stack> );}Counter
A text field or textarea with showCount publishes its length and the field draws the count at the end of the label row. For any other measure, such as words or tags, write the counter yourself and set its invalid when the count passes its limit. The count joins the control’s accessible description.
Separate tags with commas.
import { useState } from 'react';import { Field, FieldCounter, FieldDescription, FieldHeader, FieldLabel,} from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';import { Textarea } from '@slotted/react/textarea';const MAX_TAGS = 5;export default function FieldCounterExample() { const [tags, setTags] = useState('tea, organic, fair trade'); const count = tags.split(',').filter((tag) => tag.trim() !== '').length; const over = count > MAX_TAGS; return ( <Stack gap={5}> <Field> <FieldLabel>Public description</FieldLabel> <Textarea autoSize countMax={140} showCount defaultValue="Ships within two business days. Returns are free for thirty days." /> </Field> <Field invalid={over ? true : undefined}> <FieldHeader> <FieldLabel>Search tags</FieldLabel> <FieldCounter invalid={over}>{`${count}/${MAX_TAGS} tags`}</FieldCounter> </FieldHeader> <TextField value={tags} onValueChange={setTags} /> <FieldDescription>Separate tags with commas.</FieldDescription> </Field> </Stack> );}Controls
Select, number field, date picker, textarea and text field read the field they sit in: they take its identifiers, its description and its states with no wiring.
Cases of 24 bags.
import { DatePicker } from '@slotted/react/date-picker';import { Field, FieldDescription, FieldLabel } from '@slotted/react/field';import { NumberField } from '@slotted/react/number-field';import { Select, SelectContent, SelectItem, type SelectOption, SelectTrigger, SelectValue,} from '@slotted/react/select';import { Stack } from '@slotted/react/stack';const TERMS: SelectOption[] = [ { value: 'net-15', label: 'Net 15' }, { value: 'net-30', label: 'Net 30' }, { value: 'net-60', label: 'Net 60' },];export default function FieldControls() { return ( <Stack gap={5}> <Field required> <FieldLabel>Payment terms</FieldLabel> <Select defaultValue="net-30" items={TERMS}> <SelectTrigger> <SelectValue placeholder="Choose terms" /> </SelectTrigger> <SelectContent> {TERMS.map((term) => ( <SelectItem key={term.value} value={term.value}> {term.label} </SelectItem> ))} </SelectContent> </Select> </Field> <Field required> <FieldLabel>Quantity</FieldLabel> <NumberField defaultValue={12} min={1} max={500} /> <FieldDescription>Cases of 24 bags.</FieldDescription> </Field> <Field> <FieldLabel>Delivery date</FieldLabel> <DatePicker locale="en-US" /> </Field> </Stack> );}Your own control
A control the library does not ship takes the same wiring through the field’s control part: the identifier the label points at, the accessible description and the states. An attribute written on the control wins over the one the field would set.
Used on invoices and in the customer portal.
import { Field, FieldControl, FieldDescription, FieldLabel } from '@slotted/react/field';export default function FieldCustomControl() { return ( <Field> <FieldLabel>Brand color</FieldLabel> <FieldControl type="color" defaultValue="#2f6fde" /> <FieldDescription>Used on invoices and in the customer portal.</FieldDescription> </Field> );}Defaults for a section
A defaults provider sets size, labelPlacement, necessity, disabled and readOnly once for every field under it. A field that states a value of its own keeps it.
import { Field, FieldDefaultsProvider, FieldLabel } from '@slotted/react/field';import { Stack } from '@slotted/react/stack';import { TextField } from '@slotted/react/text-field';export default function FieldDefaults() { return ( <FieldDefaultsProvider size="sm" labelPlacement="side" necessity="optional"> <Stack gap={3}> <Field required> <FieldLabel>Warehouse</FieldLabel> <TextField defaultValue="Seattle — Pier 91" /> </Field> <Field required> <FieldLabel>Bin location</FieldLabel> <TextField defaultValue="A-14-03" /> </Field> <Field> <FieldLabel>Picking note</FieldLabel> <TextField /> </Field> </Stack> </FieldDefaultsProvider> );}Accessibility
- No WAI-ARIA Authoring Practices pattern covers a field. Four sources cover it together: the Authoring Practices’ Providing Accessible Names and Descriptions practice (w3.org/WAI/ARIA/apg/practices/names-and-descriptions/) for the label and the description, the HTML specification for label[for] and fieldset[disabled], and WCAG 2.2 Understanding 3.3.1 Error Identification and 3.3.2 Labels or Instructions for the error and the help.
- The label is associated explicitly. The naming practice records that some combinations of assistive technology and browser do not treat the implicit form, a label wrapping its control, as an accessible name, so the field derives an identifier and points for at it instead of nesting.
- Field writes aria-required, never the native required. The native attribute turns on browser constraint validation and changes how the form submits, which describing a field must not do as a side effect. To get it, write required on the control: an explicit value on the control always wins. disabled and readonly are native, because taking a control out of the tab order and out of submission is what those attributes mean.
- The accessible description is the indicator, the help, the description, the count and the error, in that order, whatever order the page writes them in. Each slot has one correct reading order, and deriving the order from registration would make what a reader hears depend on when an effect ran. The count is included so a counter is related to its control by identifier.
- The help, the indicator and the action stand beside the label, never inside it. HTML forbids labelable content such as a button inside a label other than the control it labels, and a press on it would reach the label and move focus to the control instead of opening the hint.
- The help is a toggletip. A tooltip alone opens on a touch screen only on a long press, because a tap triggers the element’s own action; the help button has no other action, so a press opens the hint and a second press closes it. The help text also sits in a hidden node inside the button, which describes the button and the control while the tooltip is closed, because a hidden element referenced directly still enters the description. The tooltip describes nothing, so the hint is never read twice.
- A disabled field leaves its help and its action operable, because the help often explains why the field is disabled.
- The necessity asterisk is hidden from assistive technology and the necessity words are not. A reader working through a form of twenty required fields does not need to hear “asterisk” twenty times, and aria-required already states the fact; (optional) is information no other attribute supplies.
- The error is text in the page, as WCAG 2.2 SC 3.3.1 requires, never a tooltip. As an InlineMessage it also carries the severity as visually hidden text, so a reader who cannot see the red ink hears “Error:” before the sentence.
- live defaults to off, because a message present when the page finishes loading is not announced whatever role it carries. A form that shows the error after submit sets live="polite", and the reader hears it once rather than on every render.
API
Field
Props
size'sm' | 'md' | 'lg'Defaultmd- The type step, matching the control the field wraps. The label, the messages and the counter read the control type scale, which the theme restates per density.
labelPlacement'top' | 'side'Defaulttop- Where the label sits. side reflows to top when the field’s own inline size is below 320 pixels; the query is a container query, not a viewport query.
necessity'mark' | 'optional' | 'words' | 'none'Defaultmark- How necessity is written: an asterisk on a required field, (optional) on a field a reader may skip, both words, or nothing, for a form that says once that every field is required.
width'short' | 'medium' | 'full'Defaultfull- The longest the control stands, as a cue to the length of its answer: short (--slotted-field-width-short, 6rem) for an integer of up to four digits, medium (--slotted-field-width-medium, 15rem) for an amount, a code or a short word, full for free text, a name or a picker of records. The control still shrinks below the bound in a narrower field.
messagesPartial<FieldMessages>- Words that replace the active language’s, key by key: the necessity words (optional, required) and the help button’s name (help).
requiredboolean- Unset rather than false. Writes aria-required on the control, never the native required, which would turn on browser constraint validation and change how the form submits.
invalidboolean- On Field, FieldCounterOn Field: unset rather than false; writes aria-invalid on the control and data-invalid on the field, and leaves the label’s color unchanged. On FieldCounter: the count has passed its limit, which can happen before validation runs, so it is the counter’s own state and defaults to false.
disabledbooleanDefault from the group, then the provider- On Field, FieldDefaultsProviderUnset rather than false, so a field follows the FieldGroup around it. A stated value wins, and it reaches the control as the native attribute.
readOnlybooleanDefault from the group, then the provider- On Field, FieldDefaultsProviderUnset rather than false. Reaches the control as the native readonly, which keeps the value focusable and copyable.
idstringDefaultgenerated- The base of every identifier the field derives: <id>-control, <id>-label, <id>-indicator, <id>-help, <id>-description, <id>-counter and <id>-error. Generated with useId when unset.
childrenReactNode- On FieldHelpThe help text. Written once, it reaches the tooltip and the hidden node that describes the button and the control.
openboolean- On FieldHelpWhether the hint is showing, controlled. Pair it with onOpenChange; leave both unset and FieldHelp owns the state.
defaultOpenbooleanDefaultfalse- On FieldHelpWhether the hint starts open, read once when FieldHelp owns the state.
presentation'toggletip' | 'auto'Defaulttoggletip- On FieldHelpauto draws the hint as a bottom sheet under (max-width: 480px) and (pointer: coarse): modal, headed by the field’s label beside a close control, dismissed by its grip, its scrim, Escape and the platform’s way back, with focus given back to the help button. Anywhere else it is the toggletip.
helpPresentation'toggletip' | 'auto'Defaulttoggletip- On FieldDefaultsProviderThe presentation of every FieldHelp inside, unless a FieldHelp states its own.
side'top' | 'bottom' | 'inline-start' | 'inline-end' | 'left' | 'right'Defaulttop- On FieldHelpWhere the hint opens. It flips to the opposite side when there is no room.
aria-labelstringDefaultmessages.help- On FieldHelpThe accessible name of the help button. Unset, it is the field’s help message; set, it applies to this button alone.
type'button' | 'submit' | 'reset'Defaultbutton- On FieldActionbutton by default, so the action never submits the form it sits in. A link rendered through render receives the props without it.
tone'accent' | 'secondary' | 'success' | 'warning' | 'danger'Default secondary on FieldDescription, danger on FieldError- On FieldDescription, FieldErrorBoth messages are InlineMessage roots and take its five tones, so a warning that does not block submission is FieldError with tone="warning".
mark'glyph' | 'dot' | 'none'Defaultnone- On FieldDescription, FieldErrorThe mark the message draws. A field’s messages draw none by default: an icon repeated under every control of a form reads as texture, and the ink and the sentence already state the tone. glyph draws the tone’s icon at the text size, and dot draws one neutral bullet.
live'off' | 'polite' | 'assertive'Defaultoff- On FieldDescription, FieldErrorWhether the message announces itself. off by default, because a message present when the page loads is not announced whatever role it carries.
reservebooleanDefaultfalse- On FieldDescription, FieldErrorKeeps one line open whether or not there is a message, so a form that renders its error unconditionally does not move when the error appears.
Events
| Name | Payload | When |
|---|---|---|
onOpenChange | (open: boolean, request: TooltipChangeRequest) | On FieldHelp, before the hint opens or closes, once per transition. request.reason is pointer for a hover or a press; keyboard for focus, Enter or Space; or escape, blur or programmatic. The sheet of presentation="auto" also reports outsidePress for a press on its scrim, and dismiss for its close control and the platform’s way back. request.cancel() refuses the change. |
Composition
render(props) => ReactNode- On Field, FieldHeader, FieldLabel, FieldIndicator, FieldAction, FieldControl, FieldCounterReplaces the rendered element and hands it every attribute: a textarea as the control, an output as the counter, a link as the action, a fieldset as the field. The props are typed as HTMLAttributes<HTMLElement>, so they spread onto any element. FieldHelp has no render: its button carries the name, the description and the tooltip control, and all three belong to Field.
onClick and the pointer and focus handlersnative- On FieldHelp, FieldActionThe consumer’s handler runs first and the field’s after it, unless the consumer called preventDefault.
useField()() => FieldContextValue | undefined- On any component inside a FieldReturns the identifiers, the description and the four states, so a control Slotted does not ship wires itself without a wrapper. Returns undefined outside a field, so the same control also works alone.
FieldDefaultsProvider{ size, labelPlacement, necessity, disabled, readOnly }- On a subtreeThe five decisions an application takes once for every field under it. FieldGroup renders one for the fields inside it, so a compact or disabled section is one prop instead of one per field.
refRef<HTMLElement>- On every partReaches the default element; on FieldHelp, the button. A part rendered through render is the consumer’s element, so the consumer attaches its ref there. There is no imperative handle: the one state Field holds, the hint, is controlled through open and onOpenChange.
Parts
| Part | Element | Required | Purpose |
|---|---|---|---|
root | div, or the element render returns | Yes | The field. It carries data-ui="field", the three axes, and data-disabled, data-invalid, data-required and data-readonly. It is its own size container, so a side label reflows on the field’s width rather than the window’s. |
header | div, or the element render returns | No | The label row, written when the label has company: the help, an indicator, an action and the counter. It aligns them on the label’s first baseline, wraps when it runs out of room, and puts the action and the count at its end. A field whose label stands alone writes the label on the root and no header. |
label | label | No | Names the control through for, which points at the derived control identifier. The WAI-ARIA Authoring Practices name the explicit association as the one with the broadest support; some assistive technologies fail to treat the implicit one, a label wrapping its control, as a name. |
mark | span, inside the label | No | The necessity marker the label draws: an asterisk on a required field, (optional) on a field a reader may skip, or both words. The asterisk is aria-hidden because aria-required already states the fact; the words are read, because they carry information. |
help | button, fixed | No | A circle-question button beside the label that shows the field’s help in a tooltip. It opens on hover and on keyboard focus, and a press keeps it open until a second press, Escape or a press elsewhere. A hidden node inside the button carries the same words, so the button and the control are described by the help whether the tooltip is open or not. |
indicator | span, or the element render returns | No | What qualifies the field, such as Beta, Pro or New, as one or more Badges after the label. It sits outside the label, so the necessity mark stays against the last word, and it joins the control’s description, so a reader on the control hears it. |
action | button type="button", or the element render returns | No | A link or a button at the end of the label row, such as Forgot password? or Generate. Its accent ink darkens by a third on hover, with the underline drawn, and by two thirds on press. The field does not disable it with the control. |
control | input, or the element render returns | No | A control Slotted does not ship, wired by FieldControl. Slotted’s own controls read the field themselves and need no wrapper. The field gives the control an identifier, a description, aria-invalid, aria-required, disabled and readonly, and overwrites nothing the consumer stated. |
counter | span, or the element render returns | No | The count, at the end of the label row, where IBM Carbon also places it, and inside the header when there is one. A control with showCount publishes its count and the field draws it; a page that counts words or bytes writes its own FieldCounter. The count joins the control’s description and carries its own data-invalid, because a count can pass its limit before validation runs. |
Theming
Each token is a CSS custom property: set it in a theme, or on any element to retune every field inside it.
Field tokens
| Token | Default |
|---|---|
--slotted-field-action-color | var(--slotted-tone-accent-text, LinkText) |
--slotted-field-action-color-active | color-mix(in oklab, var(--_rest) 35%, var(--slotted-text, CanvasText)) |
--slotted-field-action-color-hover | color-mix(in oklab, var(--_rest) 65%, var(--slotted-text, CanvasText)) |
--slotted-field-action-radius | var(--slotted-control-radius, 4px) |
--slotted-field-column-gap | var(--slotted-space-5, 0.75rem) |
--slotted-field-counter-color | var(--slotted-text-muted) |
--slotted-field-counter-invalid-color | var(--slotted-tone-danger-text) |
--slotted-field-font-family | var(--slotted-control-font-family, sans-serif) |
--slotted-field-header-gap | var(--slotted-space-3, 0.375rem) |
--slotted-field-help-color | var(--slotted-text-muted) |
--slotted-field-help-radius | var(--slotted-control-radius, 4px) |
--slotted-field-help-surface-active | var(--slotted-tone-secondary-subtle-active, ButtonFace) |
--slotted-field-help-surface-hover | var(--slotted-tone-secondary-subtle-hover, ButtonFace) |
--slotted-field-icon-size-min | 14px |
--slotted-field-label-color | var(--slotted-text) |
--slotted-field-label-font-weight | var(--slotted-font-weight-medium, 500) |
--slotted-field-label-inline-size | 12rem |
--slotted-field-line-height | var(--slotted-line-height-sm, 1.45) |
--slotted-field-mark-color | var(--slotted-tone-danger-text) |
--slotted-field-mark-gap | 0 |
--slotted-field-mark-text-color | var(--slotted-text-muted) |
--slotted-field-row-gap | var(--slotted-space-3, 0.375rem) |
--slotted-field-width-medium | 15rem |
--slotted-field-width-short | 6rem |
Theme tokens it reads
| Token | Default |
|---|---|
--slotted-control-font-family | var(--slotted-font-family-sans) |
--slotted-control-font-size-lg | comfortable 14px · compact 13px · dense 12px |
--slotted-control-font-size-md | comfortable 13px · compact 12px · dense 12px |
--slotted-control-font-size-sm | comfortable 12px · compact 12px · dense 12px |
--slotted-control-height-lg | comfortable 38px · compact 32px · dense 30px |
--slotted-control-height-md | comfortable 34px · compact 28px · dense 26px |
--slotted-control-height-sm | comfortable 30px · compact 26px · dense 24px |
--slotted-control-icon-size-md | comfortable 16px · compact 14px · dense 13px |
--slotted-control-icon-size-sm | comfortable 14px · compact 13px · dense 12px |
--slotted-control-inner-size-md | comfortable 24px · compact 20px · dense 18px |
--slotted-control-inner-size-sm | comfortable 22px · compact 18px · dense 16px |
--slotted-control-radius | var(--slotted-radius-sm) |
--slotted-control-transition-duration | var(--slotted-duration-short) |
--slotted-control-transition-easing | var(--slotted-easing-standard) |
--slotted-disabled-foreground | Set per scheme by the theme |
--slotted-focus-ring-color | Set per scheme by the theme |
--slotted-focus-ring-offset | var(--slotted-border-width-thick) |
--slotted-focus-ring-width | var(--slotted-border-width-thick) |
--slotted-font-size-xs | 0.75rem |
--slotted-font-weight-medium | 500 |
--slotted-font-weight-regular | 400 |
--slotted-line-height-sm | 1.45 |
--slotted-space-1 | 0.125rem |
--slotted-space-2 | 0.25rem |
--slotted-space-3 | 0.375rem |
--slotted-space-5 | 0.75rem |
--slotted-target-comfortable | 44px |
--slotted-target-min | 24px |
--slotted-text | Set per scheme by the theme |
--slotted-text-muted | Set per scheme by the theme |
--slotted-tone-accent-text | Set per scheme by the theme |
--slotted-tone-danger-text | Set per scheme by the theme |
--slotted-tone-secondary-subtle-active | Set per scheme by the theme |
--slotted-tone-secondary-subtle-hover | Set per scheme by the theme |