Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Sheet examples · Details

User Profile View Sheet for React

A right-side sheet showing a user's initials, handle and contact details, with a Send Message button.

Framework
UI library

A read-only profile in a right-side sheet: a large Avatar with initials, the name and handle, then Email, Location and Joined as label and value pairs. Send Message is the one action. Open it from a name in a list to show who someone is without leaving the page.

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 large avatar made?

An Avatar with className="size-16" and an AvatarFallback showing JD on the primary color. Add an AvatarImage before the fallback to show a photo.

How are the profile details marked up?

As a description list: each dt is a muted label (Email, Location, Joined) and each dd its value, in rows with justify-between. Screen readers read them as pairs.

What does Send Message do?

Nothing yet: it's a full-width Button with no handler. Open your compose view from it, or render it as a link to the conversation.

What does the profile sheet announce?

SheetTitle names the dialog for assistive tech, so every sheet renders one; hide it with sr-only when the design has no visible heading. It reads User Profile, with View user information and activity as the description.

How does View Profile open the sheet?

The outline button labeled View Profile is the trigger, and its text is the accessible name. The Button goes in the render prop of SheetTrigger, and the label stays its child.

Which edge does it use?

The right: SheetContent leaves side unset. The corner close button is on because showCloseButton defaults to true. Escape and a click on the overlay close the sheet too, and focus goes back to the trigger.