> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twenty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ColorSample

> Display a theme color or a custom color alongside a text label.

export const StoryEmbed = ({storyId, title, height = 120}) => <>
    <Tabs>
      <Tab title="Light">
        <iframe title={`${title} (light)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:light`} width="100%" height={height} loading="lazy" allow="clipboard-write" style={{
  border: 0
}} />
      </Tab>
      <Tab title="Dark">
        <iframe title={`${title} (dark)`} src={`https://storybook.twenty.com/iframe.html?id=${storyId}&viewMode=story&globals=colorScheme:dark`} width="100%" height={height} loading="lazy" allow="clipboard-write" style={{
  border: 0
}} />
      </Tab>
    </Tabs>
    <a href={`https://storybook.twenty.com/?path=/story/${storyId}`}>
      Open in Storybook
    </a>
  </>;

`ColorSample` is a non-interactive color swatch. Use it next to a label so the meaning does not depend on color alone. Selection belongs to the surrounding control.

<StoryEmbed storyId="ui-data-display-colorsample--display" title="ColorSample example" height={90} />

## Usage

```tsx theme={null}
import { ColorSample } from 'twenty-ui/primitives/data-display';
import { Text } from 'twenty-ui/primitives/typography';

export const PriorityColor = () => (
  <Text style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
    <ColorSample colorName="red" render={<span />} aria-hidden="true" />
    High priority
  </Text>
);
```

`colorName` selects a theme palette entry for the fill and border. `variant` accepts `default` or `circle`. Omitting it uses the default shape.

## Custom colors

```tsx theme={null}
import { ColorSample } from 'twenty-ui/primitives/data-display';
import { Text } from 'twenty-ui/primitives/typography';

export const BrandColor = () => (
  <Text style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
    <ColorSample
      colorName="blue"
      color="#2563eb"
      render={<span />}
      aria-hidden="true"
    />
    Brand blue
  </Text>
);
```

A custom `color` overrides the fill; `colorName` remains required and still determines the border color. Native props, `className`, `style`, and `ref` target the swatch div. `render` accepts an element or callback through Base UI composition, for example a span inside text. Consumer styles override the default fill, border, or geometry. Decorative swatches use `aria-hidden="true"`; a standalone meaningful swatch uses `role="img"` with `aria-label` or `aria-labelledby`. To offer selectable colors, compose the swatch inside a labeled [ListItem](/ui/primitives/navigation/list-item).

## Migration

`ColorSampleProps` and `ColorSampleVariant` remain available from the data-display family. The unused `pipeline` variant is removed. Product-specific indicators belong in the application, using native styles or composition. Default and circle swatches keep their existing appearance.

## Props

<ParamField body="aria-hidden" type="Booleanish">
  Mark decorative swatches as hidden from assistive technology.
</ParamField>

<ParamField body="aria-label" type="string">
  Accessible name when the caller supplies role="img".
</ParamField>

<ParamField body="className" type="string">
  CSS class merged with the swatch class.
</ParamField>

<ParamField body="color" type="string">
  CSS color that overrides the background; the border still uses `colorName`.
</ParamField>

<ParamField body="colorName" type="&#x22;amber&#x22; | &#x22;blue&#x22; | &#x22;bronze&#x22; | &#x22;brown&#x22; | &#x22;crimson&#x22; | &#x22;cyan&#x22; | &#x22;gold&#x22; | &#x22;grass&#x22; | &#x22;gray&#x22; | &#x22;green&#x22; | &#x22;iris&#x22; | &#x22;jade&#x22; | &#x22;lime&#x22; | &#x22;mint&#x22; | &#x22;orange&#x22; | &#x22;pink&#x22; | &#x22;plum&#x22; | &#x22;purple&#x22; | &#x22;red&#x22; | &#x22;ruby&#x22; | &#x22;sky&#x22; | &#x22;tomato&#x22; | &#x22;turquoise&#x22; | &#x22;violet&#x22; | &#x22;yellow&#x22;" required>
  Theme color used for the background and border. Required even when `color` overrides the background.
</ParamField>

<ParamField body="ref" type="Ref<HTMLDivElement>">
  Ref to the swatch div, or the element supplied through render.
</ParamField>

<ParamField body="render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}>">
  Element or render callback composed through Base UI useRender.
</ParamField>

<ParamField body="style" type="CSSProperties">
  Native styles merged with the swatch color defaults. Explicit styles win.
</ParamField>

<ParamField body="variant" type="&#x22;circle&#x22; | &#x22;default&#x22;">
  Generic swatch shape: `default` or `circle`. Omitting it uses the default shape.
</ParamField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.