Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Combobox examples · Rich Content

Items with Avatars Combobox for React

A combobox of people with an avatar on each row and on the button.

Framework
UI library

A user picker with a small avatar beside each name, repeated on the button once someone is picked. When an image can't load, the first letter of the name shows instead. Use it for assignees, reviewers, mentions and other people pickers.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How is the avatar built?

An Avatar at size-5 with AvatarImage for the photo and AvatarFallback with the first letter of the name. The image has an empty alt, since the name is right next to it.

How does the button show the avatar?

It renders the picked person's avatar and name side by side, and Select user... before a pick. ComboboxValue takes a function that gets the picked user.

Who is in the list?

Hayden Bleasel, shadcn, Lee Robinson and Guillermo Rauch, with their GitHub pictures.

What shows while an image loads?

The fallback letter, until the image has loaded. If it never loads, the letter stays.

How do I show more about each person?

Add an email or role under the name, as in Items with Metadata.