Back to catalog
Component detail entry
Utilities
@vean/ui
SThemeModeSegment

ThemeModeSegment

ThemeModeSegment belongs to the Utilities category. Start with demos and usage, then use the API tables to finish integration and styling decisions.

Use the quick jump panel to reach overview, usage, demos, and API first, then continue through the full page.

Quick jump

Related components

If you are composing interactions in the same family, these components usually pair well together.

ThemeModeSegment

Overview

SThemeModeSegment is a context-bound segmented control bound to the active SConfigProvider theme. It exposes the three ThemeModePreference options — auto (follows the OS prefers-color-scheme), light, and dark — as icon-led segment options, letting users pick a color scheme preference directly. Use it when all three preferences should be visible at a glance, such as in a header, settings panel, or customizer.

Usage

Features

  • 🌓 Three options — auto / light / dark, matching the theme mode type
  • 🎚 Selection writes the preference through the shared theme context
  • 🎨 Inherits Segment visual props (size / shape / fill / …), with shape defaulting to rounded
  • 🖼 Scheme icons (monitor / sun / moon) are always rendered; showLabel adds the localized label next to them (hidden labels still provide accessible names)

Demos

Basic

Auto / Light / Dark

API

Aria Layer

1

ThemeModeSegment

15 Props
Props
PropTypeDefaultDescription
showLabel
boolean
false
Whether to render the localized label next to the scheme icon. When `false`, the label stays visually hidden so each option keeps an accessible name.
unmountOnHide
boolean
`true`
When `true`, the element will be unmounted on closed state.
class
ClassValue
—
Additional class names applied to the root element.
dir
Direction
—
The direction of navigation between items.
size
ThemeSize
—
Visual size of the component.
fill
SegmentFill
—
Fill.
shape
SegmentShape
—
Shape of the component.
loop
boolean
false
Whether keyboard navigation should loop around
triggerProps
SegmentTriggerProps
—
Properties forwarded to the trigger element.
orientation
DataOrientation
—
The orientation of the group. Mainly so arrow navigation is done accordingly (left & right vs. up & down)
listProps
SegmentListProps
—
Properties forwarded to the list element.
ui
Partial<SegmentUi>
—
Per-slot class overrides for the component.
enableIndicator
boolean
—
Whether to enable indicator.
indicatorProps
SegmentIndicatorProps
—
Properties forwarded to the indicator element.
activationMode
TabsActivationMode
automatic
Whether a tab is activated automatically (on focus) or manually (on click).

Notes

Scope

Like SThemeModeSelect and SThemeModeSwitch, SThemeModeSegment is a theme-layer component that operates on the theme context from a parent SConfigProvider. It does not accept a modelValue; the preference is owned by the provider and shared across all theme components. It is the segmented counterpart of SThemeModeSelect — same three options, no dropdown.

Cautions

  • The component must be rendered inside a SConfigProvider, otherwise useTheme throws.
  • auto is a preference — the resolved scheme (light / dark) still depends on the OS prefers-color-scheme and is exposed as effectiveMode on the theme context.
  • items, modelValue, and defaultValue are not exposed: the option list is fixed and the state lives in the theme context.

Changelog

Version history is grouped by release so you can quickly see what changed for this component across published versions.

v0.50.0

2026-10-02

Compare release

Feature

add context-bound icon-led theme mode segment control

Scope: theme-mode-segmentAuthors: soybeanjsView commit93ca4

Feature

add context-bound icon-led theme mode segment control

Scope: theme-mode-segmentAuthors: soybeanjsView commit93ca4