Ask Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Search or ask anythingAsk Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Colour mode: System

Inspector section

A titled run of panel controls

The section groups the inspector controls of a tool panel or settings rail under a header that collapses them. Stacked sections are divided by a hairline, and the body stacks its controls one rhythm apart. The section is the home of the inspector slider, input, toggle switch, segmented control and dropdown, each a one-row control with its name inside the bar.

A composed panel

A rail of stacked sections using every control in the family at the compact size, beside a compact Button, which shares the bars’ height and shape. Open the headings dropdown to see its menu open past the section’s edge.

Elevation

Open and closed

Use defaultOpen to seed an uncontrolled section, or open with onOpenChange to control it. A closed body is inert, so its controls leave the tab order rather than sitting focusable at zero height.

Controlled, open
Uncontrolled, closed

Default size controls

Every control takes the same size prop as Button. Compact suits a narrow rail; the default size suits a wider panel or a touch screen.

When to use it

Use the inspector section to group the controls of a dense settings panel. Unlike Accordion, its open body does not clip, so a dropdown menu inside can open past the section’s edge. For bordered panels of general content, such as an FAQ, use Accordion instead.

Props

Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.

InspectorSection props
PropTypeDefaultDescription
title*
string
The section's heading, shown on its header row. Not the native tooltip `title` attribute.
open
boolean
Whether the section is expanded (controlled). Pair with `onOpenChange`.
defaultOpen
boolean
false
Whether an uncontrolled section starts expanded.
onOpenChange
((open: boolean) => void)
Called with the next expanded state when the header is pressed.
children
ReactNode
The section's controls, stacked one rhythm apart.
className
string
''
Additional CSS classes, applied to the <section>.

Tested keys

An automated test presses every row below, in a left-to-right and a right-to-left layout.

The collapsible section follows the WAI-ARIA disclosure pattern.

Keys the collapsible section is tested against
KeyWhat it does
Enter
Opens what it controls, and closes it when it is open.
Space
Does the same as Enter.
tsx
// From the npm package
import { InspectorSection } from 'rift-ds/components/InspectorSection/InspectorSection';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/inspector-section.json

0.6 kB gzipped, with everything it imports. Peer dependencies are not counted.

For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.