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
Layout intents
Example
One
Two
Three
<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
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.itemthis pageA gallery item that widens in focus
rather thanlayout.arrivallayout.showcase.itemthis 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
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.stackChildren in a column, free to shrink inside a row or grid
flex min-w-0 flex-col
layout.showcase.itemOne 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]
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]
'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]',
},
},