# layout.collection

Equal items shown side by side as a grid: people to follow, featured sources. It fits as many columns as its own width allows, so it works in a sidebar as well as across a page; set columns from a breakpoint only when the count matters

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.collection">
  …
</Layout>
```

## Choosing between neighbours

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

| If it is for… | Use |
|---|---|
| Equal items shown side by side as a grid: people to follow, featured sources. It fits as many columns as its own width allows, so it works in a sidebar as well as across a page; set columns from a breakpoint only when the count matters | `layout.collection` (this page) |
| Equal items in a grid that all stay the same size (rather than [`layout.showcase`](https://www.prongs.dev/docs/intents/layout/showcase.md)) | `layout.collection` (this page) |
| Equal items shown side by side as a grid (rather than [`layout.list`](https://www.prongs.dev/docs/intents/layout/list.md)) | `layout.collection` (this page) |
| Headline figures that stand on their own (rather than [`layout.tally`](https://www.prongs.dev/docs/intents/layout/tally.md)) | `layout.collection` (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.grid`](https://www.prongs.dev/docs/intents/ui.md#arrange-grid)

## 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.collection 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.grid`](https://www.prongs.dev/docs/intents/ui.md#arrange-grid) — Grid of equal cells, as many columns as its own width fits

  ```
  grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))]
  ```

- `layout.collection` (this page) — Equal items shown side by side as a grid: people to follow, featured sources. It fits as many columns as its own width allows, so it works in a sidebar as well as across a page; set columns from a breakpoint only when the count matters

  ```
  gap-6
  ```

Final classes

```
grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))]
gap-6
```

Definition

```ts
'layout.collection': {
  kind: 'semantic',
  description: 'Equal items shown side by side as a grid: people to follow, featured sources. It fits as many columns as its own width allows, so it works in a sidebar as well as across a page; set columns from a breakpoint only when the count matters',
  refs: ['arrange.grid'],
  binding: { classes: 'gap-6' },
},
```
