Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Bookshelf

New

Preview

Click a book to pull it out. Arrow keys browse the shelf.

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/bookshelf

Import the shared styles once in your application.

TSUsage
import Bookshelf from '@/components/beui/layout/Bookshelf.vue'
import '@/components/beui/styles.css'

API Reference

books
readonly BookshelfBook[]
Default—
v-model?
string | null

Id of the open book, or null. Pass to control the shelf.

Default—
defaultValue?
string | null

Id of the book that starts open when `v-model` is not bound.

Defaultnull
@value-change?
(id: string | null) => void
Default—
height?
number

Book height in px.

Default300
coverRatio?
number

Cover width as a fraction of the height.

Default0.68
gap?
number

Space between closed books in px.

Default3
openGap?
number

Extra space on each side of the open book in px.

Default16
tilt?
boolean

Tilt the open cover toward the mouse. Mouse only, off with reduced motion.

Defaulttrue
sound?
boolean

Play a slide as a book comes out or goes back, and a soft tap as the mouse runs along the spines. Default false.

Defaultfalse
labels?
Partial<BookshelfMessages>

Override any built-in string.

Default—
class?
string
Default—
label?
string

Accessible name of the shelf.

Default—

Updated