Common props
This page is the shared premise for every component page; it covers the prop rules and where they land that all components have in common. Component-specific props are documented on each component's own page.
Prop pass-through
Components forward any prop this library does not declare straight onto the rendered root element, so className, id, style, data-*, aria-*, onClick and the like can be written directly:
- If a component always writes a given prop onto the root element itself, pass-through won't take effect — for example,
aria-disabledon most components is derived from thedisabledprop and can't be set by hand. - The native
defaultValue/defaultCheckeddon't reach the DOM through pass-through.
Refs and inner elements
ref points at the root element. To reach an inner element or pass props to it, use the channel the component exposes:
Common props
A few notes:
disabledemitsaria-disabled, not the nativedisabled: a disabled element can still be focused and read out; the nativedisabledis only set on real form controls.disabledmeans something different on some layout containers: onFieldLayoutit applies to the field itself;FieldsetLayoutuses a native<fieldset disabled>, which also disables every control in the group; pure layout containers (PanelLayout,StackLayout, etc.) have nodisabled.- Where
titleandaccessKeyland varies by component: on most they land on the root element, on the Button family on the inner anchor, and on the input family on the inner<input>. Before pairingtitlewith anaria-*attribute, check the landing spot on the component page. - The
titlelabel fallback follows later label changes: when the label is visually hidden andtitleis not given, the label text is used as the fallback; this library recomputes that fallback from the currentlabel/invisibleLabelon every render, so changing the label later updatestitletoo (the original evaluates it only once at construction, leavingtitleuntouched by later label changes). labelaccepts any renderable ReactNode: renderable nodes such as0count as having a label, while booleans count as having none (the original only accepts non-empty strings).tabIndex={null}removes thetabindexattribute entirely: the element becomes completely unfocusable, programmatic focus included — unlike-1, which stays out of the Tab order but remains programmatically focusable.- Not every component has
flags: each accepts different flags depending on its form (e.g.Button'sprimary/progressive,Icon's color variants); see the component pages.
Keyboard and accessibility
Keyboard interaction, focus management and aria attributes are implemented one by one against the original OOUI; the specific keys are documented on each component page.