2.7.2 • Published 3 years ago
react-focus-trap v2.7.2
A generic focus management tool for components such as dialogs and dropdowns.
Usage
React Focus Trap is a container element that will manage focus for its children.
let Modal = React.createClass({
render() {
return (
<FocusTrap onExit={ this._onExit } active={ this.props.active }>
Amazing stuff goes here
</FocusTrap>
)
}
})
When Focus Trap is active, it will do several things:
- Ensure focus remains on its content
- Exits when clicks outside of the container occur
- Exits when the escape key is pressed
Props
Name | Default | Description |
---|---|---|
active | true | Should the FocusTrap render? |
className | 'focus-trap' | The class of the inner container that maintains focus |
onExit | null | Callback when escape or an outside click occurs |
element | 'div' | The tag name of the inner container |
role | 'dialog' | The aria role for the inner container |
Visit code.viget.com to see more projects from Viget.
2.7.2
3 years ago
2.7.1
7 years ago
2.7.0
7 years ago
2.6.0
7 years ago
2.6.0-beta.0
7 years ago
2.5.0
8 years ago
2.4.0
8 years ago
2.3.3
9 years ago
2.3.2
9 years ago
2.3.1
9 years ago
2.3.0
9 years ago
2.2.0
9 years ago
2.1.0
10 years ago
1.1.2
10 years ago
2.0.0
10 years ago
1.1.1
10 years ago
1.2.0
10 years ago
1.1.0
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.8.0
10 years ago
0.7.0
10 years ago
0.7.0-alpha
10 years ago
0.6.1
10 years ago
0.6.0
10 years ago
0.5.2
10 years ago
0.5.1
10 years ago
0.5.0
10 years ago
0.4.0
10 years ago
0.3.0
10 years ago
0.2.0
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago
0.0.1
10 years ago