Skip to content
Klarhimmel UI

Directory, header

Directory, header previewDirectory, header preview

Install

npx shadcn add @klarhimmel/directory-header
DetailsAbout, usage, props and more

Title and description of a catalogue page, with optional breadcrumbs, search field, select labels and filter chips. Presentation only: the site wires search and sort.

Import

Import

import Block from '@/components/klarhimmel/blocks/directory-header';
Also called
  • directory/header
Category
Catalogue pages: headers with filters, card grids, full-width previews. New project? Set it up once: /get-started/installation.

Notes

When to use it

Opens a catalogue page with a title, description and optional search field, select buttons and filter chips. It is presentation only; for the single item page use directory-preview.

Writing for it

- The title is the page h1 and holds 80 characters. The description holds 300 and should say what the catalogue contains and how to browse it. - Chips hold 30 characters, up to 12. Whichever chip text matches the active field exactly is drawn as selected, so copy the same string into both. - Search takes a placeholder of 60 characters, and up to 3 select labels of 40 characters each, such as Sort by.

Watch out for

The search field and selects do nothing on their own; the site has to wire them. Clearing the search placeholder removes the search field, and the active chip is a text match, not an index.

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 DirectoryHeader from '@/components/klarhimmel/blocks/directory-header';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <DirectoryHeader props={{
          "breadcrumbs": [],
          "eyebrow": "Name the section",
          "title": "Name the page",
          "description": "Say in one or two sentences what the page lists and how a reader can narrow it.",
          "search": {
            "placeholder": "Say what to search by"
          },
          "selects": [
            "Name the first filter",
            "Name a sort order"
          ],
          "chips": [
            "Filter one",
            "Filter two",
            "Filter three",
            "Filter four",
            "Filter five",
            "Filter six"
          ],
          "active": "Filter one"
        }} />
      </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
breadcrumbsLink[]0 itemsList of up to 4.
eyebrowstring'Name the section'Text, up to 60 characters.
titlestring'Name the page'Text, up to 80 characters.
descriptionstring'Say in one or two sentences what th…'Text, up to 300 characters.
search{ placeholder }{…}Fields: placeholder.
selectsstring[]2 itemsList of up to 3.
chipsstring[]6 itemsList of up to 12.
activestring'Filter one'Text, up to 30 characters.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.