Theme API
Declared by <huxerui/theme.h>.
Theme tokens
Section titled “Theme tokens”ColorScheme: primary/secondary roles, containers, background/surface levels, on-colors, outline, inverse roles, scrim, and error.TypographyScheme: body large/medium/small, label large, title large, and headline small sizes.ShapeScheme: extra-small through extra-large plus full radius.SpacingScheme: extra-small through extra-large spacing.ElevationScheme: low, medium, and high elevation.MotionScheme: fast/normal/slow durations andreduced_motion.InteractionScheme: defaultIndication,FocusRing, and disabled opacity.ThemeSpec: aggregates all schemes and providesDefault().
Component styles
Section titled “Component styles”The component-level style structures are equality-comparable and provide Default(); TextFieldVariantStyle is an embedded value configured through TextFieldStyle:
ButtonStyle: background/label/disabled colors, padding, minimum geometry, radius, indication.IconButtonStyle: foreground, icon and interactive geometry, radius, indication.ChipStyle: normal/selected/disabled surfaces, labels, borders, icon geometry, indication.DividerStyle: color and thickness.SegmentedButtonStyle: segment surfaces, labels, borders, padding, geometry, indication.TabsStyle: labels, indicator/divider geometry, item geometry, expansion, indication, and animation duration;TabIndicatorSizingisItemorContent.TextFieldVariantStyleandTextFieldStyle: standard/filled/outlined surfaces and borders, typography, icons, selection/caret/composition, geometry, timing, and validation treatment.CheckboxStyle,RadioButtonStyle, andSwitchStyle: state colors and control geometry.ProgressCircleStyle;ProgressCircleIndeterminateMotionisSweeporPulsingArc.ProgressBarStyle;ProgressBarIndeterminateMotionisSweeporSegmented.SliderStyle: track, thumb, tick, disabled, focus, and animation values.
Navigation styles (TopAppBarStyle, NavigationBarStyle, NavigationPaneStyle, DrawerStyle) are declared by navigation.h; presentation styles by presentation.h.
Definitions and providers
Section titled “Definitions and providers”ThemeDefinition(ThemeSpec)andSet(EnvironmentValue)build typed overrides.UseTheme()returns the nearestThemeSpec.Theme(definition, factory, args...)provides a definition.FlatLightThemeSpec,FlatDarkThemeSpec,MaterialLightThemeSpec, andMaterialDarkThemeSpeccreate token sets.FlatThemeDefinition,FlatDarkThemeDefinition,MaterialThemeDefinition, andMaterialDarkThemeDefinitioncreate complete component definitions.FlatTheme,FlatDarkTheme,MaterialTheme, andMaterialDarkThemeprovide convenient factory wrappers; light-family overloads also accept a customThemeSpec.
HUXERUI_THEME(ThemeProvider, expression) is a macro wrapper for expression-style code; component functions and normal provider calls are preferred in new DSL examples.
Complete theme and indication example
Section titled “Complete theme and indication example”#include <huxerui/huxerui.h>
using namespace huxerui;
View DestructiveAction() { Indication feedback { .hover = IndicationLayer { .fill = VisualFill(Color::Rgb(255, 255, 255, 0.10F)), .placement = IndicationPlacement::AboveContent, }, .press = IndicationLayer { .fill = VisualFill(Color::Rgb(255, 255, 255, 0.18F)), .placement = IndicationPlacement::AboveContent, }, .ripple = RippleEffect {.color = Color::Rgb(255, 255, 255, 0.24F)}, }; return Button("Delete").OnClick([] {}).With(std::move(feedback));}
View ThemedPanel() { return MaterialTheme(DestructiveAction);}The theme supplies the normal component style; the explicit Indication replaces interaction feedback only for this node.

