Configuration
The asheeui.config.ts file is the central configuration for your AsheeUI project. It's optional (sensible defaults apply with no config at all), but using it lets you control theming, component defaults, and more from a single place.
Import
Shape of the config
| Key | Type | Default | Description |
|---|---|---|---|
color | ExternalColorConfig | Built-in light/dark colors | Custom themes and token overrides: see Theming |
defaultTheme | "light" | "dark" | "system" | "system" | Default theme for new visitors |
defaultVariant | "solid" | "ghost" | "bordered" | "faded" | "underlined" | "solid" | Default visual style for all components with a variant prop |
defaultColor | "none" | "default" | "primary" | "secondary" | "danger" | "warning" | "success" | "primary" | Default semantic color for all components with a color prop |
defaultRadius | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | "md" | Default corner rounding for all components with a radius prop |
components | ComponentsConfig | {} | Per-component defaults: see each component's "Global Configuration" section |
Precedence
AsheeUI resolves values in this order, from highest to lowest priority:
- Instance prop: set directly on the component instance (
<Button variant="solid" />) - Component config:
components.<name>inasheeui.config.ts - Theme default: top-level defaults (
defaultVariant,defaultColor,defaultRadius,defaultTheme) - Built-in fallback: the library's internal default (shown in each component's props table)
If a value is set at a higher level, it overrides all lower levels. If no value is set anywhere, the built-in fallback is used.
Example
Full example
A realistic asheeui.config.ts touching every top-level key:
Per-component configuration
Each component in AsheeUI can be configured individually under the components key. The available options are documented on each component's own page under Global Configuration.
Component config vs. top-level defaults
- Top-level defaults (
defaultVariant,defaultColor, etc.) apply to every component that accepts that prop. - Component config (
components.button.variant) applies only to that specific component type, overriding the top-level default.
This means you can set a global default for all components, then override it for specific components as needed.
Built-in defaults
The built-in defaults used when no configuration is provided:
Each component also has its own built-in fallback values for properties not covered by the top-level defaults. These are documented in each component's props table.