Document card

A draggable card representing a document, title, optional excerpt, duration and meta. Drag it (mouse/pen), marquee-select it, or click without dragging to fire onOpen with a payload that includes the card's sourceRect (useful for shared-element open animations).

Layout & grids

Drag me, marquee-select me, or click to open.

6 minFoundations

Type scale

onOpen emits a generic payload with a sourceRect.

4 minTypography

Installation

npx shadcn@latest add https://canvas.blode.co/r/document-card.json

Usage

import { DocumentCard } from "@/components/canvas/document-card";
 
<DocumentCard
  cardId="doc-1"
  duration="6 min"
  excerpt="A short summary…"
  meta="Foundations"
  onOpen={(state) => open(state)}
  title="Layout & grids"
  x={70}
  y={70}
/>;

Props

PropTypeDefaultDescription
x*numberLeft position on the canvas, in px.
y*numberTop position on the canvas, in px.
title*stringDocument title.
cardId*stringStable id for selection and the onOpen payload.
excerptstringShort summary line.
durationstringSmall label, e.g. a reading time.
metastringRight-aligned label, e.g. a category.
selectedbooleanDraws the selection ring.
onOpen(state: DocumentOpenState) => voidFires on a click (not a drag) with `{ cardId, title, sourceRect }`.