Search documentation v1.0.0

User Profile Card

Display key information about your users

Source Report Issue

Use the UserProfileCard component to showcase user identity with a banner, avatar, name, user handle, tags, and follower count. The make user data accessible and interactive in social, dashboard, or admin UIs.

Frank Miller @frank.miller
Astro Svelte React
Contributor for @Webcore.
7 Following 1.3k Followers
Unlock code
How to use the UserProfileCard component in Astro
<UserProfileCard
avatar={{
img: '/img/avatar0.png',
size: 50
}}
name="Frank Miller"
handle="@frank.miller"
tags={['Astro', 'Svelte', 'React']}
description="Contributor for <b>@Webcore</b>."
editProfile={{
show: true,
href: '#',
label: 'Edit Profile ->'
}}
follow={{
followingCount: 7,
followersCount: 1290
}}
/>

The UserProfileCard component consist of the following sections:

You can use many different props to customize the appearance of your user profile cards. However, the only required prop for the component is called name, in which case some default values will be rendered:

UserProfileCard with only required prop
Frank Miller
0 Following 0 Followers

Customizing Banners

By default, the banner is displayed with gradient colors. You can customize these colors using the following CSS variables:

Unlock code
How to customize banner colors with CSS
html body {
--w-user-profile-card-start-color: #1CAED7;
--w-user-profile-card-end-color: #4E00C2;
}

This will set the default gradient colors for all UserProfileCard components. The colors can also be set on individual cards using the banner.fromColor and banner.toColor props:

Avatar
Frank Miller @frank.miller
Astro Svelte React
Contributor for @Webcore.
7 Following 1.3k Followers
Avatar
Frank Miller @frank.miller
Astro Svelte React
Contributor for @Webcore.
7 Following 1.3k Followers
Avatar
Frank Miller @frank.miller
Astro Svelte React
Contributor for @Webcore.
7 Following 1.3k Followers
Unlock code
How to customize banner colors through props
<UserProfileCard
...
banner={{
fromColor: 'var(--w-color-success)',
toColor: 'var(--w-color-info)'
}}
/>

You can also display images inside the banner by specifying a src attribute instead. (You can provide alt, width, height and lazy attributes to the banner prop to customize the way your banner image is rendered):

Avatar
Frank Miller @frank.miller
Astro Svelte React
Contributor for @Webcore.
7 Following 1.3k Followers
Unlock code
How to use banner images
<UserProfileCard
...
banner={{ src: '/path/to/img.png' }}
/>

Configuring Followers

The follower count is automatically displayed when using the component. This section can be toggled off by setting the follow.showFollowing and follow.showFollowers props to false. You can also configure the text to translate them with the follow.followingText and follow.followersText props:

Avatar
User profile with no followers @frank.miller
Astro Svelte React
Contributor for @Webcore.
Avatar
User profile with translated followers @frank.miller
Astro Svelte React
Contributor for @Webcore.
7 Subscriptions 1.3k Subscribers
Unlock code
How to hide followers
<UserProfileCard
...
follow={{
showFollowing: false,
showFollowers: false
}}
/>
Unlock code
How to translate followers
<UserProfileCard
...
follow={{
followingCount: 7,
followersCount: 1290,
followingText: 'Subscriptions',
followersText: 'Subscribers'
}}
/>

Showing Additional Content

To show additional content inside your user profile card, simply pass your elements as the children to the component. For example, you can display reviews inside the card in the following way to create rich user-rating cards:

Avatar
Frank Miller @frank.miller
Astro Svelte React
Contributor for @Webcore.
7 Following 1.3k Followers
Most helpful review: ★★★★★
Last reviewed: 2025. 02. 15.
Absolutely fantastic creator! The quality exceeded my expectations, and the customer support was super helpful. Highly recommend!
Verified User
Unlock code
How to display additional content within the card
<UserProfileCard ...>
<Review
element="div"
compact={true}
review={{
name: 'Most helpful review:',
date: 'Last reviewed: 2025. 02. 15.',
description: 'Absolutely fantastic creator! The quality exceeded my expectations, and the customer support was super helpful. Highly recommend!',
rating: {
score: 5,
color: 'var(--w-color-warning)'
}
}}
verifiedText="Verified User"
/>
</UserProfileCard>
See the documentation of the Reviews block to learn more about how you can use it within your apps.

API

Unlock code
Component API reference
type UserProfileCardProps = {
avatar?: AvatarProps
editProfile?: {
show?: boolean
label?: string
href: string
target?:
| '_self'
| '_blank'
| '_parent'
| '_top'
| '_unfencedTop'
}
banner?: {
src?: string
alt?: string
width?: number
height?: number
lazy?: boolean
fromColor?: string
toColor?: string
}
name: string
handle?: string
tags?: string[]
description?: string
follow?: {
showFollowing?: boolean
showFollowers?: boolean
followingCount?: number
followersCount?: number
followingText?: string
followersText?: string
}
className?: string
}
Please see the documentation of the Avatar component for AvatarProps.
PropDefaultPurpose
avatar user.svg Sets an avatar for the card.
editProfile - Specifies a CTA at the top-right corner.
editProfile.show false Set to true to make the "Edit Profile" button visible.
editProfile.label "Edit Profile" Sets a label for the button.
editProfile.href - Sets a link for the "Edit Profile" button.
editProfile.target - Sets the target of the link on the "Edit Profile" button.
banner - Sets a banner image above the avatar.
banner.src - Sets the path for the banner.
banner.alt - Sets an alternate text for the banner.
banner.width - Sets the width of the banner.
banner.height - Sets the height of the banner.
banner.lazy - Set to true to enable lazy loading for the banner.
banner.fromColor #1CAED7 Sets the starting color for the banner gradient when no image is provided.
banner.toColor #4E00C2 Sets the ending color for the banner gradient.
name - Sets the name of the user.
handle - Sets a handle under the name of the user.
tags [] Pass an array of strings to set badges as tags under the handle.
description - Sets a description under the tags.
follow.showFollowing true Shows following count.
follow.showFollowers true Shows followers count.
follow.followingCount 0 Sets the number of following.
follow.followersCount 0 Sets the number of followers.
follow.followingText Following Sets the following text.
follow.followersText Followers Sets the followers text.
className - Pass additional CSS classes for the component.