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

# Temaer og stilarter til indlejret chat

> Tilpas chatelementerne til din app med et tema på web eller i Swift, og vælg en chatstil som Discord eller iMessage.

## Temaer

Tilpas chatelementernes udseende med et tema. På web skal du angive et `theme` via Elements' appearance-indstillinger. I Swift skal du oprette et `WhopTheme` og anvende det med `.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)
>         }
>     }
> }
> ```

### Temaegenskaber

| Formål | Web-indstilling | Swift-indstilling | Beskrivelse |
| - | - | - | - |
| Udseende | `appearance` | — | Lys eller mørk tilstand (`"light"`, `"dark"`) på web. Swift følger appens farveskema. |
| Accent | `accentColor` | `accent` | Primære interaktive elementer, links og fremhævning af valg |
| Neutral | `grayColor` | `neutral` | Tekst, kanter og baggrunde |
| Fare | `dangerColor` | `danger` | Destruktive handlinger og fejltilstande |
| Advarsel | `warningColor` | `warning` | Advarselstilstande |
| Succes | `successColor` | `success` | Succestilstande |
| Info | `infoColor` | `info` | Informative fremhævninger |

### Tilgængelige farver

Alle farveegenskaber accepterer disse nuancer. Brug strenge på web, f.eks. `"blue"`, og enum-værdier i Swift, f.eks. `.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`

## Chatstilarter

Vælg mellem chat i Discord-stil eller iMessage-stil. iMessage-stil (boblechat) er standard, hvis intet angives.

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