Askr documentation
Generated API snapshot

@askrjs/ui/focus-scope

Exports from the declarations published in @askrjs/ui. Signatures reflect the published artifact.

Exports

This entrypoint publishes 6 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.

FOCUS_SCOPE_A11Y_CONTRACTtype

FOCUS_SCOPE_A11Y_CONTRACT: { readonly FEATURES: { readonly trapped: true; readonly loop: true; readonly autoFocus: true; readonly restoreFocus: true; }; }

Focus scope accessibility contract.

FocusScopetype

FocusScope: { (props: FocusScopeProps): JSX.Element; (props: FocusScopeAsChildProps): JSX.Element; }

Renders a part of `focus-scope`. Supports polymorphic rendering via `asChild`.

FocusScopeA11yContracttype

FocusScopeA11yContract: typeof FOCUS_SCOPE_A11Y_CONTRACT

Type of the Focus Scope A11y Contract object.

FocusScopeAsChildPropstype

FocusScopeAsChildProps: FocusScopeOwnProps & {
  asChild: true;
  children: JSXElement;
  ref?: Ref<Element>;
}

Props for the `asChild` (polymorphic) rendering of Focus Scope.

asChild
asChild: true;
autoFocus
autoFocus?: boolean | undefined;
children
children: JSXElement;
id
id?: string | undefined;
loop
loop?: boolean | undefined;
ref
ref?: Ref<Element>;
restoreFocus
restoreFocus?: boolean | undefined;
tabIndex
tabIndex?: number | undefined;
trapped
trapped?: boolean | undefined;

FocusScopeOwnPropstype

FocusScopeOwnProps: {
  children?: unknown;
  trapped?: boolean;
  loop?: boolean;
  autoFocus?: boolean;
  restoreFocus?: boolean;
  id?: string;
  tabIndex?: number;
}

Own props for Focus Scope, before merging with native element attributes.

autoFocus
autoFocus?: boolean | undefined;
children
children?: unknown;
id
id?: string | undefined;
loop
loop?: boolean | undefined;
restoreFocus
restoreFocus?: boolean | undefined;
tabIndex
tabIndex?: number | undefined;
trapped
trapped?: boolean | undefined;

FocusScopePropstype

FocusScopeProps: Omit<JSX.IntrinsicElements['div'], 'children' | 'ref'> & FocusScopeOwnProps & {
  asChild?: false;
  ref?: Ref<HTMLDivElement>;
}

Props for Focus Scope.

asChild
asChild?: false | undefined;
autoFocus
autoFocus?: boolean | undefined;
children
children?: unknown;
id
id?: string | undefined;
loop
loop?: boolean | undefined;
ref
ref?: Ref<HTMLDivElement>;
restoreFocus
restoreFocus?: boolean | undefined;
tabIndex
tabIndex?: number | undefined;
trapped
trapped?: boolean | undefined;