# Chip (chip)

> Inline pill in outline, vermilion accent, or solid ink, with sans or mono type.

- Entry: component
- Category: UI
- Preview capabilities: none (still preview)
- Runtime: React
- Needs Remotion: no
- QA page: https://jbm-ui.bns.studio/c/chip
- JSON: https://jbm-ui.bns.studio/catalog/chip.json
- Registry item: https://jbm-ui.bns.studio/r/chip.json (source code in files[].content)

## Install

```sh
npx shadcn@latest add @jbm/chip
```

Also installs @jbm/tokens (registry dependencies install automatically).

## Required setup

1. Add the `@jbm` registry to components.json (keep any entries already there):

   ```json
   {
     "registries": {
       "@jbm": "https://jbm-ui.bns.studio/r/{name}.json"
     }
   }
   ```

2. Map `@/*` to `./src/*` in tsconfig.json `compilerOptions.paths`, so `@/jbm/…` imports resolve to src/jbm/.

## Files

Each file's source code is in the registry item JSON (https://jbm-ui.bns.studio/r/chip.json, files[].content).

| Source path | Installs to | Import |
| --- | --- | --- |
| `registry/jbm/ui/chip.tsx` | `src/jbm/ui/chip.tsx` | `@/jbm/ui/chip` |

## API

### `Chip` (component)

Inline-block, non-wrapping pill with a 2px border, 10×20px padding, and the 14px chip radius. Outline (card fill, line border, ink text) by default; `accent` fills vermilion, `solid` fills ink, both with cream text.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `React.ReactNode` | required | Chip text; kept on one line (white-space: nowrap). |
| `accent` | `boolean` | none | Fills and borders the chip with the vermilion accent. Takes precedence over `solid` when both are set. |
| `solid` | `boolean` | none | Fills and borders the chip with ink. |
| `mono` | `boolean` | none | Switches the face from Geist sans to Geist Mono. |
| `size` | `number` | `26` | Font size in stage pixels. |
| `style` | `React.CSSProperties` | none | Inline styles merged last. |

## Stage

fluid: Width follows the text. Height is 26px type at the font's normal line height (not set explicitly) plus 20px vertical padding and 4px of border; `size` scales the type only, not the padding.

## Examples

### Variants

```tsx
import { Chip } from "@/jbm/ui/chip"

<Chip>Default</Chip>
<Chip accent>Accent</Chip>
<Chip solid>Solid</Chip>
<Chip mono>Mono</Chip>
```

### Staggered row in a video

```tsx
import { Chip } from "@/jbm/ui/chip"
import { Stagger } from "@/jbm/motion/pop" // install @jbm/pop separately

<Stagger at={0.2} step={0.35}>
  {["Idea", "Datos"].map((text) => <Chip key={text}>{text}</Chip>)}
</Stagger>
```

## QA

- Compare default, accent, solid, and mono side by side: outline on card fill, cream text on vermilion and ink.
- Check that long chip text does not overflow the safe area, because chips never wrap; wrap the row container instead.
- Keep at most one accent chip per composition.

## Related

Installs:

- [Tokens (tokens)](https://jbm-ui.bns.studio/catalog/tokens.md)

Installed by:

- [SceneFromSpec (scene-spec)](https://jbm-ui.bns.studio/catalog/scene-spec.md)

Imported in examples:

- [Pop (pop)](https://jbm-ui.bns.studio/catalog/pop.md)

## More

- [llms.txt](https://jbm-ui.bns.studio/llms.txt): index of every item
- [catalog.json](https://jbm-ui.bns.studio/catalog.json): every item as JSON
- [Agent contract](https://jbm-ui.bns.studio/docs/agent-contract.md): what each field means
