Props & attributes
Shared props and data attributes.
Each component's API reference lists its own props and attributes. This page collects the ones that recur across the library, grouped by the part that takes them.
Element props
Every part that renders an element accepts these.
Anything that isn't one of a part's own props is forwarded to the element, and your event handlers run alongside the part's rather than replacing them — see Composition.
Every part that renders an element also exposes it through ref, populated once the element mounts:
<Popover.Trigger bind:ref={trigger}>Open</Popover.Trigger>Providers that render no element of their own, such as Dialog.Root, don't.
Availability
Value and selection
Open state
For overlays with open state (dialog, menu, popover, select, …).
Detached triggers
Dialog, Alert Dialog, Drawer, Popover, Menu, Tooltip, and Preview Card can link a trigger to a root that isn't its ancestor, through a handle created from the component's Handle class. See Composition.
Positioner
On the Positioner part of floating components (Popover, Menu, Select, Tooltip, …).
The resolved side and alignment come back as data-side and data-align, and the positioner sets --anchor-width, --anchor-height, --available-width, --available-height and --transform-origin for the popup to size and animate against — see Styling.
Mounting
Overlays reach the DOM through an explicit <*.Portal> part, which wraps the Backdrop and the Positioner — or, for Dialog, Alert Dialog and Drawer, the Popup. Toast.Portal takes container only; every other Portal also takes keepMounted.
Triggers
Triggers render a real <button> wherever the pattern allows it, so type="button", activation on Enter and Space, and the disabled state come from the platform. Point as at another tag — <a> for a link, <span> where a <button> can't nest — and the part adds role="button", tabindex and the keyboard handlers a native button would have given you.
Focus and hover
For dialogs, popups, and hover-openable components.
List navigation
For menus, lists, and composite widgets.
Form
Machinery specific to one component family — a list's items / filter / itemToStringValue, or a range's min / max / format — stays on that component's page.
For the full controlled and uncontrolled patterns, see State.
Data attributes
Every part mirrors its live state onto its element as data-* attributes, so you style against state instead of tracking it yourself — see Styling.
Open and closed
Selection and pressed
Availability
Field validation
Present within a Field, reflecting the control's validation state.
Orientation and position
Animation
Set the resting styles as the default and the transitional styles behind these attributes — see Animation.