> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# Frosted UI

> Installeer en gebruik Frosted UI, de React-componentenbibliotheek en het designsysteem van Whop, om de interface van je app te bouwen.

Frosted UI is de uitgebreide React-componentenbibliotheek en het designsysteem van Whop. Het biedt meer dan 60 componenten die aan toegankelijkheidsnormen voldoen. Het bevat ook een geavanceerd kleursysteem, een typografieschaal en naadloze ondersteuning voor de donkere modus, allemaal gebouwd op Radix UI-primitives en Tailwind CSS.

## Installatie

**1. Het pakket installeren**

```bash pnpm theme={null}
pnpm add @whop/react
```

```bash npm theme={null}
npm install @whop/react
```

```bash yarn theme={null}
yarn add @whop/react
```

```bash bun theme={null}
bun install @whop/react
```

> [!NOTE]
>
> Het pakket `@whop/react` bevat Frosted UI en alle benodigde dependencies.

**2. De WhopApp-provider instellen**

Omhul je applicatie met de component `WhopApp` in je root-layout. Dit stelt het thema en de iframe-SDK in.

```tsx theme={null}
// app/layout.tsx
import { WhopApp } from "@whop/react";

export default function RootLayout({
    children,
}: {
    children: React.ReactNode;
}) {
    return (
        <html lang="en">
            <body>
                <WhopApp accentColor="blue" appearance="inherit">
                    {children}
                </WhopApp>
            </body>
        </html>
    );
}
```

**3. Next.js configureren (optioneel)**

Gebruik de wrapper `withWhopAppConfig` in je Next.js-configuratie:

```typescript theme={null}
// next.config.ts
import type { NextConfig } from "next";
import { withWhopAppConfig } from "@whop/react/next.config";

const nextConfig: NextConfig = {
    // your config options
};

export default withWhopAppConfig(nextConfig);
```

> [!NOTE]
>
> Dit configureert server actions en optimaliseert de imports van Frosted UI.

**4. Tailwind instellen (optioneel)**

Als je Tailwind CSS gebruikt, voeg dan de Frosted UI-plugin toe om toegang te krijgen tot design tokens:

```javascript theme={null}
// tailwind.config.js
import { frostedThemePlugin } from "@whop/react/tailwind";

export default {
    content: ["./src/**/*.{js,ts,jsx,tsx}"],
    plugins: [frostedThemePlugin()],
};
```

> [!TIP]
>
> Frosted UI is nu ingesteld en klaar voor gebruik.

***

## Typografie

Frosted UI biedt een uitgebreid typografiesysteem met twee hoofdcomponenten: `Heading` en `Text`.

### Typeschaal

Beide componenten gebruiken een groottenschaal van 10 stappen (0-9):

| Grootte | Lettergrootte | Gebruik |
| - | - | - |
| 0 | 10px | Kleinste tekst |
| 1 | 12px | Kleine labels |
| 2 | 14px | Broodtekst (klein) |
| 3 | 16px | Broodtekst (standaard) |
| 4 | 18px | Benadrukte tekst |
| 5 | 20px | Subkoppen |
| 6 | 24px | Koppen |
| 7 | 28px | Grote koppen |
| 8 | 32px | Displaytekst |
| 9 | 40px | Herotekst |

### Text-component

```tsx theme={null}
import { Text } from "@whop/react";

<Text size="3" weight="medium">
    This is body text
</Text>

<Text size="1" color="gray">
    Small muted text
</Text>

<Text as="label" size="2" weight="bold">
    Form Label
</Text>
```

**Props:**

* `size`: `"0"` through `"9"` (default: `"3"`)
* `weight`: `"light"` | `"regular"` | `"medium"` | `"bold"`
* `align`: `"left"` | `"center"` | `"right"`
* `color`: elke accentkleur of `"gray"`
* `highContrast`: verhoogt het contrast voor toegankelijkheid
* `as`: `"span"` | `"div"` | `"p"` | `"label"`

### Heading-component

```tsx theme={null}
import { Heading } from "@whop/react";

<Heading size="6" as="h1">
    Page Title
</Heading>

<Heading size="4" as="h2" weight="medium">
    Section Heading
</Heading>
```

**Props:**

* `size`: `"0"` through `"9"` (default: `"6"`)
* `weight`: `"light"` | `"regular"` | `"medium"` | `"bold"`
* `align`: `"left"` | `"center"` | `"right"`
* `as`: `"h1"` | `"h2"` | `"h3"` | `"h4"` | `"h5"` | `"h6"`
* `color`: elke accentkleur of `"gray"`
* `highContrast`: verhoogt het contrast voor toegankelijkheid

