TidalUI

Segmented control preview

Switch between views with an animated selection indicator.

free · Essentials · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add https://tidalui.com/r/segmented-control.json

Import components/ui/tidal.css, components/ui/segmented-control.css. Wrap installed components in tidal-scope.

Preview

Segmented control component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/segmented-control.css";
import{TidalSegmentedControl}from"./components/ui/segmented-control";
export default()=><div className="tidal-scope"><TidalSegmentedControl label={"Demo"} onValueChange={() => {}} options={[{value:"value",label:"Demo"}]} value={"value"}/></div>;

API and props

TidalSegmentedControl.label (required)
string

Required label value accepted by this exported component.

TidalSegmentedControl.onValueChange (required)
(value: string) => void

Callback invoked when the value change interaction is proposed.

TidalSegmentedControl.options (required)
Array<SegmentOption>

Required options value accepted by this exported component.

TidalSegmentedControl.value (required)
string

Required value value accepted by this exported component.

TidalSegmentedControl.className
string | undefined

Optional class name value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas