The value in force, or "" for the unscoped choice.
label
string
Yes
The select's hidden label: what the list shows ("Show posts from").
all
string | null
The unscoped choice's label ("All sites"); null when the page needs one scope.
name
string
The query parameter.
keep
Record<string, string | undefined>
Other query values to carry (a status tab, a search) when the scope changes.
action
string
Where the form goes; the current page when left out.
renderForm
(props: ScopeFormProps) => ReactElement
The form element, for a router's own form (React Router's <Form>), so the change is a client navigation. It is given every prop the plain form would get.
Functions
Function
Signature
Does
enhance
(root?: ParentNode): () => void
The scope chip's behavior for a page with no React: choosing submits the form at once, and the Show button (there for a page with no script) is hidden. React's ScopeChip does the same itself.
Parts and data attributes
Class
Is
.cap-scope
the root
.cap-scope-label
a part
.cap-scope-submit
a part
Attribute
Values
data-cap-ready
present or absent
Accessibility
Key
Does
Tab
Moves to the select (and to Show with no script)
Arrow keys, letters
Choose a scope (the browser's select); with script the list reloads on the change
The select has a name from its label, hidden with .cap-sr-only.
The Show button stays in the page until script runs, so a keyboard user with no script can submit.