# Segmented Control

> A segmented control for timeframes and view modes like 24h, 7d and 30d, with a thumb that slides between the options.

A React component for shadcn/ui and Tailwind CSS, from ssych ui (https://ssych.com). Free, MIT licensed, the source lands in your repo.

## Install

```bash
npx shadcn@latest add @ssych/segmented-control
```

npm dependencies: clsx, motion, tailwind-merge

## Props

`<SegmentedControl />`

- `options`: `string[]`
- `value?`: `string`
- `onChange?`: `(v: string) => void className?: string`

## Where it belongs

- Controls: React control components: a segmented control, currency toggle, amount input with presets, avatar stack and preference cards. (https://ssych.com/library/s/controls)

## Related

- Crypto/Fiat: https://ssych.com/library/crypto-fiat.md
- Currency Amount: https://ssych.com/library/amount.md
- Avatar Stack: https://ssych.com/library/avatar-stack.md
- Preferences Card: https://ssych.com/library/preferences-card.md
- Price Scrubber: https://ssych.com/library/price-scrubber.md

## Links

- Live preview and code: https://ssych.com/library/segmented-control
- Source: https://github.com/savvasicevs/ssych-ui
- All components: https://ssych.com/llms-full.txt
