Tabs
Underline tabs from the opportunity and contact workspaces: 12 px labels with a 14 px icon, and an orange underline that slides to the selected tab. Built on ui-sdk's Tabs: arrow keys move between tabs and select them, Home and End jump to the ends.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { UnderlineTabs, Tabs, TabsList, TabsTab, TabsPanels, TabsPanel } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Use UnderlineTabs for workspace sections driven by value, like an opportunity's Overview, Tasks and Notes. Compose Tabs, TabsList, TabsTab and TabsPanel when each tab owns its content. |
| Do | Put the panels in TabsPanels, so switching slides the new panel in and the height eases instead of jumping the content below. |
| Do | Name the list with aria-label, like "Opportunity sections". |
| Do | Leave count out while it's unknown. A count that shows 0 while loading tells a lawyer there are no open tasks. |
| Don't | Use tabs to switch between views of the same data, like a list and a board. Use ViewSwitch, or SegmentedControl for a choice in a form or filter. |
Props
Tabs takes ui-sdk's Tabs options: value, defaultValue, onValueChange, orientation, activation (automatic or manual), loop and controller. TabsTab takes value, disabled and render.
UnderlineTabs
| Prop | Type | Default | Description |
|---|---|---|---|
| tabs * | unknown | — | The tabs, in order: value, label, and an optional count, icon or link. |
| value * | TValue | — | The selected tab's value. |
| onValueChange | (value: TValue) => void | — | Runs with the tab's value when another is selected. |
| aria-label | string | — | Names the tab list for screen readers, like "Opportunity sections". |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
| tabClassName | string | — | Classes for every tab. |
TabsList
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
TabsTab
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| icon | ReactNode | — | A 14 px icon before the label. It takes the tab's colour. |
| count | number | — | A small count after the label, like the number of open tasks. Leave it out while it's unknown. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
TabsPanels
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | The TabsPanels, one per tab. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
TabsPanel
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
Code
What the playground shows, ready to copy.
import { Tabs, TabsList, TabsTab } from "@leap-crm/design-system";
<Tabs defaultValue="tasks">
<TabsList aria-label="Sections">
<TabsTab value="overview">Overview</TabsTab>
<TabsTab value="tasks" count={3}>Tasks</TabsTab>
<TabsTab value="notes">Notes</TabsTab>
</TabsList>
</Tabs>Workspace tabs
UnderlineTabs takes the CRM's tab list as it is: value, label, icon, count. Click or use the arrow keys; the underline slides along.
With panels
Compose Tabs, TabsList, TabsTab and TabsPanel when each tab owns content, with the panels in TabsPanels so switching turns the page: the new panel slides in toward the tab you picked while the old one crossfades out, and the height eases between panels of different lengths. Reduced motion only crossfades. Tab from the list moves into the selected panel.
States
Selected (orange underline, #ad6430 label at 450), unselected, hover (darker label) and disabled. Tab to see focus wrap the whole tab, underline included.
What the examples share
The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.
import { Eye, FileText, Link, ListTree, Phone, SquareCheckBig, StickyNote } from "lucide-react";
import { useState } from "react";
import { Tabs, TabsList, TabsPanel, TabsPanels, TabsTab, UnderlineTabs, type TabItem } from "@leap-crm/design-system";
const workspace = [
{ value: "overview", label: "Overview", icon: Eye },
{ value: "tasks", label: "Tasks", icon: SquareCheckBig, count: 3 },
{ value: "notes", label: "Notes", icon: StickyNote },
{ value: "documents", label: "Documents", icon: FileText, count: 12 },
{ value: "relationships", label: "Relationships", icon: Link },
{ value: "interactions", label: "Interactions", icon: Phone },
{ value: "extra-fields", label: "Extra Fields", icon: ListTree },
] as const satisfies readonly TabItem[];
type Section = (typeof workspace)[number]["value"];
function WorkspaceTabs() {
const [value, setValue] = useState<Section>("overview");
return (
<UnderlineTabs
aria-label="Opportunity sections"
tabs={workspace}
value={value}
onValueChange={setValue}
/>
);
}Keyboard
The keys it answers to. Tab moves between components, arrows move within them.
| Keys | What they do |
|---|---|
| Tab | Moves focus to the selected tab, then from the tab list into its panel. |
| ArrowRightArrowLeft | Move focus and select the tab. |
| HomeEnd | Move to the first and last tabs. |
| Shift + Tab | From the panel, returns to the selected tab. |







