Description
react-tabs is an accessible tab component for React, published by the reactjs organization and documented at reactcommunity.org. You build a tabbed interface from four components that are used together, a Tabs wrapper with its tab list, tabs and tab panels, and the library handles which tab is selected and the keyboard behavior. Version 5 and newer needs React 18 or newer, and version 4 needs React 16.8 or newer. The README says the library has been tested on real mobile devices and browsers. The component can run in controlled or uncontrolled mode, and it offers options such as defaultIndex to choose the first open tab, defaultFocus to focus the tabs on first render, and direction for right-to-left layouts. You can turn off the up and down arrow keys, decide whether a clicked tab takes focus, and force panels to render even when they are hidden. There is also a domRef callback and support for rendering inside another window, such as an iframe. Install it with npm or yarn and follow the basic example in the README to get started.…
Highlights
- Accessible tabs with built-in keyboard handling
- Controlled and uncontrolled modes
- Right-to-left layout support through a direction prop
- Works with React 18 and newer in version 5
Ratings & Reviews
No ratings yet
Be the first to rate react-tabs.
People also visit
react-tabs FAQ
What does react-tabs do?
It provides an accessible tab component for React, so you can switch between panels of content with the keyboard and the mouse.
Which React version do I need?
Version 5 or newer needs React 18 or newer. Version 4 needs React 16.8 or newer.
How do I install it?
Install react-tabs with npm or yarn, then follow the basic example in the README.
Can I set the open tab?
Yes. defaultIndex sets the tab that opens first, using a zero-based index, in uncontrolled mode.
Does it support right-to-left text?
Yes. The direction prop accepts rtl or ltr.
Was it tested on mobile?
The README says it was tested on real mobile devices and browsers.
What are the best react-tabs alternatives?
Popular alternatives to react-tabs include @tommasini/react-native-scrollable-tab-view, react-native-tabs and react-swipeable-views. See all react-tabs alternatives



















