uibrik

Bookmark Button

Preview

Customize

Icon + label
Drop
Soft
Medium
Radius12px

Usage

import { BookmarkButton } from "@/components/uibrik/bookmark-button/bookmark-button";

<BookmarkButton />

Installation

npx shadcn@latest add https://uibrik.com/r/bookmark-button.json
Adds the files to components/uibrik/bookmark-button and installs motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/bookmark-button.

Props

BookmarkButton
label
Type string
"Save"
Button text.
savedLabel
Type string
"Saved"
Shown once saved.
display
Type "label" | "icon"
"label"
Icon and label, or the icon alone (the label stays as its accessible name).
fill
Type "drop" | "rise" | "pop"
"drop"
How the bookmark fills: from the top, from the bottom, or out from the centre.
sparkles
Type boolean
true
Three sparkles pop around the icon on save.
tint
Type boolean
false
Colour the saved bookmark and its sparkles instead of keeping them neutral.
color
Type string
"#f59e0b"
Colour of the saved bookmark when tinted.
variant
Type "soft" | "ghost" | "outline"
"soft"
Filled, transparent until hovered, or outlined.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
radius
Type number
12
Corner radius.
defaultSaved
Type boolean
false
Whether it starts saved.
onChange
Type (saved: boolean) => void
–
Called with the new state after each toggle.
className
Type string
–
Classes for the button.