Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Recommended bookshelf About Block for React

A bookshelf for a reading app: greyscale spines you can point at, focus or press, each pulling forward to show why the company recommends it and who did.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A bookshelf for React with Base UI, written for Bookmoth, a fictional reading app. Eight spines stand on a framed shelf, titles set vertically, each a different height and a different greyscale pattern. Point at one, move focus onto it, or press it, and it pulls forward. Under the shelf, "Why we recommend it" names the reason and the person who recommended it. The shelf scrolls when the row is wider than the screen, and every recommendation stays in the page. The page's rails and top rule come from the Guides spine. It's built from ToggleGroup and Guides, with a CSS entrance and your theme's tokens for every colour. For an about page that should hand someone a book the company actually loves. The books, the reasons and the people are example data.

FAQ

How do I change the books?

The books are BOOKS at the top of the file. Each has a title, a why, a by and a role, plus a height class and a pattern class for the spine. The heading counts BOOKS. The first book starts selected. Add or remove rows freely: the shelf, the scroll and the note are drawn from the array.

How is it read by a screen reader?

The heading is the section's only h2. The shelf is a group named "Books we recommend", and each spine's name is its title. Under the shelf, one h3 ("Why we recommend it") introduces the reason and who recommended it. The other reasons stay in the page but are hidden from assistive technology until that spine is chosen. After you choose a different book, a polite live region repeats the reason. The lines and the plank are hidden from assistive technology.

How do I choose a book?

Pointing at a spine, moving focus onto it, or pressing it selects that book and pulls the spine forward. The selected book stays selected: pressing it again does not clear it. The note under the shelf updates to that book's reason.

Are the other recommendations in the HTML?

Yes. All eight reasons are in the page. The ones you are not looking at are invisible, so the note does not change height, and they are removed from the tab order and from the accessibility tree.

How does it fit on a phone?

The shelf scrolls sideways and the spines stay on the plank. The note sits under the shelf at full width. Nothing else on the page scrolls sideways at 320 pixels, and in a right-to-left layout the vertical titles flip their writing mode.

What moves, and what happens with reduced motion?

The header and the shelf fade up once on load, and a chosen spine eases up. With reduced motion the fade and the ease are off, so a spine changes place at once. The block has no autoplay and nothing loops.

  • Pro

    Podcast Show Notes About

    Press and recognition

    Show notes for a podcast hosting company's own show: a scrolling vertical list of eight episodes at the start and the chosen episode's notes at the end, with a summary, chapters drawn to scale and listed with time stamps, and a Listen link.

  • Pro

    Citable Publications About

    Press and recognition

    A bibliography for a research platform: eight publications as a numbered list in citation form, a type filter, and a Cite button on each row that copies the reference.

  • Pro

    Paper Viewer About

    Press and recognition

    A paper viewer for a lab data platform: a vertical list of five papers at the start and the chosen paper drawn as a framed page at the end, with its venue, title, authors, abstract and one key figure.

  • Pro

    The front page of a newsletter platform's blog laid out like a magazine: a category filter, a featured story with a drawn typographic cover, two small stories and a wide one, and the other categories dimmed when one is chosen.

  • Pro

    One person's Tuesday as a timetable: three lanes (Focus, Meetings, Support) over the working day, with blocks you pick to read what each one was for.

  • Pro

    Values Cloud About

    Culture and values

    A cloud of nine values for a writing app, sized by how often each wins when two disagree: pick a pill in a framed tray and a band under it says what the value means and what it costs us.