Skip to content

View Toggle

Segmented grid / list / index switch with a sliding indicator, for choosing how a work section is laid out.

Installation

pnpm dlx shadcn@latest add @portfolio-kit/view-toggle
First time? Add the @portfolio-kit registry to components.json
components.json
{
  "registries": {
    "@portfolio-kit": "https://www.parthjadhav.com/products/portfolio-kit/r/{name}.json"
  }
}

Usage

Examples

With Labels

Visible text labels make the choice explicit; size="sm" fits dense toolbars.

Custom Views

Compose your own ViewToggleItems with any value, label and lucide icon.

Switching Layouts

Control the toggle and render the same projects as a card grid or a typographic index.

API Reference

Used in