Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Recommended bookshelf About Block for Ark UI

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 Ark 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.