HextaUI

Color picker (UI SDK): Inline

Render the parts in place, without a popover, for a settings page or a sidebar.

import {
  ColorPicker,
  ColorPickerArea,
  ColorPickerInput,
  ColorPickerSlider,
  ColorPickerSwatch,
} from "@/components/ui/ui-sdk-color-picker"

function UiSdkColorPickerInline() {
  return (
    <ColorPicker aria-label="Brand color" defaultValue="#0ea5e9">
      <ColorPickerArea />
      <ColorPickerSlider channel="hue" />
      <div className="flex items-center gap-2">
        <ColorPickerSwatch />
        <ColorPickerInput aria-label="Hex" />
      </div>
    </ColorPicker>
  )
}

export { UiSdkColorPickerInline }

This adds the example as components/examples/ui-sdk-color-picker/inline.tsx, together with the Color picker component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/ui-sdk-color-picker-inline.json

To add only the component, follow the Color picker installation.

Props in this example

The Color picker props this example sets, from the API reference.

PropTypeDefault
defaultValue
string"black"
PropTypeDefault
channelHue, or blue in sRGB, by default.
ColorChannel–

Every prop is in the Color picker API reference.

See them all, with keyboard support and accessibility notes, on the Color picker page.