### Andere typografiecomponenten

```tsx theme={null}
import { Code, Strong, Em, Kbd } from "@whop/react";

<Code>const example = "code";</Code>
<Strong>Bold text</Strong>
<Em>Italic text</Em>
<Kbd>⌘ K</Kbd>
```

***

## Kleuren

Frosted UI gebruikt de kleurschalen van Radix, met kleurpaletten van 12 stappen in zowel effen als alfavarianten.

### Accentkleuren

Er zijn 27 accentkleuren beschikbaar:

**Gewone kleuren:** `tomato`, `red`, `ruby`, `crimson`, `pink`, `plum`, `purple`, `violet`, `iris`, `indigo`, `blue`, `cyan`, `teal`, `jade`, `green`, `grass`, `brown`, `orange`

**Felle kleuren:** `sky`, `mint`, `lime`, `yellow`, `amber`, `lemon`, `magenta`

**Metallic kleuren:** `gold`, `bronze`

### Grijstinten

6 grijsschalen met verschillende kleurtemperaturen:

* `gray` - Puur neutraal grijs
* `mauve` - Licht paarsgetint
* `slate` - Koel blauwgetint
* `sage` - Subtiel groengetint
* `olive` - Warm olijfgetint
* `sand` - Warm zandgetint
* `auto` - Past zich automatisch aan de accentkleur aan

### Semantische kleuren

Vooraf geconfigureerde kleuren voor veelvoorkomende toepassingen:

* **Danger:** `red` (standaard), `tomato`, `ruby`
* **Warning:** `amber` (standaard), `yellow`
* **Success:** `green` (standaard), `teal`, `jade`, `grass`
* **Info:** `sky` (standaard), `blue`

### Kleuren gebruiken

```tsx theme={null}
import { Button, Badge, Text } from "@whop/react";

<Button color="blue">Primary Action</Button>
<Button color="red">Delete</Button>
<Badge color="green">Active</Badge>
<Text color="gray">Muted text</Text>
```

### Tailwind-kleurklassen

Met de Tailwind-plugin kun je de kleuren van Frosted UI direct gebruiken:

```tsx theme={null}
<div className="bg-blue-2 text-blue-11 border border-blue-6">
    Blue themed box
</div>

<div className="bg-red-a3 text-red-11">
    Red with alpha background
</div>
```

**Kleurschaal:**

* Stappen 1-3: achtergronden en subtiele vullingen
* Stappen 4-6: randen en scheidingslijnen
* Stappen 7-9: interactieve elementen
* Stappen 10-12: tekst en elementen met hoog contrast

**Alfavarianten:**

* Gebruik `{color}-a1` tot en met `{color}-a12` voor transparantie

> [!WARNING]
>
> Als `frostedUiPlugin()` aan je Tailwind-configuratie is toegevoegd, werken de
> standaard Tailwind-kleuren zoals `bg-blue-200` niet. Gebruik in plaats daarvan
> `bg-blue-2`, volgens de documentatie hierboven.

***

## Donkere modus

Frosted UI bevat automatische ondersteuning voor de donkere modus, die systeemvoorkeuren en gebruikerskeuzes respecteert.

### Hoe het werkt

Beheer de donkere modus via drie weergavemodi:

* `"inherit"` (standaard) - Respecteert de systeemvoorkeur
* `"light"` - Dwingt de lichte modus af
* `"dark"` - Dwingt de donkere modus af

De browser slaat de themavoorkeur op in een cookie (`whop-frosted-theme`) en valt terug op de systeemvoorkeur als die er niet is.

### Configuratie

Configureer de weergave in je `WhopApp`-component:

```tsx theme={null}
<WhopApp appearance="dark">{children}</WhopApp>
```

Of maak geneste thema's met verschillende weergaven:

```tsx theme={null}
import { Theme } from "@whop/react";

<Theme appearance="light">
    <div>This section is always light</div>
</Theme>

<Theme appearance="dark">
    <div>This section is always dark</div>
</Theme>
```

### Tailwind-klassen voor de donkere modus

Gebruik het voorvoegsel `dark:` voor stijlen in de donkere modus:

```tsx theme={null}
<div className="bg-white dark:bg-black text-black dark:text-white">
	Adapts to theme
</div>
```

