Focus Trap
The Focus Trap component prevents the user's focus from escaping its children components.
FocusTrap API
Import
import { FocusTrap } from '@mui/base/FocusTrap';
// or
import { FocusTrap } from '@mui/base';Learn about the difference by reading this guide on minimizing bundle size.
| Name | Type | Default | Description |
|---|---|---|---|
| open* | bool | - | If |
| children | element | - | A single child content element. |
| disableAutoFocus | bool | false | If |
| disableEnforceFocus | bool | false | If |
| disableRestoreFocus | bool | false | If |
| getTabbable | func | - | Returns an array of ordered tabbable nodes (i.e. in tab order) within the root. For instance, you can provide the "tabbable" npm dependency. Signature: function(root: HTMLElement) => void |
| isEnabled | func | function defaultIsEnabled(): boolean { return true; } | This prop extends the |