# Segmented control (UI SDK): Full width

> Give the control `w-full` and the items share its width.

Canonical: https://hextaui.com/docs/ui-sdk-segmented-control/examples/full-width

Component docs: https://hextaui.com/docs/ui-sdk-segmented-control

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/ui-sdk-segmented-control-full-width.json
```

This adds `components/examples/ui-sdk-segmented-control/full-width.tsx` with the Segmented control component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/ui-sdk-segmented-control/full-width.tsx"
import {
  SegmentedControl,
  SegmentedControlItem,
} from "@/components/ui/ui-sdk-segmented-control"

function UiSdkSegmentedControlFullWidth() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-2">
      <p id="billing-period" className="m-0 text-sm font-medium">
        Billing period
      </p>
      <SegmentedControl
        aria-labelledby="billing-period"
        defaultValue="yearly"
        className="w-full"
      >
        <SegmentedControlItem value="monthly">Monthly</SegmentedControlItem>
        <SegmentedControlItem value="yearly">Yearly</SegmentedControlItem>
      </SegmentedControl>
    </div>
  )
}

export { UiSdkSegmentedControlFullWidth }
```

## Props in this example

### SegmentedControl

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `T \| null` | – |  |

### SegmentedControlItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string` | – |  |

## More Segmented control examples

- [Sizes](https://hextaui.com/docs/ui-sdk-segmented-control/examples/sizes)
- [Icons](https://hextaui.com/docs/ui-sdk-segmented-control/examples/icons)
- [Vertical](https://hextaui.com/docs/ui-sdk-segmented-control/examples/vertical)
- [Disabled](https://hextaui.com/docs/ui-sdk-segmented-control/examples/disabled)
- [Controlled](https://hextaui.com/docs/ui-sdk-segmented-control/examples/controlled)
- [Form](https://hextaui.com/docs/ui-sdk-segmented-control/examples/form)
- [Read-only](https://hextaui.com/docs/ui-sdk-segmented-control/examples/read-only)
- [Right to left](https://hextaui.com/docs/ui-sdk-segmented-control/examples/rtl)