***

## Breakpoints

Frosted UI gebruikt een mobile-first responsief systeem met 5 breakpoints.

### Breakpointschaal

| Naam | Min. breedte | Gebruik |
| - | - | - |
| `initial` | 0px | Mobiel (standaard) |
| `xs` | 520px | Groot mobiel |
| `sm` | 768px | Tablet |
| `md` | 1024px | Kleine desktop |
| `lg` | 1280px | Desktop |
| `xl` | 1640px | Grote desktop |

### Responsieve props

Veel componenten ondersteunen responsieve waarden met een objectsyntaxis:

```tsx theme={null}
import { Text, Box } from "@whop/react";

<Text size={{ initial: "2", md: "4", lg: "6" }}>Responsive text size</Text>;
```

### Responsieve Tailwind-klassen

```tsx theme={null}
<div className="p-2 md:p-4 lg:p-8">
    Responsive padding
</div>

<div className="text-2 sm:text-3 md:text-4">
    Responsive text
</div>
```

***

## Iconen

Frosted UI bevat een iconensysteem via het pakket `@frosted-ui/icons`.

### Iconen gebruiken

```tsx theme={null}
import { IconButton } from "@whop/react";
import { MagnifyingGlassIcon, Cross2Icon } from "@frosted-ui/icons";

<IconButton>
    <MagnifyingGlassIcon />
</IconButton>

<IconButton color="red">
    <Cross2Icon />
</IconButton>
```

### Veelgebruikte iconen

Frosted UI gebruikt Radix Icons, met onder meer iconen zoals:

* Navigatie: `ChevronRightIcon`, `ChevronDownIcon`, `ArrowRightIcon`
* Acties: `Cross2Icon`, `CheckIcon`, `PlusIcon`, `MinusIcon`
* UI: `MagnifyingGlassIcon`, `GearIcon`, `PersonIcon`
* Meer iconen zijn beschikbaar in de bibliotheek.

***

## Tailwind-plugin

De Tailwind-plugin van Frosted UI biedt design tokens als Tailwind-utilities.

### Wat is inbegrepen

**Typografie:**

```tsx theme={null}
<p className="text-3 leading-3 font-medium tracking-2">
	Styled with Frosted UI tokens
</p>
```

**Kleuren:**

```tsx theme={null}
<div className="bg-blue-2 text-blue-11 border-blue-6">Blue themed</div>
```

**Spatiëring en lay-out:**

```tsx theme={null}
<div className="p-4 md:p-6 lg:p-8">Responsive padding</div>
```

### Belangrijkste verschillen met standaard Tailwind

1. **Lettergrootteschaal:** gebruikt 0-9 in plaats van xs/sm/base/lg
2. **Regelhoogteschaal:** komt overeen met de lettergrootteschaal (0-9)
3. **Kleursysteem:** Radix-kleurschalen van 12 stappen met alfavarianten
4. **Semantische kleuren:** ingebouwde kleuren voor danger, warning, success en info
5. **Design tokens:** alle waarden gebruiken CSS-variabelen voor consistentie in het thema

***

## Veelgebruikte componenten

### Button

```tsx theme={null}
import { Button } from "@whop/react";

<Button size="2" variant="solid" color="blue">
    Primary Action
</Button>

<Button size="2" variant="soft" color="gray">
    Secondary
</Button>

<Button size="2" variant="ghost" color="red">
    Danger
</Button>
```

**Props:**

* `size`: `"1"` | `"2"` | `"3"` | `"4"`
* `variant`: `"solid"` | `"soft"` | `"surface"` | `"ghost"` | `"classic"`
* `color`: elke accentkleur
* `highContrast`: verhoogd contrast
* `loading`: toont een laadspinner
* `disabled`: schakelt interactie uit

### Input

```tsx theme={null}
import { TextInput, TextArea } from "@whop/react";

<TextInput
    size="2"
    placeholder="Enter text..."
    variant="surface"
/>

<TextArea
    size="2"
    placeholder="Enter multiple lines..."
    rows={4}
/>
```

### Card

```tsx theme={null}
import { Card } from "@whop/react";

<Card size="2" variant="surface">
	<Heading size="4">Card Title</Heading>
	<Text>Card content goes here</Text>
</Card>;
```

### Badge

```tsx theme={null}
import { Badge } from "@whop/react";

<Badge color="green" variant="soft">Active</Badge>
<Badge color="red" variant="solid">Error</Badge>
<Badge color="gray" variant="surface">Draft</Badge>
```

