shadcn.io is not affiliated with official shadcn/ui
Table examples · Standard
Table with Avatar for React
A table of team members with an avatar beside each name.
Each row starts with an Avatar and the person's name, then their email and role. The avatar shows a GitHub picture and falls back to initials when the picture can't load. Use it for team rosters, member lists and customer directories, where a face makes a name easier to find.
Preview
Installation
FAQ
How are the avatar and the name laid out?
The User TableCell holds a div with flex items-center gap-3. Avatar comes first, then a span with font-medium around user.name.
What does Avatar render in this cell?
AvatarImage gets src={user.avatar} and alt={user.name}. AvatarFallback shows user.initials, such as HB, when the image is not available. There is no size prop, so the Avatar stays the default size-8.
Why do the emails look masked?
The table prints user.email as plain text. The masking is already in the data, for example h****n@vercel.com.
Which columns are in this table?
User, Email and Role. Email and role are plain TableCells. The row key is user.email.
Related
- Basic TableA bordered table of users with their
- Table Without DividersA table of products with no lines between
- Striped TableA table of transactions with every other
- Avatar StandardA round avatar with a profile picture and
- Standard CardA basic card with a title, a description
- Badge with Text (Standard)A default badge with a short label for a