CentercodeDitto
DittoPorygonAPI

NavCardGrid

Responsive grid or list of clickable navigation cards with icons

Overview

NavCardGrid displays navigation cards in multiple layout variants. Use for menu pages, category selection, and navigation interfaces.

Layout Variants

  • grid - Vertical cards, 1->2->3 columns, with action text (default)
  • grid-compact - Vertical cards, 1->2->4 columns, no action text
  • list - Horizontal cards, full width, icon left with trailing content
  • list-2col - Horizontal cards, 1->2 columns, icon left with trailing content

Examples

Grid Layout (Default)

Standard navigation grid with vertical cards. Default layout for category pages.

Dashboard
View your overview and stats

View

Projects
Manage your testing programs

View

Tasks
Track and complete your tasks

View

Team
Manage team members and permissions

View

Analytics
View insights and reports

View

Settings
Configure your preferences

View

Grid Compact

Denser layout with 4 columns and no action text. Ideal for index pages with many items.

Dashboard
View your overview and stats
Projects
Manage your testing programs
Tasks
Track and complete your tasks
Team
Manage team members and permissions
Analytics
View insights and reports
Settings
Configure your preferences

List Layout

Full-width horizontal cards with icon on left. Great for simple navigation lists.

Dashboard
View your overview and stats
Projects
Manage your testing programs
Tasks
Track and complete your tasks

List 2-Column Layout

Two-column horizontal cards. Balances density with readability.

Dashboard
View your overview and stats
Projects
Manage your testing programs
Tasks
Track and complete your tasks
Team
Manage team members and permissions
Analytics
View insights and reports
Settings
Configure your preferences

Custom Trailing Content

List layouts support custom trailing content like badges, stats, or buttons.

Primitives
Low-level shadcn/ui building blocks: Button, Input, Dialog, Card
Components
Centercode-specific reusable UI components
42
Issues
Report bugs and problems
3
Praise
Tell us what you love
New
Primitives
Low-level shadcn/ui building blocks: Button, Input, Dialog, Card
Components
Centercode-specific reusable UI components
42
Issues
Report bugs and problems
3
Praise
Tell us what you love
New

Props Reference

PropTypeDefaultDescription
itemsNavCardItem[]requiredArray of navigation items
layout'grid' | 'grid-compact' | 'list' | 'list-2col''grid'Layout variant for the cards
actionTextstring'View ->'Action link text (grid layouts only)
classNamestring-Additional CSS classes for the grid container

NavCardItem Interface

PropTypeDescription
namestringDisplay name for the card
descriptionstringBrief description shown below the name
iconIconDefinitionFontAwesome icon to display
hrefstringNavigation target URL (or use onClick)
onClick() => voidClick handler (alternative to href)
iconColorstringTailwind color class (e.g., 'text-blue-400')
trailingReactNodeCustom trailing content for list layouts (default: chevron)

Usage

import { NavCardGrid } from '@/ui/components';
import { faHome, faFolder } from '@fortawesome/duotone-regular-svg-icons';
import { Badge } from '@/ui/primitives';

const navItems = [
  {
    name: 'Dashboard',
    description: 'View your overview and stats',
    icon: faHome,
    href: '/dashboard',
    iconColor: 'text-blue-400',
  },
  {
    name: 'Projects',
    description: 'Manage your testing programs',
    icon: faFolder,
    href: '/projects',
    iconColor: 'text-green-400',
    trailing: <Badge>12</Badge>, // Custom trailing for list layouts
  },
];

// Grid layout (default) - vertical cards, 3 columns
<NavCardGrid items={navItems} />

// Grid compact - vertical cards, 4 columns, no action text
<NavCardGrid items={navItems} layout="grid-compact" />

// List layout - horizontal, full width
<NavCardGrid items={navItems} layout="list" />

// List 2-column - horizontal, 2 columns
<NavCardGrid items={navItems} layout="list-2col" />