Skip to content

Profile Card with Stats

Bootstrap 5 user profile card with gradient cover, initials avatar, animated stat counters, follow toggle, message and copy-link buttons.

Also known as: user profile card, social profile card, author card

Bootstrap 5 Profile Cards Responsive #card #counter #profile #stats #user

Profile Card with Stats live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 profile card with a violet-to-teal gradient cover, an initials avatar with a verified badge, three animated stat counters and Follow, Message and copy-link actions. Use it on community sites, author pages, team directories or as a user preview in a social app.

How it works

The card is an article.card.prs-card inside the .prs-wrap container, capped at 380px wide. The decorative .prs-cover band is drawn with layered gradients, and .prs-avatar is pulled up over it with a negative top margin calculated from --prs-avatar-size. The avatar shows initials (.prs-initials), so no photo is needed. The stats are a description list dl.prs-stats: each .prs-stat holds a dt label and a dd.prs-stat__value with a data-count attribute, and flex-direction: column-reverse shows the number above its label.

The script runs on DOMContentLoaded for every .prs-card. An IntersectionObserver waits until the card is visible, then countUp() animates each value from zero to its data-count with an ease-out curve over DURATION (1200 ms) and formats it with thousands separators. The numbers are already in the HTML, so the card is complete without JavaScript. Clicking .prs-follow toggles aria-pressed, swaps the icon and label to "Following", and adds or removes one follower on .prs-followers. The .prs-share button copies the page URL with the Clipboard API and falls back to showing the link if copying is blocked. Every action writes a short message into .prs-status.

Customization

  • --prs-from and --prs-to in .prs-wrap: change the cover gradient; --prs-from also colors the role, the verified badge and the Follow button.
  • --prs-avatar-size in .prs-wrap: makes the avatar larger or smaller; the overlap and initials size follow automatically.
  • data-count on a .prs-stat__value: sets the number the counter animates to, for example data-count="2048".
  • DURATION at the top of script.js: speed up or slow down the counter animation.
  • Replace the .prs-initials span with an img (https://placehold.co/208x208) styled width: 100%; border-radius: 50% to show a photo.
  • max-width: 380px in .prs-card: widen the card for a sidebar or a profile page header.
  • The text in the .prs-follow click handler: replace it with a fetch() call to your own follow endpoint.

Use cases

  • Community sites: a card with cover, avatar and verified badge introduces a member
  • Author pages: three animated stat counters show followers, posts or other numbers at a glance
  • Team directories: Follow, Message and copy-link buttons give visitors quick actions
  • Social apps: use it as a compact user preview that is capped at a narrow width

Accessibility

The card is labelled by the name heading through aria-labelledby. Decorative parts (cover, avatar, icons) are aria-hidden. The stats are a real description list, so screen readers announce label and value together. The Follow button exposes its state with aria-pressed, and the icon-only share button has an aria-label. .prs-status is a polite live region that announces follow and copy results. Buttons show a teal :focus-visible outline, and the counters skip the animation when prefers-reduced-motion: reduce is set.

Usage notes

Requires Bootstrap 5 (added automatically) and Bootstrap Icons. Repeat the article.prs-card in a row for a grid of profiles; each card animates and toggles independently. The Clipboard API needs a secure context, which is why the share button has a fallback message.

Profile Card with Stats at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Profile Cards
License
Free for personal and commercial use

Questions about this template

Can I use the Profile Card with Stats code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Profile Card with Stats – free Bootstrap 5 profile card template
Profile Card with Stats · free Bootstrap 5 profile card template

More Profile Cards

Neon Glow Profile Card – free Pure CSS profile card template

Neon Glow Profile Card

Dark profile card with an animated neon conic-gradient border, soft glow, stats, skill tags and a Follow toggle, built with pure CSS and vanilla JS.

Business Card Style Contact Card – free Bootstrap 5 profile card template

Business Card Style Contact Card

Bootstrap 5 digital business card with portrait, role, tap-to-call contact links, copy buttons, a QR code and a downloadable vCard.

Profile Card with Animated Photo Border – free Pure CSS profile card template

Profile Card with Animated Photo Border

Dark pure CSS profile card whose round portrait sits in a spinning conic-gradient ring with a soft glow, plus stats and a follow toggle.

Profile Card with Cover – free Tailwind CSS profile card template

Profile Card with Cover

Tailwind CSS profile card with a gradient cover, overlapping avatar, verified badge, bio, skill chips, stats and an accessible follow toggle.