Skip to content
Klarhimmel UI

Gallery, scattered pictures

Gallery, scattered pictures previewGallery, scattered pictures preview

Install

npx shadcn add @klarhimmel/gallery-scattered
DetailsAbout, usage, props and more

A centred label, heading, lead and two buttons in the middle of a tall section, with four rounded pictures of different sizes scattered round them at the corners.

Import

Import

import Block from '@/components/klarhimmel/blocks/gallery-scattered';
Also called
  • gallery/scattered
About
A centred label, heading, lead and two buttons in the middle of a tall section, with four rounded pictures of different sizes scattered round them at the corners. On a phone the text comes first and the pictures follow in two columns.
Category
A grid of images with captions. New project? Set it up once: /get-started/installation.

Notes

When to use it

Pick it when pictures should frame a short invitation rather than fill a grid: a centred heading and two buttons with four pictures scattered round them. For an even grid choose gallery-grid; for pictures stepping along a diagonal choose gallery-stepped.

Writing for it

- Title up to 100 characters, lead up to 240; exactly four pictures: wide, upright, square, wide, in that order. - Two buttons, the second optional.

Watch out for

The scatter only shows from about 56 rem and the section is tall (about 55 rem) there. On a phone the text comes first and the pictures follow in two columns.

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 GalleryScattered from '@/components/klarhimmel/blocks/gallery-scattered';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <GalleryScattered props={{
          "eyebrow": "Name the topic",
          "title": "Say what the pictures show",
          "description": "Say in one or two sentences what the visitor sees and why it matters.",
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "pictures": [
            {
              "src": "/pictures/photo-florist1.avif",
              "alt": "A flower shop window in a brick building"
            },
            {
              "src": "/pictures/photo-food1.avif",
              "alt": "Caramelised figs on a white plate"
            },
            {
              "src": "/pictures/photo-gelato1.avif",
              "alt": "Tubs of gelato in a display case"
            },
            {
              "src": "/pictures/photo-house1.avif",
              "alt": "A red wooden house with white windows and a white door"
            }
          ]
        }} />
      </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 topic'Text, up to 60 characters.
titlestring'Say what the pictures show'Text, up to 100 characters.
descriptionstring'Say in one or two sentences what th…'Text, up to 240 characters.
primaryLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
picturesMedia[]4 itemsList of 4 to 4.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.