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

User

user

Combines an avatar, display name, and supporting description into a compact user row.

Usage

Basic usage

Avatar + name + secondary description (email/role/@handle).

Hulianzhangzhiwei@hulian.dev
tsx
<User
  name="Hulian"
  description="zhangzhiwei@hulian.dev"
  avatarProps={{ src: "/avatar.png", alt: "Hulian" }}
/>

Initials

Use fallback to render the initial placeholder when there is no avatar image.

Li
Li SiProduct Manager
tsx
<User name="Li Si" description="Product Manager" avatarProps={{ fallback: "Li" }} />

Name only

Only single line names are rendered when description is omitted.

U
No user description
tsx
<User name="User without description" avatarProps={{ fallback: "U" }} />

Avatar size

Adjust avatar size via avatarProps.size.

S
Smallsize=sm
L
Large sizesize=lg
tsx
<>
  <User name="small" description="size=sm" avatarProps={{ fallback: "S", size: "sm" }} />
  <User name="Large" description="size=lg" avatarProps={{ fallback: "L", size: "lg" }} />
</>

When to use

Use User for a person row or card containing an avatar, name, and email, role, or handle. Use [Avatar] for only an image, AvatarCircles for a group, or pass User into Comment's author area.

Import

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

Props

NameTypeDefaultDescription
avatarPropsAvatarProps-Props forwarded to the built-in Avatar.
classNamestring-Custom class name.

Slots

SlotTypeDescription
name*ReactNodePrimary name.
descriptionReactNodeSecondary email, role, handle, or other context.

Pitfalls

  • Avatar behavior is configured through avatarProps; provide fallback when no reliable image exists.
  • Omitting description renders a single-line name.

Related

Sparkline · ImageViewer · LiveProductCard · DiffStat · ScoreRing · Badge

PreviousAvatarCirclesData DisplayNextQRCode

On this page

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