Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Sheet examples · Details

Article Preview Sheet for React

A right-side sheet previewing an article with its byline, read time, two opening paragraphs and a Read Full Article button.

Framework
UI library

An article preview that slides in from the right: the title and subtitle in the header, the byline and read time, two opening paragraphs, then Read Full Article. People skim the opening without leaving the list they're in, and open the full page only when it's worth it.

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

What does the preview show?

The title Getting Started with React and the subtitle A comprehensive guide for beginners in SheetHeader, a muted line with By John Smith and 5 min read, two paragraphs, and a full-width Read Full Article button.

Is the dot in the byline read aloud?

No. The • between the author and the read time is aria-hidden, so a screen reader hears By John Smith, then 5 min read.

What does the sheet announce when it opens?

SheetTitle names the dialog for assistive tech, so every sheet renders one; hide it with sr-only when the design has no visible heading. Here the article's title is the sheet's title, and its subtitle is the description.

How does Read More open the preview?

The outline button labeled Read More 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.

What if the article preview is long?

Give the body flex-1 overflow-y-auto so it scrolls inside the panel while the header stays put. A preview should stay short, though: two paragraphs and a link out.