Tabs

Component that lets the user conditionally render pages or JSX based on which tab is active.

Overview content

Import

JSX

Usage

JSX

Variants

Local Tabs

Local tabs are tabs that conditionally render small JSX Elements for which creating layouts is an overkill. E.g. toggle between monthly or yearly plans to render the respective pricing cards.

Overview content
JSX

Router Tabs

Router tabs are tabs used in layouts where the user can switch between different pages. E.g. on a dashboard page switch between analytics, settings and an overview page.

Overview content
JSX

Styling

Secondary

Overview content
JSX

Tertiary

Overview content
JSX

Disabled

Overview content
JSX

Props

Tabs

PropTypeDefaultDescription
type*"local" | "router"localtype of tabs
initialTabId*string-id of tab which should be active on first render
styling"primary" | "secondary" | "tertiary"-style type of the tabs
children*ReactNode-Expecting <Tabs.TabsList> and in case of local tabs also <Tabs.TabRender>

Tabs.TabsList

PropTypeDefaultDescription
children*ReactNode-Expecting <Tabs>

Tab

PropTypeDefaultDescription
id*string-identifies the respective tab
disabledbooleanfalseEnables/disabled activation of tab
children*ReactNode-Expecting either <button> or <Link>

Tabs.TabRender

PropTypeDefaultDescription
id*string-identifies the respective tab
children*ReactNode-Expecting the component to render when the tab of the given id is active
*: mandatory props