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>.
Avoid overriding bridge tokens such as
--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.Odds display
formatPercent and formatPrice are two renderings of the same number — both receive a
probability between 0 and 1. Discovery surfaces (event tiles, search results, charts) use
formatPercent; price surfaces (order book, event page outcome chips, place-order, positions)
use formatPrice.
To show a single odds convention app-wide, set both to the same function:
formatPrice is optional. Leave it unset to keep the default cents rendering (62.5¢).
Two values deliberately stay on the built-in formatters even when formatPrice is set, because
neither is a price: the order book spread (a difference between two prices, always in cents)
and position PnL percentages.
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.