Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Web docs
Forms

SettingsRow

Pairs a label and description with a control at the end of the row, stacking in narrow containers.

Frameworks
Astro · React · Elements · Dioxus
Registry
lumen add SettingsRow
Interaction
Native markup
01

See it and copy it

Framework example

Choose Astro, React, Elements, or Dioxus to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.

AstroCode target · live preview uses Astro

Preferences

Changes apply to this device.

Uses mobile data when Wi-Fi is unavailable.

The view that opens when you launch the app.

Follow the system or pick a fixed theme.

Download a copy of your notes as Markdown.

View SettingsRow code

Framework usage

Switch targets to compare the adapter code. This live preview runs the Astro example. Before copying an example, complete the matching framework setup; React, Elements, and Dioxus use their own behavior APIs.Width controls resize the preview container. Resize your browser to test viewport breakpoints.
astro
---
import { Button, Card, NativeSelect, SectionHeader, Segmented, SettingsRow, Switch } from '@santi020k/lumen-astro'
---

<Card>
  <SectionHeader
    description="Changes apply to this device."
    headingLevel={3}
    title="Preferences"
  />
  <SettingsRow
    controlId="sync-cellular"
    description="Uses mobile data when Wi-Fi is unavailable."
    label="Sync over cellular"
  >
    <Switch aria-describedby="sync-cellular-description" id="sync-cellular" />
  </SettingsRow>
  <SettingsRow
    controlId="start-page"
    description="The view that opens when you launch the app."
    label="Start page"
  >
    <NativeSelect
      aria-describedby="start-page-description"
      id="start-page"
      options={['Inbox', 'Today', 'Projects']}
    />
  </SettingsRow>
  <SettingsRow
    controlId="appearance"
    description="Follow the system or pick a fixed theme."
    label="Appearance"
  >
    <Segmented
      aria-describedby="appearance-description"
      aria-labelledby="appearance-label"
      defaultValue="System"
      name="appearance"
      options={['System', 'Light', 'Dark']}
    />
  </SettingsRow>
  <SettingsRow
    controlId="export-data"
    description="Download a copy of your notes as Markdown."
    label="Export data"
  >
    <Button
      aria-describedby="export-data-description"
      id="export-data"
      size="sm"
      variant="secondary"
    >
      Export
    </Button>
  </SettingsRow>
</Card>
Edit SettingsRow in browser

Framework differences

React: Pass the control as a function child, for example {control => <Switch {...control} />}, and the row supplies id, aria-labelledby, and aria-describedby.

Elements: Author the parts with data-slot. Give the label for and id, give the description an id, and set id and aria-describedby on the control yourself.

02

Choose your target

Add this component

Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add SettingsRow

API reference

Lumen-specific props and runtime attributes for the Astro primitive. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.

AttributeValuesDefaultDescription
labelstring | ReactNode / label slotrequiredVisible label. With controlId it renders a label element pointing at the control, so it becomes the control’s accessible name.
descriptionstring | ReactNode / description slot-Supporting sentence under the label. Its id is the controlId followed by -description; reference it from the control’s aria-describedby.
controlIdstring-Id of the control. The label id is the controlId followed by -label, and the description id is the controlId followed by -description.
leadingReactNode / leading slot-Adds an icon or graphic before the text. Mark decorative icons as hidden.
childrencontrol | default slot | (control: SettingsRowControlProps) => ReactNode-The control at the end of the row. In React, pass a function to receive id, aria-labelledby, and aria-describedby and spread them on the control, so the row wires it without controlId.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.

Customize SettingsRow

Start with semantic theme tokens and a class on the public component. Keep its accessible name, focus treatment, and interaction state intact.

cssScoped theme overrides
.product-settings-row {
  --surface: 0 0% 100%;
  --ink: 220 20% 15%;
  --line: 220 15% 82%;
}

Apply product-settings-row through Astro's class, React's className, or the custom element's class. Verify foreground and background contrast in both schemes.

HookValuesDefaultContract
class, classNamestring""Merges custom classes with the generated ui-* root classes.

Use the documented hooks above and adapter types when targeting component states. Theme guide · Accessibility verification scope


Web docsFull catalog