prongs
GitHub

layout.list

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

Component

Renders

<ul>

Profile

Comes from

starter
Read https://www.prongs.dev/docs/intents/layout/list.md and tell me whether layout.list fits what I am building.

Example

Preview
  • AL
    Ada LovelaceOwner
  • AT
    Alan TuringAdmin
  • GH
    Grace HopperMember
<Layout intent="layout.list">
{members.map((m) => (
<Layout key={m.id} intent="layout.item">…</Layout>
))}
</Layout>

Connections

Choosing between neighbours

  • If it is

    Use

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

    layout.list
  • Records compared by the same fields, like a members table

    layout.table
  • Equal items shown side by side as a grid

    layout.collection
  • Items read one after another, like a feed or notifications

    rather than layout.table
    layout.list
  • Lines between the items of a list

    rather than layout.divider
    layout.list

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

    Children in a column, free to shrink inside a row or grid

    flex min-w-0 flex-col
  • layout.list

    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',
},
],
},