Inspector

An inspector pane like Xcode's or Pages': sections of right-aligned labels beside small controls.

@cupertinoui/inspectorRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/inspector

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import {
  Inspector,
  InspectorLabel,
  InspectorRow,
  InspectorSection,
  InspectorSectionTitle,
} from "@/components/ui/inspector"

<Inspector>
  <InspectorSection>
    <InspectorSectionTitle>Text Settings</InspectorSectionTitle>
    <InspectorRow>
      <InspectorLabel>Widths</InspectorLabel>
      <Stepper size="sm" defaultValue={4}>
        <StepperInput aria-label="Tab width" />
        <StepperButtons />
      </Stepper>
    </InspectorRow>
  </InspectorSection>
</Inspector>
Inspectors use 11pt text, so use the small sizes of controls: size="sm" on Pop-up Button, Stepper and Button.
A row without an InspectorLabel puts its controls under those of the rows above, as for a checkbox.

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

Inspector

The scrolling pane. Set --inspector-label-width (84px by default) to change the label column.

PropTypeDescription
classNamestringExtra classes, merged with the component's own.

InspectorSection / InspectorSectionTitle

A titled group of rows, divided from the next by a hairline.

PropTypeDescription
classNamestringExtra classes, merged with the component's own.

InspectorRow

A label beside its controls.

PropTypeDescription
classNamestringExtra classes, merged with the component's own.

InspectorLabel

A right-aligned label; pass htmlFor to point it at a field.

PropTypeDescription
htmlForstringThe id of the control the label belongs to.
classNamestringExtra classes, merged with the component's own.