A2UI follows a renderer-controlled styling philosophy: the agent describes what to show using semantic hints and structured data, while the renderer decides how it looks. This separation means your design system remains in charge of colors, typography, and spacing — the agent cannot inject arbitrary visual styles. At the same time, the protocol is flexible enough to let agents pass theme data through to the catalog when your use-case requires it.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/a2ui-project/a2ui/llms.txt
Use this file to discover all available pages before exploring further.
Styling Layers
A2UI styling is applied in three layers that stack on top of each other:Agent-Provided Styling Information
Semantic Hints
Agents communicate presentation intent through semantic hints, not visual properties. A semantic hint describes what a piece of content is, not what color or size it should be. The catalog maps those hints to real platform components and styles them according to your design system. For example, in the Basic Catalog aText component with usageHint: "h1" will be rendered as a heading, but the actual font size and weight come from your CSS — not from the agent:
usageHint values for Text:
| Hint | Intended use |
|---|---|
h1 | Page-level heading |
h2 | Section heading |
h3 | Sub-section heading |
h4 – h5 | Nested headings |
body | Standard body copy |
caption | Small supporting text |
The theme Property
The A2UI v0.9 createSurface message accepts an arbitrary theme property. Its shape is defined by the catalog — @a2ui/web_core accepts z.any().optional() for this field, so any JSON structure that your catalog understands is valid.
- Schema definition:
renderers/web_core/src/v0_9/schema/server-to-client.ts - Catalog
themeSchema:renderers/web_core/src/v0_9/catalog/types.ts
The Basic Catalog’s components are not wired to consume the
theme field from the agent. To use agent-supplied theme data, you need to define your own catalog and handle the theme value explicitly. Want to help shape how this works? See issue #1118.Catalog Theming
Theming is a responsibility of the catalog implementation. Each catalog can provide whatever theming solution makes sense for its platform.- Web (Basic Catalog)
- Flutter
CSS Variables
The web Basic Catalog themes its components via CSS custom properties (variables). Each component injects a small default stylesheet that targets:where(:root), giving it the lowest possible specificity. Your application stylesheet can override any variable simply by declaring it on :root.For example, to change the primary action color across all Basic Catalog components:renderers/web_core/src/v0_9/basic_catalog/styles/default.ts.Per-Component Overrides
Beyond global variables, individual components expose their own scoped CSS properties. For example, theCard component exposes --a2ui-card-background:Dark Mode
The Basic Catalog web renderers support automatic dark mode via theprefers-color-scheme media query. To force a specific mode instead of following the system preference, add the a2ui-light or a2ui-dark class to any ancestor element of the rendered surface:Custom Fonts
Load fonts as you normally would in a web application. Basic Catalog components inheritfont-family from their container. Two additional variables let you set specific fonts for headings and monospace blocks:Framework-Specific Examples
Lit Samples
CSS variable usage in Lit shell samples
Angular Samples
CSS variable usage in Angular samples
React Samples
CSS variable usage in React samples
Best Practices
1. Use Semantic Hints, Not Visual Properties
Agents should always communicate presentation intent semantically. Visual properties like font sizes and hex colors are not part of the A2UI protocol:2. Maintain Accessibility
- Ensure sufficient color contrast ratios (WCAG AA: 4.5:1 for normal text, 3:1 for large text).
- Test with screen readers after overriding default styles.
- Verify keyboard navigation still works after customization.
- Test your theme in both light and dark modes.
3. Use Design Tokens
Define reusable design tokens (colors, spacing, radii, etc.) and reference them in your CSS variable overrides. This keeps your A2UI theme in sync with the rest of your design system:4. Test Across Platforms
- Test your theme on all target platforms (web, mobile, desktop).
- Verify both light and dark modes render correctly.
- Check different screen sizes and orientations.
- Ensure a consistent brand experience across frameworks if you deploy multiple renderers.
Next Steps
Defining Your Own Catalog
Build custom components that use your design system’s tokens natively.
Component Reference
See every CSS variable exposed by Basic Catalog components.
Client Setup
Install the renderer for your platform.