Bookmark Button
A save button whose ribbon fills from the top and dips like it was pressed, with an optional “Saved to” toast line.
$
View as Markdownnpx shadcn@latest add https://sundaeui.dev/r/bookmark-button.jsonOverview
Saving fills the ribbon top-down and gives it a small downward dip, as if clipped onto the page. Unsaving drains it.
An optional line under it confirms where it was saved, with an Undo, and fades after a few seconds.
When to use
- Articles, products, listings, recipes, jobs.
When not to use
- Multi-collection saving: open a picker instead.
Installation
$
pnpm dlx shadcn@latest add https://sundaeui.dev/r/bookmark-button.json$
npx shadcn@latest add https://sundaeui.dev/r/bookmark-button.json$
yarn dlx shadcn@latest add https://sundaeui.dev/r/bookmark-button.json$
bunx --bun shadcn@latest add https://sundaeui.dev/r/bookmark-button.jsonWorks in any React project. Files are written to components/sundae/. Read the source in the stage’s Code view.
- No dependencies beyond React 18 or later.
- Copy bookmark-button.tsx and bookmark-button.css into components/sundae/.
- The CSS file is imported by the component, so no extra configuration is needed.
- Import the component and use it as shown below.
Usage
import { BookmarkButton } from '@/components/sundae/bookmark-button'
<BookmarkButton />Props
| Prop | Type | Default |
|---|---|---|
saved / defaultSavedState. | boolean | false |
collectionName shown in the confirmation. | string | — |
onSavedChangeCalled on change. | (saved: boolean) => void | — |
fillSurface: dark or light. | 'dark' | 'light' | 'dark' |
Accessibility
- A toggle button with aria-pressed and the name "Save" or "Saved".
- The confirmation is a polite status with an Undo button.
- Reduced motion removes the movement and keeps every state change.
Customization
- Colours are CSS custom properties on .sd-bkm; override them in your own stylesheet.
- fill="light" switches the built-in light palette.
FAQ
- Is Bookmark Button free?
- Yes. Bookmark Button is free for personal and commercial projects, with full source on this page.
- How do I install Bookmark Button?
- Run npx shadcn@latest add https://sundaeui.dev/r/bookmark-button.json. The files are written to components/sundae/. It has no dependencies beyond React 18 or later.
- Does Bookmark Button support keyboard and screen readers?
- A toggle button with aria-pressed and the name "Save" or "Saved". The confirmation is a polite status with an Undo button.
- Does Bookmark Button respect reduced motion?
- Reduced motion removes the movement and keeps every state change.
More like this
All components →Follow Button
Components · RefinedHold to Confirm
Components · RefinedDownload Button
Components · RefinedTheme Toggle
Components · RefinedSplit Button
Components · RefinedSubmit Button
Components · Refined