Skip to main content
The invest dialog can be themed to match your site. Pass a theme object per call, or set a default on the constructor or provider; per-call values override the default field by field.

The tokens

Every field is optional. Setting just accent and background gets you most of the way — the app derives the surface and text ramps from them.
Only #rrggbb is accepted. Shorthand #rgb, rgb(), hsl(), and named colors are not.

Bad values fail safe

Each field validates independently, server-side, inside the invest app. Anything invalid silently falls back to the Cesto default, so a bad value can never render an unreadable dialog — you get a Cesto-themed dialog rather than a broken one. This also means the SDK does not validate what you pass: values are serialized onto the invest URL as query params and judged at the other end. If a token seems to be ignored, check the format before checking the wiring.

Data attributes

Every field has a data-cesto-* equivalent on the [data-cesto-invest] element, which overrides the theme passed to bindInvestButtons field by field: Because the theme travels on the URL, it applies in popup mode too — it is the same page.

The bundled button

<CestoInvestButton> reads the same resolved theme, so the CTA and the dialog it opens can’t disagree. Three tokens reach it:
  • accent — the fill, border, and focus ring.
  • Its paired text ink, computed from the accent’s luminance so the label stays readable on any fill you choose.
  • radius — the button’s corners.
Everything else is inherited from your page, including font-family — the button adopts your typography rather than shipping Cesto’s.
To style the button entirely yourself, use unstyled or asChild — see React.

Matching your design tokens

If your site already has CSS custom properties, read them off the page and pass them straight in:
Make sure the resolved values are #rrggbb — a token defined as oklch() or rgb() will be dropped in favour of the Cesto default.
Following a light/dark toggle on your page? Pass scheme: 'auto' to let the dialog follow the user’s OS preference, or pass your current mode explicitly and let the theme re-resolve on the next invest() call. The theme is read when the flow opens, not live.

Widgets theming

The widget iframes take a larger token set, including fonts and spacing.

React button

Variants, sizes, unstyled, and asChild.