component · 74/108
Author Card
Identity, biography, profile links, and a follow toggle.
Install
Install manuallyView source on GitHub
Anatomy
- AuthorCard
- AuthorCardAvatar
- AuthorCardHeader
- AuthorCardName
- AuthorCardRole
- AuthorCardFollow
- AuthorCardBio
- AuthorCardLinks
- AuthorCardLink
Accessibility3 checks
- The card is an article labelled by the author name; the avatar is decorative and falls back to initials when the image is missing or fails.
- Follow is a toggle button with aria-pressed and a constant visible label, described by the author name.
- Profile links are a labelled list of native links with visible focus.
Code example
usage.tsx"use client";import { AuthorCard, AuthorCardAvatar, AuthorCardBio, AuthorCardFollow, AuthorCardHeader, AuthorCardLink, AuthorCardLinks, AuthorCardName, AuthorCardRole, type AuthorCardVariant,} from "@/components/ui/uai/author-card";export function AuthorCardPreview({ variant = "card" }: { variant?: AuthorCardVariant }) { return ( <AuthorCard variant={variant}> <AuthorCardAvatar name="Marta Oliveira" /> <AuthorCardHeader> <div> <AuthorCardName>Marta Oliveira</AuthorCardName> <AuthorCardRole>Staff engineer, Payments</AuthorCardRole> </div> <AuthorCardFollow /> </AuthorCardHeader> <AuthorCardBio> Writes about retry budgets, idempotent APIs, and the boring parts of moving money between banks. </AuthorCardBio> <AuthorCardLinks> <AuthorCardLink href="#posts" onClick={(event) => event.preventDefault()}> 42 posts </AuthorCardLink> <AuthorCardLink href="#github" onClick={(event) => event.preventDefault()}> GitHub </AuthorCardLink> <AuthorCardLink href="#site" onClick={(event) => event.preventDefault()}> marta.dev </AuthorCardLink> </AuthorCardLinks> </AuthorCard> );}Manual installation
author-card.tsxLoading component source…