Your design system

Your design system

The asChild pattern, and what to take from the SDK.

The SDK ships no CSS. Nothing to override, nothing to reset, no specificity fight.

How components render your markup

Every component takes asChild and attaches its behaviour to the element you pass:

<Quest.Submit asChild>
  <button className="btn btn-primary btn-lg">Complete quest</button>
</Quest.Submit>

Your class names, your element, your props. The component adds the click handler and the disabled state. Nothing else.

Works with Tailwind, CSS modules, styled-components, vanilla CSS, or your own component library:

<Quest.Claim asChild>
  <YourButton variant="primary" size="large" icon={<Gift />} />
</Quest.Claim>

Here is that pattern doing its job. One quest, one machine, three partner design systems, no FanBase CSS anywhere in them:

The fan
1/4
canSubmitfalsecanClaimfalsebuttonLabel"Sign in to start"
Football clubHeritage, print-led
SEASON 25/26Not Started
HOMEvAWAYMD12 · SAT 15:00
500 POINTS
plus a Prize box
25% to full time

Follow @FanBase on Discord

Join the server, say hello, and claim what it pays out.

You need to log in to start this quest.

Esports organisationDense, HUD-led
NOT STARTEDTIER 3

Follow @FanBase on Discord

Join the server, say hello, and claim what it pays out.

CHARGE28%
1,200 XPLOOT CRATE

You need to log in to start this quest.

Music artistNeon, rendered in 3D
800 CREDITS + BACKSTAGE PASS
Not Started

Follow @FanBase on Discord

Join the server, say hello, and claim what it pays out.

You need to log in to start this quest.

Three design systems, one state machine. No FanBase CSS in any of them. Simulated locally so the docs build without registry access.

What you own

All of it. Layout, cards, spacing, typography, the loading and empty states, the loot box animation.

What you should take from the SDK

Two things, because getting them wrong is worse than writing them yourself.

Labels and reasons. state.buttonLabel and state.disabledReasonLabel are already correct for the current state and already localised. Writing your own means maintaining a state matrix that the SDK already maintains.

Status text. Through the catalog. Display strings.

Descriptions

The one place with structured content coming in, and you map node types to your classes with a theme object. Quest descriptions.

Dark mode

Nothing to configure. Your classes, your CSS variables, your media queries.

Reward images

resolveQuestRewardChrome returns a presentation object with an image. Style the container, size the image, do what you like around it.

A note on the disabled prop

Set disabled on your own element rather than on the slot component, and drive it from state.canSubmit:

<Quest.Submit asChild>
  <button disabled={!state.canSubmit}>{state.buttonLabel}</button>
</Quest.Submit>

Practical suggestions

Give quest cards a fixed height. Titles and descriptions vary a lot, and a grid that reflows per row looks broken.

Build a real empty state. Communities run campaigns in bursts, so there are periods with no live quests and fans will see it.

Skeletons over spinners for the list. You know the card shape ahead of time.

Show the reward before the action. It is the reason a fan starts.

On this page