Animate UI

Tabs

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

Made by imskyleen
Edit on GitHub

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

Change your password here. After saving, you'll be logged out.

Installation

Usage

With Highlight

<Tabs>
  <TabsHighlight>
    <TabsList>
      <TabsHighlightItem value="account">
        <TabsTrigger value="account">Account</TabsTrigger>
      </TabsHighlightItem>
      <TabsHighlightItem value="password">
        <TabsTrigger value="password">Password</TabsTrigger>
      </TabsHighlightItem>
    </TabsList>
  </TabsHighlight>
  <TabContents>
    <TabsContent value="account">
      Make changes to your account here.
    </TabsContent>
    <TabsContent value="password">Change your password here.</TabsContent>
  </TabContents>
</Tabs>

Without Highlight

<Tabs>
  <TabsList>
    <TabsTrigger value="account">Account</TabsTrigger>
    <TabsTrigger value="password">Password</TabsTrigger>
  </TabsList>
  <TabContents>
    <TabsContent value="account">
      Make changes to your account here.
    </TabsContent>
    <TabsContent value="password">Change your password here.</TabsContent>
  </TabContents>
</Tabs>

API Reference

Tabs

PropTypeDefault
defaultValue?
string
-
value?
string
-
onValueChange?
(value: string) => void
-
...props?
React.ComponentProps<"div">
-

TabsHighlight

Animate UI API Reference - Highlight
PropTypeDefault
transition?
Transition
{ type: "spring", stiffness: 200, damping: 25 }

TabsHighlightItem

Animate UI API Reference - HighlightItem

TabsList

PropTypeDefault
...props?
React.ComponentProps<"div">
-

TabsTrigger

PropTypeDefault
value
string
-
asChild?
boolean
false
...props?
HTMLMotionProps<"button">
-

TabsContents

PropTypeDefault
transition?
Transition
{ type: "spring", stiffness: 300, damping: 32, bounce: 0, restDelta: 0.01 }
...props?
React.ComponentProps<"div">
-

TabsContent

PropTypeDefault
value
string
-
asChild?
boolean
false
...props?
HTMLMotionProps<"div">
-

Built by Skyleen. The source code is available on GitHub.