# Segmented control · Divan

> Switching between views of the same content uses a segmented control (Tabs restyled): the chosen segment lifts; no underline.

Part of Divan, the DivanWorks design system. Web page: https://brand.divanworks.com/segmented · All topics: https://brand.divanworks.com/llms.txt

## Rules

- Tabs.Root, Tabs.List, Tabs.Trigger, Tabs.Content for views.
- ToggleGroup for a setting with two or three values, like the language.
- On phones a long segmented control scrolls inside its own container.

## Components

### Tabs

Segmented control: views of the same content.

```ts
import * as Tabs from '#lib/components/ui/tabs/index.js';
```

```svelte
<Tabs.Root value="month">
	<Tabs.List>
		<Tabs.Trigger value="month">30 Days</Tabs.Trigger>
		<Tabs.Trigger value="all">All Time</Tabs.Trigger>
	</Tabs.List>
	<Tabs.Content value="month">…</Tabs.Content>
</Tabs.Root>
```

### ToggleGroup

A setting with two or three values.

```ts
import * as ToggleGroup from '#lib/components/ui/toggle-group/index.js';
```

```svelte
<ToggleGroup.Root type="single" bind:value={view}>
	<ToggleGroup.Item value="cards">Cards</ToggleGroup.Item>
	<ToggleGroup.Item value="list">List</ToggleGroup.Item>
</ToggleGroup.Root>
```
