videorc/ui

Panel Section

The flush section every pane is built from. A 13 px header as an h2, a 12 px description, an action on the title line, 16 px of padding and a hairline to the next section, with no box around it.

Recording

Recordings save to ~/Movies/Videorc.

Keep a copy on this computer while you stream.

One track per microphone, for editing later.

Markers

Press M while you record to mark a moment you want to find again.

Installation

$ pnpm dlx shadcn@latest add @videorc/panel-section

Usage

import { PanelSection } from "@/components/panel-section";
<PanelSection
  description="Recordings save to ~/Movies/Videorc."
  title="Recording"
>
  …
</PanelSection>

Use it for every section of a page or a pane: Settings, Output, Sources, the inspector. Rules a streamer needs, such as limits or what Premium adds, go in its description, never in a footnote.

Don't put a border, a background, a radius or a shadow around page content, and don't put a card inside a section. Sections are flush and split by hairlines.

Anatomy

<PanelSection title description icon action headingLevel>
  {/* content */}
</PanelSection>

Examples

Nested sections

A section under another section's heading passes headingLevel={3}, so the outline reads h1 (the toolbar's title), h2, h3. A section with no children is only its header: a title, what it says, and its action.

Camera

FaceTime HD Camera

Placement

Drag the camera on the stage, or nudge it with the arrow keys.

Lens

Theming

Token or attributeMeaning
p-gutter16 px of padding
border-b, border-borderThe hairline to the next section; the last one has none
text-sectionThe 13 px / 600 title
text-meta, text-muted-foregroundThe 12 px description, in the secondary tier
h-5The action's line, as tall as the title, so a 28 px button or a switch centres on it
data-slotpanel-section, panel-section-header, panel-section-description, panel-section-action, panel-section-content
data-*Any data- prop lands on the section, for tests and probes
<section> propsThe rest pass through to the section, such as drag handlers for one that takes dropped files

Accessibility

The title is an h2 under the toolbar's h1, or an h3 with headingLevel={3}. A section without a title has no heading, for when the layout around it already names it. A switch or an icon button in action needs its own aria-label.

API reference

Every <section> prop except title, plus:

Prop

Type