Leave Yamada UI a star

Star
Yamada UIYamada UIv1.7.2

FocusLock

FocusLock is a component that improves accessibility by restricting focus within elements such as modals and dialogs, and locking the focus within that range.

Source@yamada-ui/focus-lock

Props

FocusLockProps

autoFocus

Description

If true, the first focusable element within the children will auto-focused once FocusLock mounts.

Type

boolean

Default

false

contentRef

Description

The ref of the wrapper for which the focus-lock wraps.

Type

RefObject<HTMLElement>

disabled

Description

If true, focus trapping will be disabled.

Type

boolean

Default

false

finalFocusRef

Description

ref of the element to return focus to when FocusLock unmounts.

Type

RefObject<FocusableElement>

initialFocusRef

Description

ref of the element to receive focus initially.

Type

RefObject<FocusableElement>

isDisabled

Deprecated

Description

If true, focus trapping will be disabled.

Deprecated

Use disabled instead.

Type

boolean

Default

false

lockFocusAcrossFrames

Description

Enables aggressive focus capturing within iframes. - If true: keep focus in the lock, no matter where lock is active. - If false: allows focus to move outside of iframe.

Type

boolean

Default

false

persistentFocus

Description

If true, disables text selections inside, and outside focus lock.

Type

boolean

Default

false

restoreFocus

Description

If true, focus will be restored to the element that triggered the FocusLock once it unmounts.

Type

boolean

Default

false

Edit this page on GitHub

PreviousPortalNextVisuallyHidden