Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Section card

A settings page kit: a panel with a 44px header and a line under it, a section header with a count chip, and a field row whose action sits at the control's height.

Workspace 2

General

Shown on invoices and the sign-in page.

Installation

pnpm add @heyramzi/ui

Usage

import { SectionCard } from "@heyramzi/ui/components/section-card";
<SectionCard title="General">
  {#snippet actions()}
    <button type="button">Reset</button>
  {/snippet}
  <p>The section's rows go here.</p>
</SectionCard>

Keyboard and accessibility

  • The section card's title is an h3. SectionHeader's title is an h2 unless you set level.
  • FieldRow ties its label to the control through for, and links the description or error to it.
  • An error marks the control invalid and is read out as an alert.

API reference

SectionCard

title required string
actions Snippet
Controls at the far end of the header.
flush boolean
Default false
No padding in the body, so a table runs edge to edge under the header.
class string
children required Snippet
Prop Type Default
title required string
actions

Controls at the far end of the header.

Snippet
flush

No padding in the body, so a table runs edge to edge under the header.

boolean false
class string
children required Snippet

SectionHeader

title required string
count number
How many things the section holds. Drawn as a chip next to the title.
countLabel string
Default "items"
What the count counts, for a screen reader: "lines".
description string
One line under the title.
actions Snippet
A control at the far end of the row.
level 2 | 3
Default 2
The heading level. Sections under a page title are 2.
Prop Type Default
title required string
count

How many things the section holds. Drawn as a chip next to the title.

number
countLabel

What the count counts, for a screen reader: "lines".

string "items"
description

One line under the title.

string
actions

A control at the far end of the row.

Snippet
level

The heading level. Sections under a page title are 2.

2 | 3 2

FieldRow

label required string
for required string
Id of the control, so the label focuses it.
description string
error string
class string
children required Snippet
The control: an Input, a Select trigger. It takes the width the action leaves.
action Snippet
The button that acts on the control. Same height as the control, bottom of the row.
Prop Type Default
label required string
for required

Id of the control, so the label focuses it.

string
description string
error string
class string
children required

The control: an Input, a Select trigger. It takes the width the action leaves.

Snippet
action

The button that acts on the control. Same height as the control, bottom of the row.

Snippet