Tabs
Tabs switch between panels of related content in one place. Use them to split a view into sections that users visit one at a time.
Make changes to your account here. Click save when you're done.
Installation
Run npx nxds-cli@latest init first if nxds isn’t set up in your app yet. See Install.
Usage
Composition
Examples
Underline variant
Set variant="underline" on TabsList for a line under the active tab.
Account settings with underline variant tabs.
Small size
Set size="sm" on TabsList for compact tabs.
Small size tabs content.
Large size
Set size="lg" on TabsList for roomier tabs.
Large size tabs content.
With disabled tab
Disable a TabsTrigger so users can see the tab but not open it.
Account content
Props
Tabs
Tabs adds no props of its own; it accepts the props of the element or primitive it wraps.
TabsContent
TabsContent adds no props of its own; it accepts the props of the element or primitive it wraps.
TabsList
| Prop | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | "lg" | "default" | Size of every trigger in the list. |
variant | "default" | "underline" | "default" | Visual style of every trigger in the list. |
TabsTrigger
TabsTrigger adds no props of its own; it accepts the props of the element or primitive it wraps.
Tabs switch between panels of related content in one place. Use them to split a view into sections that users visit one at a time.
Installation
Install the following dependencies:
Copy and paste the following code into your project.
components/tabs/TabsContent.vue components/tabs/TabsList.vue components/tabs/TabsTrigger.vue components/tabs/index.ts Keep each file at the path shown above it.
Paths are relative to
packages/vue/src/. Keep the same folders under your@/root, and the imports between files work without edits.
Usage
Examples
Underline variant
Set variant="underline" on TabsList for a line under the active tab.
Small size
Set size="sm" on TabsList for compact tabs.
Large size
Set size="lg" on TabsList for roomier tabs.
With disabled tab
Disable a TabsTrigger so users can see the tab but not open it.
Props
TabsContent
TabsContent adds no props of its own; it accepts the props of the element or primitive it wraps.
TabsList
| Prop | Type | Default | Description |
|---|---|---|---|
size | "default" | "sm" | "lg" | "default" | Size of every trigger in the list. |
variant | "default" | "underline" | "default" | Visual style of every trigger in the list. |
TabsTrigger
TabsTrigger adds no props of its own; it accepts the props of the element or primitive it wraps.