> ## 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

> Whop의 React 컴포넌트 라이브러리이자 디자인 시스템인 Frosted UI를 설치하고 사용하여 앱의 인터페이스를 만드세요.

Frosted UI는 Whop의 종합적인 React 컴포넌트 라이브러리이자 디자인 시스템입니다. 접근성 표준을 충족하는 60개 이상의 컴포넌트를 제공합니다. 또한 정교한 색상 시스템, 타이포그래피 스케일, 매끄러운 다크 모드 지원을 포함하며, 이 모든 것이 Radix UI 프리미티브와 Tailwind CSS를 기반으로 만들어졌습니다.

## 설치

**1. 패키지 설치하기**

```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]
>
> `@whop/react` 패키지에는 Frosted UI와 필요한 모든 의존성이 포함되어 있습니다.

**2. WhopApp 프로바이더 설정하기**

루트 레이아웃에서 애플리케이션을 `WhopApp` 컴포넌트로 감싸세요. 이렇게 하면 테마와 iframe SDK가 설정됩니다.

```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 구성하기(선택 사항)**

Next.js 구성에서 `withWhopAppConfig` 래퍼를 사용하세요:

```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]
>
> 이렇게 하면 서버 액션이 구성되고 Frosted UI 임포트가 최적화됩니다.

**4. Tailwind 설정하기(선택 사항)**

Tailwind CSS를 사용한다면 Frosted UI 플러그인을 추가하여 디자인 토큰에 접근하세요:

```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가 설정되어 사용할 준비가 되었습니다.

***

## 타이포그래피

Frosted UI는 두 가지 주요 컴포넌트 `Heading`과 `Text`로 구성된 종합적인 타이포그래피 시스템을 제공합니다.

### 글자 크기 단계

두 컴포넌트 모두 10단계 크기 스케일(0-9)을 사용합니다:

| 크기 | 글꼴 크기 | 용도 |
| - | - | - |
| 0 | 10px | 가장 작은 텍스트 |
| 1 | 12px | 작은 레이블 |
| 2 | 14px | 본문 텍스트(작게) |
| 3 | 16px | 본문 텍스트(기본) |
| 4 | 18px | 강조 텍스트 |
| 5 | 20px | 소제목 |
| 6 | 24px | 제목 |
| 7 | 28px | 큰 제목 |
| 8 | 32px | 디스플레이 텍스트 |
| 9 | 40px | 히어로 텍스트 |

### Text 컴포넌트

```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"` (기본값: `"3"`)
* `weight`: `"light"` | `"regular"` | `"medium"` | `"bold"`
* `align`: `"left"` | `"center"` | `"right"`
* `color`: 모든 강조 색상 또는 `"gray"`
* `highContrast`: 접근성을 위해 대비를 높입니다
* `as`: `"span"` | `"div"` | `"p"` | `"label"`

### Heading 컴포넌트

```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"` (기본값: `"6"`)
* `weight`: `"light"` | `"regular"` | `"medium"` | `"bold"`
* `align`: `"left"` | `"center"` | `"right"`
* `as`: `"h1"` | `"h2"` | `"h3"` | `"h4"` | `"h5"` | `"h6"`
* `color`: 모든 강조 색상 또는 `"gray"`
* `highContrast`: 접근성을 위해 대비를 높입니다

### 기타 타이포그래피 컴포넌트

```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>
```

***

## 색상

Frosted UI는 Radix 색상 스케일을 사용하며, 솔리드와 알파 변형을 모두 갖춘 12단계 색상 팔레트를 제공합니다.

### 강조 색상

27가지 강조 색상을 사용할 수 있습니다:

**일반 색상:** `tomato`, `red`, `ruby`, `crimson`, `pink`, `plum`, `purple`, `violet`, `iris`, `indigo`, `blue`, `cyan`, `teal`, `jade`, `green`, `grass`, `brown`, `orange`

**밝은 색상:** `sky`, `mint`, `lime`, `yellow`, `amber`, `lemon`, `magenta`

**메탈릭 색상:** `gold`, `bronze`

### 회색 색상

색온도가 서로 다른 6가지 회색 스케일:

* `gray` - 순수한 중립 회색
* `mauve` - 약간 보랏빛을 띰
* `slate` - 차가운 푸른빛을 띰
* `sage` - 은은한 초록빛을 띰
* `olive` - 따뜻한 올리브빛을 띰
* `sand` - 따뜻한 모래빛을 띰
* `auto` - 강조 색상에 자동으로 맞춤

### 의미 색상

일반적인 사용 사례를 위해 미리 구성된 색상:

* **위험:** `red`(기본값), `tomato`, `ruby`
* **경고:** `amber`(기본값), `yellow`
* **성공:** `green`(기본값), `teal`, `jade`, `grass`
* **정보:** `sky`(기본값), `blue`

### 색상 사용하기

```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 색상 클래스

Tailwind 플러그인을 사용하면 Frosted UI 색상을 직접 사용할 수 있습니다:

```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>
```

**색상 스케일:**

* 1-3단계: 배경과 은은한 채우기
* 4-6단계: 테두리와 구분선
* 7-9단계: 인터랙티브 요소
* 10-12단계: 텍스트와 고대비 요소

**알파 변형:**

* 투명도를 위해 `{color}-a1`부터 `{color}-a12`까지 사용하세요

> [!WARNING]
>
> tailwind 구성에 `frostedUiPlugin()`을 추가하면 `bg-blue-200` 같은 기본
> tailwind 색상은 작동하지 않습니다. 위 문서에 따라 대신 `bg-blue-2`를
> 사용하세요.

***

## 다크 모드

Frosted UI는 시스템 환경설정과 사용자 선택을 존중하는 자동 다크 모드 지원을 포함합니다.

### 작동 방식

세 가지 외관 모드로 다크 모드를 관리하세요:

* `"inherit"`(기본값) - 시스템 환경설정을 따름
* `"light"` - 라이트 모드를 강제함
* `"dark"` - 다크 모드를 강제함

브라우저는 테마 환경설정을 쿠키(`whop-frosted-theme`)에 저장하며, 쿠키가 없으면 시스템 환경설정으로 대체합니다.

### 구성

`WhopApp` 컴포넌트에서 외관을 구성하세요:

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

또는 외관이 서로 다른 중첩 테마를 만드세요:

```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 다크 모드 클래스

