- Prop
tabs- Type
TabItem<string>[]- Default
- —
- Requirement
- required
Docs Components Navigation
Tabs
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
const tabsFixture = { id: "tabs", defaultValue: "overview", tabs: [ { value: "overview", label: "Overview", content: "Deployment health is stable." }, { value: "history", label: "History", content: "Six releases shipped this month." }, { value: "settings", label: "Settings", content: "Notification settings are locked.", disabled: true }, ],} satisfies { id: string; defaultValue: string; tabs: Array<{ value: string; label: string; content: string; disabled?: boolean }>;}; import { Tabs } from "@grassroot/ui-react"; export default function TabsDemo() { return ( <div> <Tabs {...tabsFixture} /> </div> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script setup lang="ts">import { Tabs } from "@grassroot/ui-vue";const tabsFixture = { id: "tabs", defaultValue: "overview", tabs: [ { value: "overview", label: "Overview", content: "Deployment health is stable." }, { value: "history", label: "History", content: "Six releases shipped this month." }, { value: "settings", label: "Settings", content: "Notification settings are locked.", disabled: true }, ],} satisfies { id: string; defaultValue: string; tabs: Array<{ value: string; label: string; content: string; disabled?: boolean }>;}; </script> <template> <div> <Tabs :tabs="tabsFixture.tabs" :default-value="tabsFixture.defaultValue" /> </div></template>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Component } from "@angular/core";import { GrassrootTabs } from "@grassroot/ui-angular";const tabsFixture = { id: "tabs", defaultValue: "overview", tabs: [ { value: "overview", label: "Overview", content: "Deployment health is stable." }, { value: "history", label: "History", content: "Six releases shipped this month." }, { value: "settings", label: "Settings", content: "Notification settings are locked.", disabled: true }, ],} satisfies { id: string; defaultValue: string; tabs: Array<{ value: string; label: string; content: string; disabled?: boolean }>;}; @Component({ selector: "app-tabs-demo", standalone: true, imports: [GrassrootTabs], template: ` <div> <grassroot-tabs [tabs]="tabs" [value]="fixture.defaultValue" /> </div> `,})export class TabsDemoComponent { protected readonly fixture = tabsFixture; protected readonly tabs = [...tabsFixture.tabs];} export default TabsDemoComponent;- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script lang="ts"> import { Tabs } from "@grassroot/ui-svelte"; const tabsFixture = { id: "tabs", defaultValue: "overview", tabs: [ { value: "overview", label: "Overview", content: "Deployment health is stable." }, { value: "history", label: "History", content: "Six releases shipped this month." }, { value: "settings", label: "Settings", content: "Notification settings are locked.", disabled: true }, ], } satisfies { id: string; defaultValue: string; tabs: Array<{ value: string; label: string; content: string; disabled?: boolean }>; }; </script> <div> <Tabs tabs={tabsFixture.tabs} defaultValue={tabsFixture.defaultValue} /></div>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
/** @jsxImportSource solid-js */import { Tabs } from "@grassroot/ui-solid";const tabsFixture = { id: "tabs", defaultValue: "overview", tabs: [ { value: "overview", label: "Overview", content: "Deployment health is stable." }, { value: "history", label: "History", content: "Six releases shipped this month." }, { value: "settings", label: "Settings", content: "Notification settings are locked.", disabled: true }, ],} satisfies { id: string; defaultValue: string; tabs: Array<{ value: string; label: string; content: string; disabled?: boolean }>;}; export default function TabsDemo() { return ( <div> <Tabs tabs={tabsFixture.tabs} defaultValue={tabsFixture.defaultValue} /> </div> );}Installation
API Reference
Import
import { Tabs } from "@grassroot/ui-react";
Props
Prop
Type
Default
Requirement
tabsTabItem<string>[]—
required
valuestring | undefined—
optional
defaultValuestring | undefined—
optional
onValueChange((value: string) => void) | undefined—
optional
classNamestring | undefined—
optional
idstring | undefined—
optional
- Prop
value- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
onValueChange- Type
((value: string) => void) | undefined- Default
- —
- Requirement
- optional
- Prop
className- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
id- Type
string | undefined- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onValueChange | ((value: string) => void) | undefined |
Import
import { Tabs } from "@grassroot/ui-vue";
Props
Prop
Type
Default
Requirement
tabsTabItem[]—
required
modelValuestring | undefined—
optional
defaultValuestring | undefined—
optional
idstring | undefined—
optional
- Prop
tabs- Type
TabItem[]- Default
- —
- Requirement
- required
- Prop
modelValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
id- Type
string | undefined- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
update:modelValue | [value: string] |
Content regions
paneltab
Import
import { Component } from "@angular/core";
import { GrassrootTabs } from "@grassroot/ui-angular";
Props
Prop
Type
Default
Requirement
tabsreadonly TabItem[]—
required
idstring"grassroot-tabs"optional
valuestring—
optional
- Prop
tabs- Type
readonly TabItem[]- Default
- —
- Requirement
- required
- Prop
id- Type
string- Default
"grassroot-tabs"- Requirement
- optional
- Prop
value- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
valueChange | string |
Import
import { Tabs } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
tabsTabItem[]—
required
valuestring—
optional
defaultValuestring—
optional
idstring—
optional
onValueChange(value: string) => void—
optional
classNamestring—
optional
- Prop
tabs- Type
TabItem[]- Default
- —
- Requirement
- required
- Prop
value- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
onValueChange- Type
(value: string) => void- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onValueChange | (value: string) => void |
Content regions
paneltab
Import
import { Tabs } from "@grassroot/ui-solid";
Props
Prop
Type
Default
Requirement
tabsTabItem[]—
required
valuestring—
optional
defaultValuestring—
optional
onValueChange(value: string) => void—
optional
classNamestring—
optional
idstring—
optional
- Prop
tabs- Type
TabItem[]- Default
- —
- Requirement
- required
- Prop
value- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string- Default
- —
- Requirement
- optional
- Prop
onValueChange- Type
(value: string) => void- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
onValueChange | (value: string) => void |