Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { ChatMessage } from '@dryui/ui';
</script>

<ChatMessage>Content</ChatMessage>

Import options

Root package

ts
import { ChatMessage } from '@dryui/ui'

Per-component subpath

ts
import { ChatMessage } from '@dryui/ui/chat-message'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Default

You
Hello, how are you?
svelte
<ChatMessage role="user" name="You">
  Hello, how are you?
</ChatMessage>

Conversation

You
Can you help me with a Svelte question?
Assistant
Of course! What would you like to know?
svelte
<ChatMessage role="user" name="You" timestamp="10:30 AM">
  Can you help me with a Svelte question?
</ChatMessage>
<ChatMessage role="assistant" name="Assistant" timestamp="10:30 AM">
  Of course! What would you like to know?
</ChatMessage>

System Message

System
You are a helpful assistant.
svelte
<ChatMessage role="system" name="System">
  You are a helpful assistant.
</ChatMessage>

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Prop Type Default Required Bindable
role
userassistantsystem
'user'
variant
sentreceived
avatar
string
name
string
timestamp
string
typing
boolean
false
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.