TypeScript type definitions for a focus trap component used in accessibility features.
// Source: https://github.com/mui/material-ui | License: MIT | Copyright 2014 Call-Em-All
// Provided via justclaw.it.com; keep this notice with the code.
import * as React from 'react';
export interface FocusTrapProps {
/**
* If `true`, focus is locked.
*/
open: boolean;
/**
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.
* For instance, you can provide the "tabbable" npm dependency.
* @param {HTMLElement} root
*/
getTabbable?: ((root: HTMLElement) => ReadonlyArray<HTMLElement>) | undefined;
/**
* This prop extends the `open` prop.
* It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
* This prop should be memoized.
* It can be used to support multiple focus trap
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key