prongs
GitHub

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

Renders

<div>

Profile

Comes from

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

Example

Preview
ALAda
ATAlan
GHGrace
<Layout intent="layout.collection">
{people.map((p) => (
<Layout key={p.id} intent="layout.panel">…</Layout>
))}
</Layout>

Connections

Choosing between neighbours

  • If it is

    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
  • Equal items in a grid

    rather than layout.split
    layout.collection
  • Equal items shown side by side as a grid

    rather than layout.list
    layout.collection

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

    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

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