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 4 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.

FocusScopetype

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

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

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;
restoreFocusTarget
restoreFocusTarget?: HTMLElement | (() => HTMLElement | null) | null | undefined;
tabIndex
tabIndex?: number | undefined;
trapped
trapped?: boolean | undefined;

FocusScopeOwnPropstype

FocusScopeOwnProps: {
  children?: unknown;
  trapped?: boolean;
  loop?: boolean;
  autoFocus?: boolean;
  restoreFocus?: boolean;
  restoreFocusTarget?: HTMLElement | null | (() => HTMLElement | null);
  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;
restoreFocusTarget
restoreFocusTarget?: HTMLElement | (() => HTMLElement | null) | null | 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;
restoreFocusTarget
restoreFocusTarget?: HTMLElement | (() => HTMLElement | null) | null | undefined;
tabIndex
tabIndex?: number | undefined;
trapped
trapped?: boolean | undefined;