다크 모드 스타일에는 `dark:` 접두사를 사용하세요:

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

***

## 브레이크포인트

Frosted UI는 5개의 브레이크포인트를 가진 모바일 우선 반응형 시스템을 사용합니다.

### 브레이크포인트 단계

| 이름 | 최소 너비 | 용도 |
| - | - | - |
| `initial` | 0px | 모바일(기본값) |
| `xs` | 520px | 큰 모바일 |
| `sm` | 768px | 태블릿 |
| `md` | 1024px | 작은 데스크톱 |
| `lg` | 1280px | 데스크톱 |
| `xl` | 1640px | 큰 데스크톱 |

### 반응형 props

많은 컴포넌트가 객체 구문을 사용한 반응형 값을 지원합니다:

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

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

### Tailwind 반응형 클래스

```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>
```

***

## 아이콘

Frosted UI는 `@frosted-ui/icons` 패키지를 통해 아이콘 시스템을 제공합니다.

### 아이콘 사용하기

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

<IconButton>
    <MagnifyingGlassIcon />
</IconButton>

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

### 자주 쓰는 아이콘

Frosted UI는 다음과 같은 아이콘을 포함하는 Radix Icons를 사용합니다:

* 내비게이션: `ChevronRightIcon`, `ChevronDownIcon`, `ArrowRightIcon`
* 액션: `Cross2Icon`, `CheckIcon`, `PlusIcon`, `MinusIcon`
* UI: `MagnifyingGlassIcon`, `GearIcon`, `PersonIcon`
* 라이브러리에서 더 많은 아이콘을 사용할 수 있습니다.

***

## Tailwind 플러그인

Frosted UI Tailwind 플러그인은 디자인 토큰을 Tailwind 유틸리티로 제공합니다.

### 포함된 항목

**타이포그래피:**

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

**색상:**

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

**간격 및 레이아웃:**

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

### 표준 Tailwind와의 주요 차이점

1. **글꼴 크기 스케일:** xs/sm/base/lg 대신 0-9를 사용합니다
2. **줄 높이 스케일:** 글꼴 크기 스케일(0-9)과 일치합니다
3. **색상 시스템:** 알파 변형을 갖춘 12단계 Radix 색상 스케일
4. **의미 색상:** 위험, 경고, 성공, 정보 색상 내장
5. **디자인 토큰:** 테마 일관성을 위해 모든 값에 CSS 변수를 사용합니다

***

## 자주 쓰는 컴포넌트

### 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`: 모든 강조 색상
* `highContrast`: 대비 강화
* `loading`: 로딩 스피너를 표시합니다
* `disabled`: 상호작용을 비활성화합니다

### 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>;
```

### 체크박스와 라디오

```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>
```

***

## 고급 사용법

### 테마 사용자 지정

여러 옵션으로 테마를 사용자 지정하세요:

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

### 중첩 테마

서로 다른 테마로 섹션을 만드세요:

```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>;
```

### 테마 컨텍스트 접근하기

```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>;
}
```

***

## 컴포넌트 라이브러리

Frosted UI에는 카테고리별로 정리된 60개 이상의 컴포넌트가 포함되어 있습니다:

**레이아웃:** `Box`, `Flex`, `Grid`, `Container`, `Section`, `AspectRatio`, `Inset`

**타이포그래피:** `Heading`, `Text`, `Code`, `Strong`, `Em`, `Kbd`, `Quote`, `Blockquote`

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

**버튼:** `Button`, `IconButton`

**디스플레이:** `Card`, `Avatar`, `AvatarGroup`, `Badge`, `Callout`, `Table`, `DataList`, `Skeleton`

**내비게이션:** `Tabs`, `Breadcrumbs`, `Link`, `SegmentedControl`

**오버레이:** `Dialog`, `AlertDialog`, `Drawer`, `Sheet`, `Popover`, `HoverCard`, `Tooltip`, `DropdownMenu`, `ContextMenu`

**피드백:** `Progress`, `CircularProgress`, `Spinner`

**유틸리티:** `ScrollArea`, `Separator`, `Portal`, `VisuallyHidden`, `AccessibleIcon`

> [!NOTE]
>
> 모든 컴포넌트는 Radix UI 프리미티브를 기반으로 만들어졌으며 접근성 모범 사례를
> 따릅니다.

***

## 리소스

* [Radix UI 문서](https://www.radix-ui.com/) - 컴포넌트 프리미티브
* [Radix Colors](https://www.radix-ui.com/colors) - 색상 시스템 문서
* [Tailwind CSS](https://tailwindcss.com/) - 유틸리티 우선 CSS 프레임워크


## Related topics

- [플랫폼 맵](https://docs.whop.com/ko/developer/platform-map.md)
- [React Native로 Whop 앱 구축하기](https://docs.whop.com/ko/developer/guides/react-native.md)
- [PaymentDetailElement](https://docs.whop.com/ko/elements/latest/dashboard/paymentDetail.md)
