Keeps Tab inside while active, focuses the first control (or an element with data-autofocus), and restores focus on deactivation.

Props

  • activeboolean
    Default: true

    Trap focus while true.

  • classNamestring
    Default: ''

    Extra classes for the root element.

  • childrenReactNode

    Content.

  • ...rest

    Any other props are passed to the underlying element.

Related hooks and theme:useDialogFocus