BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/sv11-twango/message

Message

sv11-twango/message
FreeComponent

A chat message primitive with role-based variants, avatar, and content slots.

Live preview

live · rendered by the registry
Rendered by sv11-twango on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add http://sv11.ui.twango.dev/r/message.json

Source

registry itemsv11.ui.twango.dev/r/message.json
1<script lang="ts">
2 import type { Snippet } from "svelte";
3 import type { HTMLAttributes } from "svelte/elements";
4 import { cn } from "$UTILS$.js";
5
6 let {
7 class: className,
8 from,
9 children,
10 ...restProps
11 }: HTMLAttributes<HTMLDivElement> & {
12 /**
13 * Determines the message's alignment and which group-scoped styles
14 * (`is-user` / `is-assistant`) apply to `MessageContent` and
15 * `MessageAvatar` descendants.
16 */
17 from: "user" | "assistant";
18 /** Message body — typically a `MessageContent` and/or `MessageAvatar`. */
19 children?: Snippet;
20 } = $props();
21</script>
22
23<div
24 data-slot="message"
25 class={cn(
26 "group flex w-full items-end justify-end gap-2 py-4",
27 from === "user" ? "is-user" : "is-assistant flex-row-reverse justify-end",
28 className
29 )}
30 {...restProps}
31>
32 {@render children?.()}
33</div>
34
35<style>
36 :global(.is-user) {
37 --foreground: var(--primary-foreground);
38 --card: var(--primary);
39 --card-foreground: var(--primary-foreground);
40 --muted: color-mix(in oklab, var(--primary) 88%, var(--primary-foreground));
41 --muted-foreground: color-mix(in oklab, var(--primary-foreground) 70%, transparent);
42 --border: color-mix(in oklab, var(--primary-foreground) 18%, transparent);
43 }
44</style>

What it pulls in

npm packages

  • bits-ui
  • tailwind-variants

Other registry items

  • avatar

Facts

Registry
sv11-twango
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
First indexed
2026-08-02
Last confirmed
2 days ago

Go to the source

Docs on sv11-twango sv11.ui.twango.dev twangodev/sv11-ui on GitHub Raw registry item This item as JSON

More from sv11-twango

All 29 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Audio Playeraudio-playersv11-twangoComponentsFree2 deps
Bar Visualizerbar-visualizersv11-twangoComponentsFreeno deps
Conversationconversationsv11-twangoComponentsFree2 deps
Conversation Barconversation-barsv11-twangoComponentsFree1 dep
Live Waveformlive-waveformsv11-twangoComponentsFreeno deps
Matrixmatrixsv11-twangoComponentsFreeno deps
Mic Selectormic-selectorsv11-twangoComponentsFree1 dep
Orborbsv11-twangoComponentsFree4 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex