Skip to content
Powered byPagefind

User

Display a user profile with avatar, name, and role.


The User component renders an inline profile badge consisting of an avatar, user name, optional role designation, and an optional hyperlink. It is built specifically to integrate seamlessly inside regular paragraphs, article bylines, or contributor lists.

Usage

The User component can be used in various configurations depending on your requirements. Below are step-by-step examples demonstrating each feature.

Default State

By default, if no attributes are provided, the component renders the name text along with an automated fallback placeholder avatar.

Published by :user[Bima Akbar]

Preview

Published by Bima Akbar

Custom Image Avatar

You can pass a direct image URL via the avatar attribute to display a custom circular profile picture.

Published by :user[Bima Akbar]{avatar="https://avatars.githubusercontent.com/u/81931118?v=4"}

Preview

Published by Bima AkbarBima Akbar

Add Role Description

Use the role attribute to append a job title or subtitle next to the name, automatically separated by a middle dot · symbol.

Published by :user[Bima Akbar]{avatar="https://avatars.githubusercontent.com/u/81931118?v=4" role="Developer"}

Preview

Published by Bima AkbarBima Akbar · Developer

​Add the url attribute to wrap the entire component inside a hyperlink anchor, allowing readers to click through to a profile, GitHub repository, or social media link.

Published by :user[Bima Akbar]{avatar="https://avatars.githubusercontent.com/u/81931118?v=4" url="https://github.com/bimaakbar-dev"}

Preview

Published by Bima AkbarBima Akbar

Attributes

Props

avatar
Type
string
Required
Optional
Default
Automatic placeholder

Direct image source URL for the avatar thumbnail. Renders as a circular image. If omitted, a clean default placeholder avatar will be assigned automatically.

role
Type
string
Required
Optional

Job title or role description. When provided, it appears immediately after the name separated cleanly by a middle dot .

url
Type
string
Required
Optional

Hyperlink destination. When specified, wraps the user profile badge inside an anchor tag <a>, turning it into a fully interactive link.