A component whose underlying HTML element will be prioritized to receive focus when a Silk-controlled autoFocus mechanism runs.
<AutoFocusTarget.Root />
Required | yes |
---|---|
Underlying HTML element | div |
Description
A component whose underlying HTML element will be prioritized depending on its props to receive focus when a Silk-controlled autoFocus mechanism runs.
If several <AutoFocusTarget.Root />
are present on the page and matches the required criteria to receive focus, the first focusable one (i.e. whose not disabled, not inert, not outside an inertOutside Sheet, etc) is the one which will receive focus.
Required | no |
---|---|
Value type | boolean |
Default value | undefined |
Values description
true |
The underlying HTML element rendered is the child. |
---|---|
`false | undefined` |
Description
Defines whether the sub-component underlying HTML element is the default one or the one passed as child of the sub-component.
Usage
If the child is a React component rendering a HTML element:
React.forwardRef()
and pass the received ref to the rendered HTML element.