Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

LiveChat

live-chat

Displays live message types, sender levels, pinned items, auto-scroll, and new-message recovery.

Usage

Basic usage

items controlled append, the component automatically rolls to the bottom; supports message / enter / gift / follow / system multiple message types.

Welcome to the live broadcast room, please speak in a civilized manner~
Night sailing joined
12Abai:Hello anchor~
momo followed the host ❤
Fawnsent💖 Be careful×6
3Kris:Ask for link
28Doudoulong:Placed an order
tsx
<LiveChat
  items={[
    { id: "s0", type: "system", text: "Welcome to the live broadcast room~" },
    { id: "e1", type: "enter", user: { name: "Night Ship" } },
    { id: "m1", type: "message", user: { name: "Abai", level: 12 }, text: "Hello anchor~" },
    { id: "g1", type: "gift", user: { name: "Fawn" }, gift: { name: "Be careful", icon: "💖", combo: 6 } },
  ]}
/>

Pinned Announcement

pinned is rendered in the top sticky area (announcements/rules) and does not participate in the scroll flow.

PinnedThe draw will be held at 8pm tonight, pay attention and don't get lost
Welcome to the live broadcast room, please speak in a civilized manner~
Night sailing joined
12Abai:Hello anchor~
momo followed the host ❤
Fawnsent💖 Be careful×6
3Kris:Ask for link
28Doudoulong:Placed an order
tsx
<LiveChat
  items={items}
  pinned={[{ id: "p1", type: "system", text: "The draw will be held at 8 o'clock tonight, pay attention to not get lost" }]}
/>

Video overlay status

overlay C for public screen superimposed on dark video: hide scroll bar, top fade, text turned white with shadow.

Welcome to the live broadcast room, please speak in a civilized manner~
Night sailing joined
12Abai:Hello anchor~
momo followed the host ❤
Fawnsent💖 Be careful×6
3Kris:Ask for link
28Doudoulong:Placed an order
tsx
<div className="relative aspect-[9/16] bg-black">
  <video ... />
  <div className="absolute inset-x-2 bottom-2 h-48">
    <LiveChat items={items} overlay className="h-full" />
  </div>
</div>

When to use

Use LiveChat for a one-way livestream public chat. Enable overlay over video. Use Conversation for AI turns or LogViewer for structured logs.

Import

ts
import { LiveChat } from "@hulianui/ui"

Props

NameTypeDefaultDescription
items*LiveChatItem[]-Controlled appended messages.
pinnedLiveChatItem[]-Pinned notices above the stream.
autoScrollbooleantrueSticks to bottom until the user scrolls up.
maxItemsnumber200Render-window limit.
overlaybooleanfalseLight text and shadow over dark video.
classNamestring-Container class.

LiveChatItem

NameTypeDefaultDescription
id *string-Deduplication key.
type *"message" | "gift" | "system" | "enter"-Entry type, which decides how the row renders.
userLiveChatUser-Sender { name, avatar?, badge?, level? }; the system type may omit it.
textReactNode-Body of a message entry.
gift{ name: string; icon?: ReactNode; combo?: number }-Gift details for a gift entry.
atstring-Timestamp text, shown as-is without formatting.

Slots

SlotTypeDescription
renderItem(item: LiveChatItem) => ReactNodeCustom item renderer.

LiveChatItem is { id; type: "message"\|"enter"\|"gift"\|"follow"\|"system"; user?; text?; gift?; at? }. LiveChatUser is { name; avatar?; level?; badge? }.

Usage notes

  • The separator after a message author follows ConfigProvider locale: the Chinese locale uses a full-width colon, while enUS uses :. Older custom dictionaries without this field keep the Chinese fallback.
  • Scrolling up pauses sticky-bottom behavior and exposes a new-message recovery button; do not force external scrolling.
  • Give the stream a fixed-height container.
  • Keep maxItems bounded rather than passing complete history.
  • Built-in “Pinned / new messages / joined / followed / sent” copy follows ConfigProvider locale; enUS provides English, and the no-provider fallback remains Chinese.

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

PreviousDanmakuData DisplayNextLivePlayer

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Usage notes
    • Related