# Figure

Semantic figure wrapper with caption and credit line

> Component ID: `figure`
> Import: `import { Figure } from '@slipstream-ui/core'`
> Docs: https://slipstreamui.com/docs/components/figure
> Registry: https://slipstreamui.com/registry/figure.json
> Tier: atom · Package: @slipstream-ui/core@0.16.0
> Manifest schema: v1 · manifest: v1

## Design intent

Figure gives any media or illustration a semantic figure/figcaption pairing so captions are associated with content for assistive tech and SEO, with an optional credit line for attribution.

## Props

| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| caption | `ReactNode` | — | no | Caption content rendered in <figcaption> below the children |
| credit | `ReactNode` | — | no | Optional source/attribution line appended under the caption |
| align | `'left' | 'center'` | `left` | no | Caption text alignment |
| className | `string` | — | no | Additional CSS classes to apply |

## Examples

### Captioned chart

Caption and credit associate with the figure for assistive tech

```tsx
<Figure caption="Signups by week" credit="Internal analytics">
  <Chart />
</Figure>
```

### Centered caption

Caption centered under the media

```tsx
<Figure caption="Team photo" align="center">
  <img src="/team.jpg" alt="The team" />
</Figure>
```

## Anti-patterns

- **Don't use Figure for layout grouping** — Figure is semantic media markup. For generic grouping use Card, Section or a plain div.

## Accessibility

- **Semantic association**: Renders <figure> with <figcaption>, so the caption is programmatically tied to the content
- **Readable caption**: Caption uses text-xs muted styling at readable contrast

## Composition

- Compose with **Media** — Media composes Figure internally to add the aspect frame and image handling
  
  ```tsx
  <Media src="/a.jpg" alt="A" caption="Caption"/>
  ```
- Compose with **CoverImage** — CoverImage renders the seeded placeholder art that typically sits inside a Figure
  
  ```tsx
  <Figure caption="Cover"><CoverImage seed={slug} mark={<Icon/>}/></Figure>
  ```
- Related: Media, CoverImage, Prose

