Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Portfolio

ProNew

A portfolio with a profile header, category filters and project cards in grid, tiles, list or masonry that open a detail popup with gallery, description and facts.

Installation

pnpm dlx shadcn@latest add @viewport/portfolio

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

<Portfolio>

PropTypeDefault
projects*PortfolioProject[]—
layout"grid" | "tiles" | "list" | "masonry"

Cards with a gap, edge-to-edge square tiles, one large project per row, or masonry columns at natural image ratio.

"grid"
columns2 | 3 | 4

Most columns to use when there is room.

3
ownerPortfolioOwner

Who the work belongs to. Renders the header above the filters.

—
cta{ label: string; href?: string; onClick?: () => void }

The call to action in the header and in the popup bar.

—
filtersboolean

Show category filter chips.

true
allLabelstring

Label of the chip that shows every project.

"All"
info"hover" | "below" | "none"

Where the title and category sit: over the cover on hover, under the cover, or nowhere. The list layout always shows them below.

"hover"
action"popup" | "none"

What a click does: open the detail popup or nothing.

"popup"
loadingboolean

Shows placeholder cards while projects are being fetched.

false
emptyTextstring

Message when there is nothing to show.

"No projects yet"
onProjectOpen(project: PortfolioProject) => void

Called with the project whenever its popup opens.

—
classNamestring—

<ProjectPopup>

PropTypeDefault
projects*PortfolioProject[]—
openId*string | null—
ownerPortfolioOwner—
ctaPortfolioProps["cta"]—
onOpen*(id: string | null) => void—

Accessibility

  • Filters are toggle buttons; the number of matching projects is announced after each change.
  • Every card is one button named with the project and its category.
  • The popup is a dialog that traps focus and returns it to the card. Left and Right move between projects, Escape closes, and panel and backdrop enter together.
  • Unsafe owner, social, fact or CTA links never become active links; contact schemes such as mailto stay linked.
  • Cards re-flow without scaling or sliding under reduced motion.