Skip to content

User

Displays a user identity block with avatar, name, and optional description. Avatar can be positioned left or right.

Also known as: user info, profile, identity, avatar card, author

View in Storybook

When to use

  • Showing user identity in card headers, comments, or lists.
  • Displaying author information with avatar and handle.
  • Building profile rows in navigation or dropdowns.

Import

tsx
import { User } from '@vacano/ui'

Usage

tsx
<User
  name="Zoey Lang"
  description="@zoeylang"
  src="https://example.com/avatar.jpg"
/>

Without image (initials)

When src is not provided, Avatar displays initials from name.

tsx
<User name="Zoey Lang" description="Frontend Developer" />

Avatar position

tsx
<User name="Zoey Lang" description="@zoeylang" avatarPosition="left" />
<User name="Zoey Lang" description="@zoeylang" avatarPosition="right" />

Custom avatar props

Pass any Avatar prop (except ref) via avatarProps.

tsx
<User
  name="Zoey Lang"
  avatarProps={{ size: 'lg', bordered: true, color: 'primary' }}
/>

Without description

tsx
<User name="Zoey Lang" src="https://example.com/avatar.jpg" />

Props

PropTypeDefaultDescription
nameReactNoderequiredUser name (bold text)
descriptionReactNode-Secondary text (e.g. handle, role)
srcstring-Avatar image URL
avatarPosition'left' | 'right''left'Avatar placement relative to text
avatarPropsOmit<AvatarProps, 'ref'>-Additional props passed to Avatar (excluding ref)
refRef<HTMLDivElement>-Forwarded ref
classNamestring-CSS class name for the root element
classnamesUserClassNames-Custom class names for sub-elements

ClassNames

KeyDescription
avatarThe Avatar element
nameThe name text
descriptionThe description text
  • Avatar - Standalone avatar component
  • Card - Often used inside CardHeader

Released under the MIT License.