Interface FocusScopeProps

Props of the useFocusScope hook.

interface FocusScopeProps {
    approveFocusCandidate?: ((element: FocusableElement) => boolean);
    isAutofocused?: boolean;
    isFocusRestored?: boolean;
    isFocusTrap?: boolean;
    isScrollPrevented?: boolean;
}

Hierarchy (view full)

Properties

approveFocusCandidate?: ((element: FocusableElement) => boolean)

Returns true if an element is allowed to receive focus. By default, all candidates are approved.

isAutofocused?: boolean

If true then focuses the first approved candidate element inside a container when a scope is mounted.

By default, autofocus is enabled if the focus ring is visible.

isFocusRestored?: boolean

If true then focus is restored to the element that was focused before this scope was mounted.

By default, focus is restored if the focus ring is visible.

isFocusTrap?: boolean

If true then focus won't be able to leave the scope.

false
isScrollPrevented?: boolean

If true no scrolling will occur after element receives focus, otherwise the browser scrolls the document to bring the newly-focused element into view.

false