# layout.list

A list of items of the same kind: articles, people, notifications. Children are layout.item

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

## Example

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

## Choosing between neighbours

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

| If it is for… | Use |
|---|---|
| A list of items of the same kind: articles, people, notifications. Children are layout.item | `layout.list` (this page) |
| Records compared by the same fields, like a members table | [`layout.table`](https://www.prongs.dev/docs/intents/layout/table.md) |
| Equal items shown side by side as a grid | [`layout.collection`](https://www.prongs.dev/docs/intents/layout/collection.md) |
| Items read one after another, like a feed or notifications (rather than [`layout.table`](https://www.prongs.dev/docs/intents/layout/table.md)) | `layout.list` (this page) |
| A list of records someone reads or acts on (rather than [`layout.points`](https://www.prongs.dev/docs/intents/layout/points.md)) | `layout.list` (this page) |
| A list of items someone reads or acts on (rather than [`layout.terminal.log`](https://www.prongs.dev/docs/intents/layout/terminal-log.md)) | `layout.list` (this page) |
| Lines between the items of a list (rather than [`layout.divider`](https://www.prongs.dev/docs/intents/layout/divider.md)) | `layout.list` (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.list 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.list` (this page) — A list of items of the same kind: articles, people, notifications. Children are layout.item

  ```
  divide-y divide-input
  ```

Final classes

```
flex min-w-0 flex-col divide-y divide-input
```

Definition

```ts
'layout.list': {
  kind: 'semantic',
  description: 'A list of items of the same kind: articles, people, notifications. Children are layout.item',
  refs: ['arrange.stack'],
  binding: { element: 'ul', classes: 'divide-y divide-input' },
  notFor: [
    {
      context: 'records compared by the same fields, like a members table',
      instead: 'layout.table',
    },
    {
      context: 'equal items shown side by side as a grid',
      instead: 'layout.collection',
    },
  ],
},
```
