Tabs

Tabs

A set of layered sections of content—known as tab panels—that are displayed one at a time.

Account

Make changes to your account here. Click save when you're done.

Usage

Import the component. It's mandatory to wrap the whole component with the Tailwind tag.

const { Tailwind } = VM.require("uiisnear.near/widget/tailwind");
 
const {
  Tabs,
  TabsList,
  TabsTrigger,
  TabsContent,
} = VM.require("uiisnear.near/widget/tabs");
 
if (Tailwind == undefined) return "";
<Tailwind>
  <Tabs defaultValue="account" className="w-96">
    <TabsList>
      <TabsTrigger value="account">Account</TabsTrigger>
      <TabsTrigger value="password">Password</TabsTrigger>
    </TabsList>
    <TabsContent value="account">Make changes to your account here.</TabsContent>
    <TabsContent value="password">Change your password here.</TabsContent>
  </Tabs>
</Tailwind>

API Reference

Tabs

Contains all the tabs component parts.

PropTypeDefault
defaultValue
string
---
value
string
---
onValueChange
function
---
orientation
enum
"horizontal"
dir
enum
---
activationMode
enum
"automatic"
Data attributeValues
[data-orientation]"vertical" | "horizontal"

TabsList

Contains the triggers that are aligned along the edge of the active content.

PropTypeDefault
loop
boolean
true
Data attributeValues
[data-orientation]"vertical" | "horizontal"

TabsTrigger

The button that activates its associated content.

PropTypeDefault
value*
string
---
disabled
boolean
false
Data attributeValues
[data-state]"active" | "inactive"
[data-disabled]Present when disabled
[data-orientation]"vertical" | "horizontal"

TabsContent

Contains the content associated with each trigger.

PropTypeDefault
value*
string
---
forceMount
boolean
---
Data attributeValues
[data-state]"active" | "inactive"
[data-orientation]"vertical" | "horizontal"

Classnames

Classnames available to customize the component.

FunctionClassname
TabsListtabsListClassname
TabsTriggertabsTriggerClassname
TabsContenttabsContentClassname