Config Provider
YhConfigProvider provides global configuration for the component library, including theme colors, internationalization, component sizes, and more.
Theme Switching
Use the theme prop to switch theme colors dynamically. Overriding with HEX values is fully supported.
Theme Switching
Global Component Size
When size is configured, all internal YH-UI components will adapt to it.
Global Size
Full Configuration Example
Demonstrates how to configure theme, language, and size together in a local environment.
MessageActive
Full Configuration
API
Props
| Prop | Description | Type | Options | Default |
|---|---|---|---|---|
| theme | Global theme | string | Hex color / purple | default |
| locale | Locale config | Language | — | zhCn |
| size | Global size | 'large' | 'default' | 'small' | — | 'default' |
| global | Inject into :root | boolean | — | true |