Skip to main content

Overview

Hux UI provides a comprehensive theming system based on design tokens that automatically adapt to light and dark modes. The theming system separates primitive colors from semantic tokens, following modern design system best practices.
Design System Reference: Explore the complete design system, including all colors, tokens, and component specifications in our Figma library.

Theme Configuration

Basic Setup

Configure light and dark themes in your app:
main.dart

Dynamic Theme Switching

Implement theme switching in your app:

Design Tokens

Hux UI uses semantic design tokens through the HuxTokens class. These tokens automatically adapt to the current theme.

Text Tokens

Surface Tokens

Border Tokens

Status Tokens

Custom Colors

Using Preset Colors

Hux UI provides several preset colors for customization:

Custom Colors

Use any custom color with Hux UI components:

Color Accessibility

Hux UI automatically ensures WCAG AA contrast compliance:

Advanced Theming

Custom Theme Extensions

Extend Hux themes with your own customizations:

Theme-Aware Widgets

Create widgets that respond to theme changes:

Best Practices

Always use HuxTokens instead of hardcoded colors:
Always test your UI in both light and dark modes:
Use consistent spacing that works with the theme:
Leverage automatic contrast calculation:

Color Reference

Preset Colors

Status Colors

Token Categories

  • Text: Primary, Secondary, Tertiary, Disabled, Inverted
  • Surface: Primary, Secondary, Elevated, Hover
  • Border: Primary, Secondary, Destructive, Success
  • Button: Secondary Background, Secondary Text, Secondary Border
  • Icon: Primary, Secondary
  • Chart: Grid, Axis, Axis Text

Examples

Theme Switching

See how to implement dynamic theme switching

Custom Branding

Learn how to apply custom brand colors

Figma Library

Explore the complete design system in Figma

Accessibility

Ensure your themes meet accessibility standards

Advanced Customization

Deep dive into advanced theming techniques