0.2.0 • Published 12 months ago

@dbosoft/react-tabs v0.2.0

Weekly downloads
-
License
MPL-2.0
Repository
-
Last release
12 months ago

Tabs

Tabs will render arbitrary tabbed content based on Tab items passed as children.

Example Usage

<Tabs>
  <Tab heading="First Tab">
    <p>First tab content</p>
  </Tab>
  <Tab heading="Second Tab">
    <p>Second tab content</p>
  </Tab>
  <Tab heading="Third Tab">
    <p>Third tab content</p>
  </Tab>
</Tabs>

Component Props

Tabs

NameTypeDescriptionRequired
childrenReact.ReactNodeTab components to render.true
defaultTabIdxnumberIf set, the tab with the specified ID will be active by default. If not set or if the ID does not match, it will default to 0false
centeredbooleanIf true, the tabs are centered in their container, rather than left-alignedfalse
fullWidthBorderbooleanIf true, the border line underneath the tabs expands to the full width of the container, rather than being slightly padded from the edgesfalse

Tab

NameTypeDescriptionRequired
headingstringTitle of the tabtrue
tooltipstringOptional tooltip to be displayed next to the tab titlefalse
groupstringA unique identifier for a tab 'group' that, when active, all Tabs with this id will become active when one is selected. Note it's necessary to wrap the page with TabProvider for this feature to function.false
childrenReact.ReactNodeContent that should render when the associated tab is active.false