@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
58 lines (57 loc) • 1.75 kB
TypeScript
import { FC, PropsWithChildren, RefObject } from "react";
//#region src/components/focus-lock/focus-lock.d.ts
interface FocusLockProps extends PropsWithChildren {
/**
* If `true`, the first focusable element within the `children` will auto-focused once `FocusLock` mounts.
*
* @default false
*/
autoFocus?: boolean;
/**
* The `ref` of the wrapper for which the focus-lock wraps.
*/
contentRef?: RefObject<HTMLElement | null>;
/**
* If `true`, focus trapping will be disabled.
*
* @default false
*/
disabled?: boolean;
/**
* `ref` of the element to return focus to when `FocusLock` unmounts.
*/
finalFocusRef?: RefObject<HTMLElement | null>;
/**
* `ref` of the element to receive focus initially.
*/
initialFocusRef?: RefObject<HTMLElement | null>;
/**
* 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.
*
* @default false
*/
lockFocusAcrossFrames?: boolean;
/**
* If `true`, disables text selections inside, and outside focus lock.
*
* @default false
*/
persistentFocus?: boolean;
/**
* If `true`, focus will be restored to the element that triggered the `FocusLock` once it unmounts.
*
* @default false
*/
restoreFocus?: boolean;
}
/**
* `FocusLock` is a component that improves accessibility by restricting focus within elements such as modals and dialogs, and locking the focus within that range.
*
* @see https://yamada-ui.com/docs/components/focus-lock
*/
declare const FocusLock: FC<FocusLockProps>;
//#endregion
export { FocusLock, FocusLockProps };
//# sourceMappingURL=focus-lock.d.ts.map