A Bootstrap 5 author bio box with a portrait photo, short biography, writing stats, social links and a follow button. Place it at the end of blog posts, articles or tutorials to introduce the writer and point readers to more of their work.
How it works
The box is an aside.ab-box labelled by the author's name. On mobile it is a single column; from 768px a CSS grid puts the photo column (--ab-photo-width) next to the text. The portrait img.ab-photo keeps an 11:13 ratio with object-fit: cover. Behind it, the ::before pseudo-element of .ab-photo-wrap draws an offset frame of diagonal stripes, and a round .ab-badge with a pen icon overlaps the corner. A thick orange left border gives the card its editorial look.
The text column contains the "Written by" eyebrow, the serif .ab-name, the .ab-role line, the .ab-bio paragraph and an .ab-stats list between dashed rules. The .ab-actions row holds four .ab-social-link icons and the .ab-cta group with an "All articles" link and the .ab-follow button.
The script runs on DOMContentLoaded for every .ab-box. Clicking .ab-follow toggles aria-pressed, switches the label between "Follow" and "Following", swaps the plus icon for a check and adds one to the count read from data-ab-followers, shown in .ab-follower-count. The portrait is an Unsplash photo; replace it with the real author's image.
Customization
--ab-accentand--ab-accent-softon.ab-boxinstyle.css: change the orange used by the left border, stripes, badge, eyebrow and social buttons.--ab-paperand--ab-inkon.ab-box: set the card background and the main text and button color.--ab-photo-widthon.ab-box: makes the portrait column wider or narrower.data-ab-followerson.ab-box: the starting follower count used by the follow button.aspect-ratio: 11 / 13in.ab-photo: use1 / 1for a square portrait.- Remove the
::beforerule of.ab-photo-wrapto drop the striped offset frame. - The comment in the
.ab-followclick handler inscript.js: add yourfetch()call there to save the follow state.
Use cases
- Blog posts: a framed portrait and short bio introduce the writer at the end of an article
- Magazines and news sites: stats and social links show an author's reach
- Personal blogs: a follow button invites readers to keep up with new posts
- Guest post pages: credit every contributor with the same consistent bio card, photo and social links
Accessibility
The box uses aside with aria-labelledby pointing to the author's name. The portrait has a meaningful alt, and decorative icons are aria-hidden. Every icon-only social link has a descriptive aria-label. The follow button reports its state with aria-pressed, and a role="status" region .ab-live announces "You are now following Clara Whitfield." Links and buttons show a clear accent-colored focus outline, and the hover lift on social links is disabled for prefers-reduced-motion.
Usage notes
Requires Bootstrap 5 (added automatically) and Bootstrap Icons. Each .ab-box works independently, so several authors can appear on one page.