message
shadcn-solidjs/messageFreeComponent
shadcn-solidjs publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-solidjs on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-solidjs.com/r/message.jsonSource
1import { cn } from "~/lib/utils.ts";23import type { Component, ComponentProps } from "solid-js";45import { splitProps } from "solid-js";67const MessageGroup: Component<ComponentProps<"div">> = (props) => {8 const [local, others] = splitProps(props, ["class"]);9 return (10 <div11 data-slot="message-group"12 class={cn("gap-2 flex min-w-0 flex-col", local.class)}13 {...others}14 />15 );16};1718type MessageProps = ComponentProps<"div"> & { align?: "start" | "end" };1920const Message: Component<MessageProps> = (props) => {21 const [local, others] = splitProps(props, ["class", "align"]);22 return (23 <div24 data-slot="message"25 data-align={local.align ?? "start"}26 class={cn(27 "gap-2 text-sm group/message relative flex w-full min-w-0 data-[align=end]:flex-row-reverse",28 local.class,29 )}30 {...others}31 />32 );33};3435const MessageAvatar: Component<ComponentProps<"div">> = (props) => {36 const [local, others] = splitProps(props, ["class"]);37 return (38 <div39 data-slot="message-avatar"40 class={cn(41 "min-w-8 group-has-data-[slot=message-footer]/message:-translate-y-8 flex w-fit shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted",42 local.class,43 )}44 {...others}45 />46 );47};4849const MessageContent: Component<ComponentProps<"div">> = (props) => {50 const [local, others] = splitProps(props, ["class"]);51 return (52 <div53 data-slot="message-content"54 class={cn(55 "gap-2.5 group-data-[align=end]/message:*:data-slot:self-end wrap-break-word flex w-full min-w-0 flex-col",56 local.class,57 )}58 {...others}59 />60 );61};6263const MessageHeader: Component<ComponentProps<"div">> = (props) => {64 const [local, others] = splitProps(props, ["class"]);65 return (66 <div67 data-slot="message-header"68 class={cn(69 "px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 flex min-w-0 max-w-full items-center",70 local.class,71 )}72 {...others}73 />74 );75};7677const MessageFooter: Component<ComponentProps<"div">> = (props) => {78 const [local, others] = splitProps(props, ["class"]);79 return (80 <div81 data-slot="message-footer"82 class={cn(83 "px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 flex min-w-0 max-w-full items-center group-data-[align=end]/message:justify-end",84 local.class,85 )}86// … truncated
More from shadcn-solidjs
All 85 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-solidjs | Components | Free | 1 dep | |
| alertalert | shadcn-solidjs | Components | Free | 2 deps | |
| alert-dialogalert-dialog | shadcn-solidjs | Components | Free | 2 deps | |
| aspect-ratioaspect-ratio | shadcn-solidjs | Components | Free | no deps | |
| attachmentattachment | shadcn-solidjs | Components | Free | 2 deps | |
| avataravatar | shadcn-solidjs | Components | Free | 1 dep | |
| badgebadge | shadcn-solidjs | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | shadcn-solidjs | Components | Free | 1 dep |
