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

# 임베디드 채팅 테마 및 스타일 지정하기

> 웹이나 Swift에서 테마로 채팅 요소를 앱에 맞추고, Discord 또는 iMessage 채팅 스타일을 선택하세요.

## 테마

테마로 채팅 요소의 모양을 사용자 지정하세요. 웹에서는 Elements의 appearance 옵션을 통해 `theme`을 전달합니다. Swift에서는 `WhopTheme`을 생성하고 `.whopTheme()`으로 적용합니다.

> [tab] React
>
> ```tsx theme={null}
> <Elements
> 	elements={elements}
> 	appearance={{
> 		theme: {
> 			appearance: "dark",
> 			accentColor: "blue",
> 			grayColor: "gray",
> 			dangerColor: "red",
> 			warningColor: "amber",
> 			successColor: "green",
> 			infoColor: "sky",
> 		},
> 	}}
> >
> 	<ChatSession token={getToken}>
> 		<ChatElement options={chatOptions} />
> 	</ChatSession>
> </Elements>
> ```

> [tab] Vanilla JS
>
> ```typescript theme={null}
> const whopElements = await loadWhopElements();
>
> whopElements.updateOptions({
> 	appearance: {
> 		theme: {
> 			appearance: "dark",
> 			accentColor: "blue",
> 			grayColor: "gray",
> 			dangerColor: "red",
> 			warningColor: "amber",
> 			successColor: "green",
> 			infoColor: "sky",
> 		},
> 	},
> });
> ```

> [tab] Swift
>
> ```swift theme={null}
> struct ThemedMessagesView: View {
>     @State private var selectedChannel: DMChannel?
>
>     let theme = WhopTheme(
>         accent: .plum,
>         neutral: .gray,
>         danger: .tomato,
>         warning: .violet
>     )
>
>     var body: some View {
>         WhopDMsListView(
>             onEvent: { event in
>                 switch event {
>                 case let .channelSelected(channel):
>                     selectedChannel = channel
>                 }
>             }
>         )
>         .whopTheme(theme)
>         .navigationDestination(item: $selectedChannel) { channel in
>             WhopChatView(
>                 channelId: channel.id,
>                 style: .imessage
>             )
>             .whopTheme(theme)
>             .navigationBarTitleDisplayMode(.inline)
>             .navigationTitle(channel.name)
>         }
>     }
> }
> ```

### 테마 속성

| 용도 | 웹 옵션 | Swift 옵션 | 설명 |
| - | - | - | - |
| 모양 | `appearance` | — | 웹에서 라이트 또는 다크 모드(`"light"`, `"dark"`). Swift는 앱의 색 구성표를 따릅니다. |
| 강조 | `accentColor` | `accent` | 주요 인터랙티브 요소, 링크, 선택 강조 표시 |
| 중립 | `grayColor` | `neutral` | 텍스트, 테두리, 배경 |
| 위험 | `dangerColor` | `danger` | 파괴적 작업 및 오류 상태 |
| 경고 | `warningColor` | `warning` | 경고 상태 |
| 성공 | `successColor` | `success` | 성공 상태 |
| 정보 | `infoColor` | `info` | 정보 강조 표시 |

### 사용 가능한 색상

모든 색상 속성은 다음 색조를 받습니다. 웹에서는 `"blue"` 같은 문자열을, Swift에서는 `.blue` 같은 열거형 값을 사용하세요.

`amber` · `blue` · `bronze` · `brown` · `crimson` · `cyan` · `gold` · `grass` · `gray` · `green` · `indigo` · `iris` · `jade` · `lemon` · `lime` · `magenta` · `mint` · `orange` · `pink` · `plum` · `purple` · `red` · `ruby` · `sky` · `teal` · `tomato` · `violet` · `yellow`

## 채팅 스타일

Discord 스타일과 iMessage 스타일 채팅 중에서 선택하세요. 지정하지 않으면 iMessage 스타일(말풍선 채팅)이 기본값입니다.

> [tab] React
>
> ```tsx theme={null}
> const chatOptions: ChatElementOptions = useMemo(() => {
> 	return {
> 		channelId: "chat_feed_XXXXXXXXXXXXXX",
> 		style: "discord", // or "imessage" (default)
> 	};
> }, []);
> ```

> [tab] Vanilla JS
>
> ```typescript theme={null}
> const chatElement = session.createElement("chat-element", {
> 	channelId: "chat_feed_XXXXXXXXXXXXXX",
> 	style: "discord", // or "imessage" (default)
> });
> ```

> [tab] Swift
>
> ```swift theme={null}
> // iMessage style (bubble chat)
> WhopChatView(
>     channelId: "chat_feed_XXXXXXXXXXXXXX",
>     style: .imessage
> )
>
> // Discord style (full-width messages)
> WhopChatView(
>     channelId: "chat_feed_XXXXXXXXXXXXXX",
>     style: .discord
> )
> ```


## Related topics

- [임베디드 채팅 채널](https://docs.whop.com/ko/developer/guides/chat/channels.md)
- [임베디드 채팅에 사용자 동기화하기](https://docs.whop.com/ko/developer/guides/chat/sync-users.md)
- [Element Sessions 타입 레퍼런스](https://docs.whop.com/ko/sdk/elements/types.md)
