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

# 모양

> 모든 엘리먼트를 위한 테마, 토큰, 파트별 스타일링.

> [!NOTE]
>
> 이 페이지는 `@whop/elements@1.10.0` 및 `@whop/elements-react@1.10.0`을 다룹니다.

하나의 `appearance` 객체로 모든 엘리먼트의 스타일을 지정합니다. 생성 시 전역으로, `create()`에서 그룹별로(또는 React props로) 전달하고, 언제든 `update({ appearance })`로 실시간 변경할 수 있습니다. 마운트된 엘리먼트는 그 자리에서 스타일이 다시 적용됩니다.

```ts theme={null}
const payments = whop.payments.create({
  appearance: {
    theme: { appearance: 'dark', accentColor: 'blue' },
    variables: { '--radius': '8px' },
    classes: { /* per-part declarations, see below */ }
  }
});
```

## 테마

상위 수준의 디자인 토큰입니다. 모든 필드는 선택 사항이며 완전히 타입이 지정되어 있습니다. 아래 값은 소스 타입에서 열거한 것입니다.

**appearance** `"light" | "dark"`

사용할 색 구성입니다. - `"light"` - 밝은 배경에 어두운 텍스트를 사용하는 라이트 모드 - `"dark"` - 어두운 배경에 밝은 텍스트를 사용하는 다크 모드

**accentColor** `AccentColor`

인터랙티브 요소에 사용되는 기본 강조 색상입니다. 다음 중 하나입니다: `ruby`, `blue`, `red`, `yellow`, `green`, `gray`, `tomato`, `crimson`, `pink`, `plum`, `purple`, `violet`, `iris`, `cyan`, `teal`, `jade`, `grass`, `brown`, `orange`, `indigo`, `sky`, `mint`, `amber`, `lime`, `lemon`, `magenta`, `gold`, `bronze`.

**grayColor** `string`

중립 요소에 사용할 회색 팔레트입니다. 강조 색상에 자동으로 맞추려면 `"auto"`를 사용하세요.

`"gray"`, `"mauve"`, `"slate"`, `"sage"`, `"olive"`, `"sand"`, `"auto"` 중 하나입니다.

**dangerColor** `"ruby" | "red" | "tomato"`

오류 상태와 파괴적 작업에 사용되는 색상입니다.

**warningColor** `"yellow" | "amber"`

경고 상태에 사용되는 색상입니다.

**successColor** `"green" | "teal" | "jade" | "grass"`

성공 상태에 사용되는 색상입니다.

**infoColor** `"sky" | "blue"`

정보 상태에 사용되는 색상입니다.

## 변수

엘리먼트 스타일을 사용자 지정하는 데 사용할 수 있는 CSS 사용자 지정 속성(변수)입니다. 키는 `--` 접두사로 시작해야 합니다.

```ts theme={null}
appearance: { variables: { "--radius": "8px" } }
```

## 클래스

각 `whop-*` 클래스 이름에 대한 스타일 선언입니다. 각 항목은 엘리먼트의 문서화된 파트 하나의 스타일을 바꿉니다. 클래스 목록은 각 엘리먼트 페이지의 스타일링 섹션을 참고하세요. 페이지 스타일시트는 엘리먼트의 프레임에 닿을 수 없으므로, 프레임워크가 각 선언을 검사한 다음 정제된 결과를 프레임 안에 주입합니다.

React의 `CSSProperties`처럼 CSS 속성을 값에 매핑하는 스타일 선언 객체입니다. 속성 이름에는 camel case(`fontWeight`) 또는 kebab case(`font-weight`)를 사용할 수 있습니다. 프레임워크는 적용하기 전에 각 이름을 정규화하고 안전한 속성 목록과 대조합니다.

```ts theme={null}
appearance: {
  classes: {
    "whop-SomePart": { borderRadius: "8px", fontWeight: "600" },
  },
}
```

각 엘리먼트의 파트 목록은 해당 페이지의 **스타일링** 섹션에서 확인하세요.

하나의 `appearance` 객체로 모든 엘리먼트의 스타일을 지정합니다. `<WhopElements>`에 전달하면 그 아래의 모든 것에 적용되고, `<Payments>`에 전달하면 그룹별로 적용됩니다. 언제든 변경할 수 있으며, 마운트된 엘리먼트는 그 자리에서 스타일이 다시 적용됩니다.

```tsx theme={null}
<WhopElements
  appearance={{
    theme: { appearance: 'dark', accentColor: 'blue' },
    tokens: { radius: 10, spacing: 4 },
    parts: { 'whop-Input': { borderWidth: 1 } },
  }}
>
```

## 테마

웹 객체와 필드 하나하나까지 동일하므로, 웹사이트용으로 작성한 테마가 여기서도 같은 타입으로 똑같이 작동합니다.

```tsx theme={null}
theme: {
  appearance: 'light' | 'dark',
  accentColor: 'blue',   // any Radix accent scale
  grayColor: 'auto',
  dangerColor: 'ruby' | 'red' | 'tomato',
  warningColor: 'yellow' | 'amber',
  successColor: 'green' | 'teal' | 'jade' | 'grass',
  infoColor: 'sky' | 'blue',
}
```

`appearance`를 생략하면 기기의 라이트 또는 다크 설정을 따릅니다. `grayColor: 'auto'`는 강조 색상과 어울리는 회색 스케일을 선택합니다.

## 토큰

웹의 `variables`는 CSS 사용자 지정 속성이며, React Native에는 이에 해당하는 것이 없습니다. `tokens`는 닫힌 타입의 대체 수단이며, 여기에는 단위가 없으므로 값이 **문자열이 아니라 숫자**입니다.

```tsx theme={null}
tokens: {
  radius: 8,           // corner radius
  spacing: 4,          // the base unit gaps and padding multiply
  fontSize: 15,        // input and value text
  labelFontSize: 13,
  borderWidth: 1,
  controlHeight: 44,
  fontFamily: 'Inter', // undefined uses the platform font
}
```

모든 키는 선택 사항이며 기본값 위에 병합됩니다.

## 파트

웹의 `classes`는 `whop-*` 파트 이름을 키로 하는 CSS 선언입니다. `parts`는 **같은 파트 이름**을 유지하므로 하나의 스타일링 용어로 두 플랫폼을 모두 다룰 수 있으며, CSS 대신 React Native 스타일 객체를 사용합니다.

```tsx theme={null}
parts: {
  'whop-Input': { borderWidth: 1.5, borderRadius: 12 },
  'whop-MethodTileSelected': { borderColor: '#5B5BD6' },
  'whop-Label': { fontWeight: '600' },
}
```

테마 다음에 적용되는 평면적인 파트별 재정의입니다. 캐스케이드, 의사 클래스, 결합자가 없으므로, 스타일시트라면 `:focus`로 접근할 상태에 대신 별도의 파트가 있습니다(`whop-InputFocused`, `whop-InputInvalid`).

각 엘리먼트의 파트 목록은 해당 페이지의 **스타일링** 섹션에서 확인하세요.

> [!NOTE]
>
> 여기서 `variables`와 `classes`는 무시되는 대신 `never` 타입으로 지정되므로, 웹에서 복사한 appearance 객체는 조용히 아무 일도 하지 않는 대신 옮겨올 수 없는 두 키에서 컴파일에 실패합니다.

테마를 직접 읽기: `useTheme()`은 해석된 스케일과 토큰을 반환하며, 이를 사용해 주변 UI를 엘리먼트에 맞출 수 있습니다. [시작하기](https://docs.whop.com/ko/elements/latest/getting-started.md)를 참고하세요.
