Skip to Content

Document Share Card

Document sharing card for collaboration: a read-only share link with a copy button, then a list of people each with a viewer or editor permission select. You supply the people, options, change handler and labels.

Installation

pnpm dlx shadcn@latest add @01orbital/document-share-card

Usage

import { DocumentShareCard } from "@/components/card/document-share-card"

Needs props to render

Pass title, url, people, permissions, onPermissionChange, labels; see the API reference below.

API reference

A share panel for a document: a title and description, a copyable link, and the people with access, each with a permission picker. Every visible word comes from props, so it can be translated. The caller owns the people and saves each change in onPermissionChange. Other props go to the Card.

Prop

Type

It also accepts the HTML attributes of the element it renders, and the props of the stock Card it builds on.

Dependencies

Requires these pieces. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:

The shadcn parts here are their Base UI versions, and this piece uses Base UI's API. A Radix version you already have won't work with it.

Used in blocks

One block is built with Document Share Card.

Last updated on