# Color picker (UI SDK): Read-only

> With `readOnly`, the thumbs stay focusable and the value is submitted, but drags, keys and typing leave the color alone.

Canonical: https://hextaui.com/docs/ui-sdk-color-picker/examples/read-only

Component docs: https://hextaui.com/docs/ui-sdk-color-picker

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/ui-sdk-color-picker-read-only.json
```

This adds `components/examples/ui-sdk-color-picker/read-only.tsx` with the Color picker component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/ui-sdk-color-picker/read-only.tsx"
import {
  ColorPicker,
  ColorPickerArea,
  ColorPickerInput,
  ColorPickerSlider,
  ColorPickerSwatch,
} from "@/components/ui/ui-sdk-color-picker"

function UiSdkColorPickerReadOnly() {
  return (
    <ColorPicker aria-label="Theme color" defaultValue="#22c55e" readOnly>
      <ColorPickerArea />
      <ColorPickerSlider channel="hue" />
      <div className="flex items-center gap-2">
        <ColorPickerSwatch />
        <ColorPickerInput aria-label="Hex" />
      </div>
    </ColorPicker>
  )
}

export { UiSdkColorPickerReadOnly }
```

## Props in this example

### ColorPicker

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string` | `"black"` |  |
| `readOnly` | `boolean` | `false` |  |

### ColorPickerSlider

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `channel` | `ColorChannel` | – | Hue, or blue in sRGB, by default. |

## More Color picker examples

- [Inline](https://hextaui.com/docs/ui-sdk-color-picker/examples/inline)
- [Alpha](https://hextaui.com/docs/ui-sdk-color-picker/examples/alpha)
- [OKLCH](https://hextaui.com/docs/ui-sdk-color-picker/examples/oklch)
- [Presets and channels](https://hextaui.com/docs/ui-sdk-color-picker/examples/channels)
- [Vertical sliders](https://hextaui.com/docs/ui-sdk-color-picker/examples/vertical)
- [Controlled](https://hextaui.com/docs/ui-sdk-color-picker/examples/controlled)
- [Form](https://hextaui.com/docs/ui-sdk-color-picker/examples/form)
- [Disabled](https://hextaui.com/docs/ui-sdk-color-picker/examples/disabled)
- [Right to left](https://hextaui.com/docs/ui-sdk-color-picker/examples/rtl)
