Skip to content

Tabs

Switches between views of one subject in place.

Base UI1.0 kB gzipSource Registry JSON

With panels

No errors in the last hour.

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/tabs.json

The CLI writes components/ikada/tabs.tsx and merges the ikada theme into your CSS. Or take it from the package: import { Tabs, TabsList, TabsTab, TabsPanel } from "@sproutboat/ikada";

Usage

import { Tabs, TabsList, TabsTab, TabsPanel } from "@/components/ikada/tabs";

<Tabs defaultValue="logs">
  <TabsList>
    <TabsTab value="overview">Overview</TabsTab>
    <TabsTab value="logs">Logs</TabsTab>
    <TabsTab value="settings">Settings</TabsTab>
  </TabsList>
  <TabsPanel value="overview">robin is live in eu-west.</TabsPanel>
  <TabsPanel value="logs">No errors in the last hour.</TabsPanel>
  <TabsPanel value="settings">Region, domain and environment variables.</TabsPanel>
</Tabs>

Examples

With panels

Switches between views of one subject in place. A raised pebble slides to the active tab.
No errors in the last hour.

Disabled tab

wren is live in us-east.

Props

TabsProps
PropTypeDescription
styleCSSProperties | ((state: TabsRootState) => CSSProperties)Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, TabsRootState>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
classNamestringClasses merged onto the root element, after ikada's own.
TabsListProps
PropTypeDescription
styleCSSProperties | ((state: TabsListState) => CSSProperties)Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, TabsListState>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
classNamestringClasses merged onto the root element, after ikada's own.
TabsTabProps
PropTypeDescription
styleCSSProperties | ((state: TabsTabState) => CSSProperties)Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, TabsTabState>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
classNamestringClasses merged onto the root element, after ikada's own.
TabsPanelProps
PropTypeDescription
styleCSSProperties | ((state: TabsPanelState) => CSSProperties)Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, TabsPanelState>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
classNamestringClasses merged onto the root element, after ikada's own.

Source: src/components/tabs.tsx