# layout.showcase.item

One item in a layout.showcase: its media, then its title and caption. Mark the caption with data-caption: it always takes its room, and shows only on the item in focus, so nothing moves. It rises into view when it appears (stagger them with an animationDelay), widens when it has data-active, and its image keeps its height and crops to fit

Component: [`<Layout>`](https://www.prongs.dev/docs/components/layout.md) · Renders: `<div>` · Profile: [UI](https://www.prongs.dev/docs/intents/ui.md)

## Example

```tsx
<Layout intent="layout.showcase.item">
  …
</Layout>
```

## Choosing between neighbours

Find the row that describes your element, and use the intent on the right.

| If it is for… | Use |
|---|---|
| One item in a layout.showcase: its media, then its title and caption. Mark the caption with data-caption: it always takes its room, and shows only on the item in focus, so nothing moves. It rises into view when it appears (stagger them with an animationDelay), widens when it has data-active, and its image keeps its height and crops to fit | `layout.showcase.item` (this page) |
| A gallery item that widens in focus (rather than [`layout.arrival`](https://www.prongs.dev/docs/intents/layout/arrival.md)) | `layout.showcase.item` (this page) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`arrange.stack`](https://www.prongs.dev/docs/intents/ui.md#arrange-stack)

## For registry authors

**Starter intents.** These are the intents `prongs add` puts in your registry, shown in this site’s theme. Yours are your own `registry.ts`: rename, restyle and add to them, and see them with `prongs add gallery`.

What this intent is built from and its entry in `components/prongs/registry.ts`. You only need this to change how it looks or to add an intent like it.

How layout.showcase.item resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

- [`arrange.stack`](https://www.prongs.dev/docs/intents/ui.md#arrange-stack) — Children in a column, free to shrink inside a row or grid

  ```
  flex min-w-0 flex-col
  ```

- `layout.showcase.item` (this page) — One item in a layout.showcase: its media, then its title and caption. Mark the caption with data-caption: it always takes its room, and shows only on the item in focus, so nothing moves. It rises into view when it appears (stagger them with an animationDelay), widens when it has data-active, and its image keeps its height and crops to fit

  ```
  min-w-0 cursor-pointer gap-3 transition-[flex-grow] duration-300
  ease-out animate-[showcase-in_0.6s_ease-out_both] sm:flex-1
  sm:data-[active]:flex-[1.6]
  sm:[&:not([data-active])_[data-caption]]:invisible
  motion-reduce:animate-none motion-reduce:transition-none
  [&_img]:aspect-auto [&_img]:h-64 [&_img]:w-full
  [&_img]:object-cover sm:[&_img]:h-[28rem]
  ```

Final classes

```
flex flex-col min-w-0 cursor-pointer gap-3
transition-[flex-grow] duration-300 ease-out
animate-[showcase-in_0.6s_ease-out_both] sm:flex-1
sm:data-[active]:flex-[1.6]
sm:[&:not([data-active])_[data-caption]]:invisible
motion-reduce:animate-none motion-reduce:transition-none
[&_img]:aspect-auto [&_img]:h-64 [&_img]:w-full
[&_img]:object-cover sm:[&_img]:h-[28rem]
```

Definition

```ts
'layout.showcase.item': {
  kind: 'semantic',
  description: 'One item in a layout.showcase: its media, then its title and caption. Mark the caption with data-caption: it always takes its room, and shows only on the item in focus, so nothing moves. It rises into view when it appears (stagger them with an animationDelay), widens when it has data-active, and its image keeps its height and crops to fit',
  refs: ['arrange.stack'],
  binding: {
    classes: 'min-w-0 cursor-pointer gap-3 transition-[flex-grow] duration-300 ease-out animate-[showcase-in_0.6s_ease-out_both] sm:flex-1 sm:data-[active]:flex-[1.6] sm:[&:not([data-active])_[data-caption]]:invisible motion-reduce:animate-none motion-reduce:transition-none [&_img]:aspect-auto [&_img]:h-64 [&_img]:w-full [&_img]:object-cover sm:[&_img]:h-[28rem]',
  },
},
```