### Dialog

```tsx theme={null}
import { Dialog, Button } from "@whop/react";

<Dialog.Root>
	<Dialog.Trigger>
		<Button>Open Dialog</Button>
	</Dialog.Trigger>
	<Dialog.Content>
		<Dialog.Title>Dialog Title</Dialog.Title>
		<Dialog.Description>This is the dialog content</Dialog.Description>
		<Dialog.Close>
			<Button>Close</Button>
		</Dialog.Close>
	</Dialog.Content>
</Dialog.Root>;
```

### Select

```tsx theme={null}
import { Select } from "@whop/react";

<Select.Root defaultValue="1">
	<Select.Trigger />
	<Select.Content>
		<Select.Item value="1">Option 1</Select.Item>
		<Select.Item value="2">Option 2</Select.Item>
		<Select.Item value="3">Option 3</Select.Item>
	</Select.Content>
</Select.Root>;
```

### Checkbox en radio

```tsx theme={null}
import { Checkbox, RadioGroup } from "@whop/react";

<Checkbox size="2" color="blue">
    Accept terms
</Checkbox>

<RadioGroup.Root defaultValue="1">
    <RadioGroup.Item value="1">Option 1</RadioGroup.Item>
    <RadioGroup.Item value="2">Option 2</RadioGroup.Item>
</RadioGroup.Root>
```

***

## Geavanceerd gebruik

### Thema aanpassen

Pas het thema aan met meerdere opties:

```tsx theme={null}
<WhopApp
	appearance="dark"
	accentColor="violet"
	grayColor="mauve"
	dangerColor="ruby"
	warningColor="amber"
	successColor="jade"
	infoColor="sky"
>
	{children}
</WhopApp>
```

### Geneste thema's

Maak secties met verschillende thema's:

```tsx theme={null}
import { Theme } from "@whop/react";

<div>
	<Theme accentColor="blue">
		<Button>Blue button</Button>
	</Theme>

	<Theme accentColor="red" appearance="dark">
		<Button>Red button in dark mode</Button>
	</Theme>
</div>;
```

### Toegang tot de themacontext

```tsx theme={null}
import { useThemeContext } from "@whop/react";

function ThemedComponent() {
	const theme = useThemeContext();

	console.log(theme.appearance); // "light" | "dark"
	console.log(theme.accentColor); // "blue" | "red" | ...

	return <div>Current theme: {theme.appearance}</div>;
}
```

***

## Componentenbibliotheek

Frosted UI bevat meer dan 60 componenten, ingedeeld per categorie:

**Layout:** `Box`, `Flex`, `Grid`, `Container`, `Section`, `AspectRatio`, `Inset`

**Typografie:** `Heading`, `Text`, `Code`, `Strong`, `Em`, `Kbd`, `Quote`, `Blockquote`

**Formulieren:** `TextInput`, `TextArea`, `Checkbox`, `RadioGroup`, `Select`, `Switch`, `Slider`, `DatePicker`, `OTPField`

**Knoppen:** `Button`, `IconButton`

**Weergave:** `Card`, `Avatar`, `AvatarGroup`, `Badge`, `Callout`, `Table`, `DataList`, `Skeleton`

**Navigatie:** `Tabs`, `Breadcrumbs`, `Link`, `SegmentedControl`

**Overlay:** `Dialog`, `AlertDialog`, `Drawer`, `Sheet`, `Popover`, `HoverCard`, `Tooltip`, `DropdownMenu`, `ContextMenu`

**Feedback:** `Progress`, `CircularProgress`, `Spinner`

**Hulpmiddelen:** `ScrollArea`, `Separator`, `Portal`, `VisuallyHidden`, `AccessibleIcon`

> [!NOTE]
>
> Alle componenten zijn gebouwd op Radix UI-primitives en volgen de best practices
> voor toegankelijkheid.

***

## Bronnen

* [Radix UI-documentatie](https://www.radix-ui.com/) - Componentprimitives
* [Radix Colors](https://www.radix-ui.com/colors) - Documentatie van het kleursysteem
* [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS-framework


## Related topics

- [Platformoverzicht](https://docs.whop.com/nl/developer/platform-map.md)
- [Whop-apps bouwen met React Native](https://docs.whop.com/nl/developer/guides/react-native.md)
- [PaymentDetailElement](https://docs.whop.com/nl/elements/latest/dashboard/paymentDetail.md)
