Skip to content
Klarhimmel UI

Features, stacked cards

Features, stacked cards previewFeatures, stacked cards preview

Install

npx shadcn add https://ui.klarhimmel.com/r/features-stacked-cards.json
DetailsAbout, usage, props and more

An intro column (eyebrow, heading, lead, two actions) pinned beside a tall column of picture cards, each with a badge, name and line.

Import

Import

import Block from '@/components/klarhimmel/blocks/features-stacked-cards';
Also called
  • features/stacked-cards
About
An intro column (eyebrow, heading, lead, two actions) pinned beside a tall column of picture cards, each with a badge, name and line. On a phone the intro sits above the stacked cards.
Category
What it does, as a grid, a list, tabs or alternating rows. New project? Set it up once: /get-started/installation.

Notes

When to use it

An intro column with a heading, lead and two actions pinned beside a tall column of picture cards that each carry a badge, a name and a line. Use features-image-cards when the cards should sit in a grid.

Writing for it

- Let the intro say why the items belong together, in one or two short lines, since it stays in view while the cards scroll past. - Give each card a badge, a name and one line. The picture does most of the work, so choose images of the same kind. - Keep the number of cards modest, because the column is tall and the intro only stays pinned beside it.

Watch out for

On a phone the intro sits above the stacked cards and nothing is pinned. A long column of cards then reads as a plain list, so check the first screen still makes the point.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import FeaturesStackedCards from '@/components/klarhimmel/blocks/features-stacked-cards';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <FeaturesStackedCards props={{
          "eyebrow": "Name the group in two or three words",
          "title": "Say what this group of items is about",
          "description": "Open with one or two short lines that tell the reader why these items belong together.",
          "primary": {
            "label": "Main action",
            "href": "#primary"
          },
          "secondary": {
            "label": "Other action",
            "href": "#secondary"
          },
          "items": [
            {
              "badge": "Label",
              "title": "Name the first item",
              "description": "Describe the first item in a line or two: its purpose and its main benefit.",
              "media": {
                "src": "/pictures/photo-factory2.avif",
                "alt": "A production line in a large industrial hall"
              }
            },
            {
              "badge": "Label",
              "title": "Name the second item",
              "description": "Describe the second item in a line or two: its purpose and its main benefit.",
              "media": {
                "src": "/pictures/photo-florist1.avif",
                "alt": "A flower shop window in a brick building"
              }
            }
          ]
        }} />
      </BlockSurface>
    </Theme>
  );
}

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.

PropTypeDefaultDescription
eyebrowstring'Name the group in two or three words'Text, up to 40 characters.
titlestring'Say what this group of items is abo…'Text, up to 100 characters.
descriptionstring'Open with one or two short lines th…'Text, up to 240 characters.
primaryLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
items{ badge, title, description, media }[]4 itemsList of 2 to 6. Each item: badge, title, description, media.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.