Customize AGG UI
AGG UI is designed to be embedded in partner apps without forking components. The supported customization surface is:- CSS variables on the AGG root for brand, typography, radius, shadow, and z-index tokens
AggProviderconfig for theme mode, labels, formatting, feature flags, search wiring, and wallet actions- component
className/classNamesprops for layout composition
Import
@agg-build/ui/styles.css once, then load your app CSS after it. AGG defaults are low
specificity, so :root overrides can work, and .agg-root overrides win because they are closer
to the AGG UI tree.Minimal integration
app/providers.tsx
app/page.tsx
AggProvider renders an .agg-root wrapper around its children. If you pass
general.rootClassName, that class is added to the same root so you can scope partner-specific
branding without affecting other AGG embeds on the page.
Import order
Load AGG styles first and partner overrides second:agg-theme.css
Custom fonts
Set the AGG font token on.agg-root. This affects AGG typography utilities, primitives, pages,
modals, and portaled surfaces.
Plain CSS
:root; a value on .agg-root wins if both exist.
Next.js next/font
Expose the generated font variable on an ancestor, then map it into the AGG token.
app/layout.tsx
globals.css
Light and dark themes
general.theme controls the class and data attributes applied to .agg-root. If you ship custom
dark tokens, match AGG’s dark selector shape so your values win in dark mode:
Gradients
Keep semantic colors and gradient definitions separate.features.enableGradients controls whether
branded surfaces resolve to flat primary colors or gradient tokens.
Public theme tokens
Set these on.agg-root or .agg-root.<your-rootClassName>.
| Token | Usage |
|---|---|
--agg-color-primary | Primary CTA color and emphasis states |
--agg-color-primary-hover | Primary action hover color |
--agg-color-secondary | Card, popover, modal, and control surfaces |
--agg-color-secondary-hover | Neutral hover and selected surfaces |
--agg-color-border | Borders and separators |
--agg-color-foreground | Primary text and icon foreground |
--agg-color-muted-foreground | Secondary text, metadata, and helper labels |
--agg-color-on-primary | Text and icons on branded filled surfaces |
--agg-color-success | Positive status and bid-side color |
--agg-color-warning | Warning status |
--agg-color-error | Error status and ask-side color |
--agg-color-overlay | Modal and drawer overlay color |
--agg-gradient-brand | Branded gradient fill |
--agg-gradient-brand-hover | Branded gradient hover fill |
--agg-font-family-sans | Base AGG UI font family |
--agg-font-size-2xs through --agg-font-size-4xl | Typography size scale |
--agg-line-height-3, --agg-line-height-14, --agg-line-height-4 through --agg-line-height-10, --agg-line-height-base | Typography line-height scale |
--agg-font-weight-normal, --agg-font-weight-medium, --agg-font-weight-semibold, --agg-font-weight-bold | Typography weight scale |
--agg-radius-sm, --agg-radius-md, --agg-radius-lg, --agg-radius-xl, --agg-radius-2xl, --agg-radius-full | Radius scale |
--agg-shadow-card, --agg-shadow-popover, --agg-shadow-modal | Elevation tokens |
--agg-z-index-dropdown, --agg-z-index-overlay, --agg-z-index-modal, --agg-z-index-toast, --agg-z-index-tooltip | Dropdown, overlay, modal, toast, and tooltip layering |
--color-agg-*, --text-agg-*, and --font-agg-sans
directly. They are generated from the public --agg-* tokens.
Copy and labels
Usegeneral.labels when you need to change user-facing text. Label overrides are deep-merged with
AGG defaults, so you only provide the keys you want to replace.
Formatting
Override formatting functions when your app needs a different locale, currency presentation, or date style.Layout and slots
UseclassName / classNames for layout composition, not deep CSS selectors.
Troubleshooting
My custom font does not apply
My custom font does not apply
Make sure
@agg-build/ui/styles.css is imported before your app CSS, and set
--agg-font-family-sans on .agg-root. With next/font, put the generated font variable on
an ancestor of AggProvider.My colors work on the page but not in a modal or tooltip
My colors work on the page but not in a modal or tooltip
Scope variables to
.agg-root and pass a stable general.rootClassName if you have multiple
embeds. AGG portaled surfaces also carry .agg-root, so the same scoped token block applies.Dark mode falls back to AGG defaults
Dark mode falls back to AGG defaults
Add a dark-mode override block using AGG’s selector shape. Light tokens and dark tokens are
separate.
My Tailwind classes do not restyle AGG internals
My Tailwind classes do not restyle AGG internals
AGG internals use AGG token utilities. Override
--agg-* variables for global theming, and use
documented className / classNames props for layout slots.Related tools
Storybook Customization
Interactive token guide and live component catalog.
Theme Studio
Import a URL, inspect extracted brand tokens, and export CSS.
Setup Guide
Provider setup for SDK, hooks, UI components, and auth.
Components Overview
Curated references for pages, trading surfaces, events, and auth UI.