ComponentsNew

Sliding Tabs

Text tabs with an indicator that glides to the selected one. Two styles: an underline or a white pill behind the text.

Customize

accentColor
secondaryColor
glowColor

Based on Line Tabs (MIT license) · Terms of use

More in Pro

View all

Props

11 properties
PropertyTypeDefaultDescription
tabsstring[]—Tab names.
defaultValuestring—Tab selected at first. The first one by default.
variant'line' | 'pill'"line"Indicator style: an underline or a filled pill.
centerbooleanfalseCenter the row.
durationnumber0.4Indicator glide duration in seconds.
bouncenumber0Indicator bounce. Zero means no overshoot.
onChange(tab: string) => void—Called with the selected tab.
accentColorstring"#ffffff"Main colour: the pill fill or the start of the underline. Text on the pill turns dark or white to stay readable.
secondaryColorstring"#a3a3a3"Second colour: where the underline gradient ends.
glowColorstring"rgba(255, 255, 255, 0.3)"Soft glow under the indicator.
classNamestring—Extra classes.

Dependencies

3 required packages

npm install motion clsx tailwind-merge

Related components

View all