Skip to content
Klarhimmel UI

Contact, accordion rows

Contact, accordion rows previewContact, accordion rows preview

Install

npx shadcn add https://ui.klarhimmel.com/r/contact-accordion-rows.json
DetailsAbout, usage, props and more

A label, heading and lead beside a picture, then ways to get in touch stacked beneath as rows that open on a tap, each showing a line, a detail and one action.

Import

Import

import Block from '@/components/klarhimmel/blocks/contact-accordion-rows';
Also called
  • contact/accordion-rows
About
A label, heading and lead beside a picture, then ways to get in touch stacked beneath as rows that open on a tap, each showing a line, a detail and one action. The first row starts open.
Category
A form, a booking panel or office details. The page wires the submit. New project? Set it up once: /get-started/installation.

Notes

When to use it

Pick it when a contact section needs a heading beside a picture and then several ways to reach you, each hidden behind a tap until wanted: phone, mail, visit. For a flat list of channels with no picture choose contact-channels; for a form choose contact-form.

Writing for it

- Title up to 120 characters, lead up to 240, one to six rows. - Each row has a heading of 60, a line of 160, a detail of 80 such as a number or street, and one action with a style of primary, secondary or link. - The first row can start open with the open prop.

Watch out for

Closed rows hide their detail from a skimming visitor, so keep the heading itself informative and open the row that matters most. Use at most one filled action per section.

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 ContactAccordionRows from '@/components/klarhimmel/blocks/contact-accordion-rows';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <ContactAccordionRows props={{
          "eyebrow": "Section name",
          "title": "Say how a visitor can reach you",
          "description": "Say in one or two sentences what the visitor gets by getting in touch.",
          "media": {
            "src": "/pictures/photo-spa1.avif",
            "alt": "A treatment room with a massage table by a window"
          },
          "rows": [
            {
              "title": "Name the first way to reach you",
              "description": "Say in one line when to use it.",
              "detail": "Give the address or number",
              "action": {
                "label": "Main action",
                "href": "#first"
              },
              "actionStyle": "primary",
              "open": true
            },
            {
              "title": "Name the second way to reach you",
              "description": "Say in one line when to use it.",
              "detail": "Give the address or number",
              "action": {
                "label": "Second action",
                "href": "#second"
              },
              "actionStyle": "secondary",
              "open": false
            }
          ]
        }} />
      </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'Section name'Text, up to 60 characters.
titlestring'Say how a visitor can reach you'Text, up to 120 characters.
descriptionstring'Say in one or two sentences what th…'Text, up to 240 characters.
mediaMedia{…}See the type.
rows{ title, description, detail, action, actionStyle, open }[]3 itemsList of 1 to 6. Each item: title, description, detail, action, actionStyle ('primary' | 'secondary' | 'link') (optional), open.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.