CraftUI

Settings Menu

Ore UI's settings screen, with categories in a sidebar, sections, and rows that label and describe their controls.

Text to speech

Adjust how you hear on-screen text

Text to speech with device settings

Use your device for text to speech

Text to speech for UI

Hear menu options and other interface elements

Music volume
70
Closed captions

Installation

npx shadcn@latest add @runqora/craft-settings-menu

Usage

import {
  SettingsMenu,
  SettingsNav,
  SettingsNavItem,
  SettingsPanel,
  SettingsRow,
  SettingsSection,
} from "@/components/craft/settings-menu";

<SettingsMenu defaultValue="audio">
  <SettingsNav aria-label="Settings">
    <SettingsNavItem value="audio">Audio</SettingsNavItem>
    <SettingsNavItem value="video">Video</SettingsNavItem>
  </SettingsNav>
  <SettingsPanel value="audio">
    <SettingsSection title="Volume">
      <SettingsRow description="Plays music in menus" label="Menu music">
        <Switch />
      </SettingsRow>
    </SettingsSection>
  </SettingsPanel>
  <SettingsPanel value="video">…</SettingsPanel>
</SettingsMenu>;

Props

SettingsRow

Prop

Type

SettingsSection

Prop

Type

SettingsNavItem

Prop

Type

Accessibility

  • The categories are vertical tabs: Tab reaches the current one, and the up and down arrow keys move between them and show each one.
  • Each row's label names its control and its description describes it, through Base UI's Field. This works with CraftUI's Switch, Select, Slider and other Base UI controls.
  • Each section is a region named by its title.
  • Group labels in the sidebar, such as "Controls", are for sighted players. A tab list may only hold tabs, so screen readers skip them.

Customization

Use layout="stacked" for a slider or a row of choices, which take the row's full width. Put a reset button in a section's action, and reset that section's values in your state.

On narrow screens, the sidebar sits above the settings.

Dependencies

Source

On this page