Clip Card
Video tile: AspectRatio thumbnail (16:9 or 9:16), duration Badge, watched Progress along the bottom, and a ContextMenu of actions.
Insane 1v4 clutch
12.4K views · 2 days ago
Boss fight, no hits
3.1K views · last week
Funniest fail
import { ClipCard } from "@/components/blocks/clip-card";import { ContextMenuItem, ContextMenuSeparator,} from "@/components/ui/context-menu";type Clip = { id: string; title: string; duration: string; thumb: string; watched: number;};export function ClipList({ clips, onPlay, onDelete,}: { clips: Clip[]; onPlay: (id: string) => void; onDelete: (id: string) => void;}) { return ( <div className="grid grid-cols-2 gap-3 md:grid-cols-4"> {clips.map((c) => ( <ClipCard key={c.id} title={c.title} duration={c.duration} watched={c.watched} thumbnail={<img src={c.thumb} alt="" />} actions={ <> <ContextMenuItem onSelect={() => onPlay(c.id)}> Play </ContextMenuItem> <ContextMenuSeparator /> <ContextMenuItem variant="destructive" onSelect={() => onDelete(c.id)} > Delete </ContextMenuItem> </> } /> ))} </div> );}<ClipCard>
Video tile: thumbnail in an AspectRatio, duration Badge, watched Progress and a context menu.
duration*string"0:42".
title*stringClip name; also the accessible name of the card.
actionsReactNodeContext menu items (
<ContextMenuItem>s): right-click or Shift+F10 opens them.metaReactNodeSmall print under the title, e.g. "12.4K views · 2 days ago".
ratiodefault16 / 9numberWidth/height, e.g. 9 / 16 for vertical clips.
thumbnailReactNode<img>thumbnail; a film glyph stands in without one.watchednumberHow much was watched, 0 to 100: a thin bar along the bottom of the thumbnail.
| Prop | Type | Default |
|---|---|---|
duration*"0:42". | string | — |
title*Clip name; also the accessible name of the card. | string | — |
actionsContext menu items ( | ReactNode | — |
metaSmall print under the title, e.g. "12.4K views · 2 days ago". | ReactNode | — |
ratioWidth/height, e.g. 9 / 16 for vertical clips. | number | 16 / 9 |
thumbnail
| ReactNode | — |
watchedHow much was watched, 0 to 100: a thin bar along the bottom of the thumbnail. | number | — |
* required. Every component also takes className.