React

Tabs

A component that allows switching content by tabs within a single screen.

Available since@seed-design/react@0.0.1, @seed-design/css@0.0.1

Installation

npx @seed-design/cli@latest add ui:tabs

Props

TabsRoot

Prop

Type

orientation?"horizontal" | "vertical" | undefined
value?string | undefined
defaultValue?string | undefined
onValueChange?((value: string) => void) | undefined

TabsList

Prop

Type

TabsTrigger

Prop

Type

notification?boolean | undefined
valuestring
disabled?boolean | undefined

TabsCarousel

Prop

Type

swipeable?boolean | undefined
autoHeight?boolean | undefined
loop?boolean | undefined
dragThreshold?number | undefined
onSettle?(() => void) | undefined

TabsContent

Prop

Type

valuestring

Examples

Layout Fill (Default)

Layout Hug

Size Medium

Size Small (Default)

Transition

When you wrap TabsContent components with the TabsCarousel component, the content smoothly transitions when tabs change.

Swipeable

Adding the swipeable attribute to the TabsCarousel component allows moving between tabs with swipe gestures.

Using Tabs.carouselPreventDrag, you can set specific elements to not respond to drag gestures.

Disabled

Notification

Sticky List

This is an example used when tabs occupy the full screen and Tabs.List is fixed at the top.

Standalone

This is an example used when you want to fully own the content area without using TabContent.

The Swipe feature provided by tabs cannot be used.

Dynamic Height

This is an example used to fit the content below directly under the tabs when each tab has a different height.

If tabs change frequently and tabs have many network requests, please consider caching carefully.

Scroll to Top

Table of contents