Bookmark

Engagement

Add bookmark/save functionality to any content. Users can save items to their personal collection.

@prisma/client@prisma/adapter-pgpgdotenvzustandlucide-reactprisma@types/pg
9 files generated

Install via CLI

npx feature101@latest add bookmark

Import

import { BookmarkButton } from '@/features/bookmark'

Usage

<BookmarkButton userId="user_123" targetId="post_456" targetType="post" />

Props

PropTypeDescription
userId*
stringID of the user bookmarking the content.
targetId*
stringUnique ID of the content being bookmarked.
targetType*
"post" | "article" | "video" | "product" | "repo"Type of content being bookmarked.
initialBookmarked
booleanStart as already bookmarked.
className
stringCustom CSS classes for styling.
File layers:clientui componentzustandhook / storeserverserver actionprismaprisma model

Pro Feature

Get access to this feature

One payment. Every feature. Forever. License key delivered instantly.

Get Pro — $49

No subscription · You own the code