Gallery, featured


Install
npx shadcn add @klarhimmel/gallery-featuredDetailsAbout, usage, props and more
One large lead image beside a stacked column of two or three smaller ones, each with a caption. A guided look: start here, then these.
Import
Import
- gallery/featured
- Category
- A grid of images with captions. New project? Set it up once: /get-started/installation.
Notes
When to use it
One large lead image with two or three smaller ones stacked beside it, each with a caption. It guides the eye: look here first, then at these. For an even set of images use gallery-grid.
Writing for it
- The featured caption allows 120 characters. Name the moment or place, because the lead image is the one people actually read about. - Choose exactly two or three thumbs. With three, the last one fills the full row at medium widths, so put the strongest of the small images last. - Write alt text for every image, since the captions are optional and an empty caption hides its line.
Watch out for
The lead is cropped to 4 by 3 and the thumbs to 16 by 10, so a portrait photo will be cut hard at the top and bottom. Below the wide breakpoint the thumbs fall into a single row or two columns.
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Name the topic' | Text, up to 60 characters. |
title | string | 'Say what to look at first' | Text, up to 120 characters. |
description | string | 'Say in one line what the pictures s…' | Text, up to 300 characters. |
featured | { media, caption } | {…} | Fields: media, caption. |
thumbs | { media, caption }[] | 3 items | List of 2 to 3. Each item: media, caption. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |