react-tabbed
Flexible, markup agnostic tab component for React.
Example
const App = React ReactDOM
API
<Tabbed>
Sets up the context for tabs and panes.
props
defaultValue
(String): The initially selected tabuseHash
(Boolean): Turns on hash mode, where thedefaultValue
will be read from the url, and clicking on a tab will update the urltoggle
(Boolean): Turns on toggle mode, where clicking on a currently selected tab will reverb the active tab to thedefaultValue
onChange
(Function): If given, will be called with the value of any clicked tab
<Tab>
Renders a tab using bootstrap 4 styling. Use the select
function to create your own tab component if you need different styling.
props
for
(String): The id of thePane
to connect the tab to
<Pane>
Wraps content that you want displayed via the panes.
props
id
(String): An id for the pane, will be connect to theTab
with the samefor
value
select
A Higher order component for creating tabs. Using it will inject active
and changeTab
into the wrapped component. See the source for Tab
for details.