Skip to main content

Entity Grid

A composable grid component for displaying entity collections. Uses compound components (EntityGrid.Header, EntityGrid.Content, EntityGrid.Empty, EntityGrid.Error, EntityGrid.Stats, EntityGrid.Filters) for flexible layouts. Supports EntityCard mode, ImageCard mode, or custom render functions. Two loading variants: skeleton or blurred overlay. Flexible ID handling with keyExtractor prop. Built-in SectionHeader and EnhancedEmptyState integration.

Installation

$ npx shadcn@latest add @orecus/entity-grid
Dependencies:
motionlucide-react
Registry:
@orecus/entity-card@orecus/image-card@orecus/header@orecus/enhanced-empty-state@orecus/use-reduced-motion@orecus/use-tilt-animation@orecus/enhanced-button@orecus/loading-overlaypopover

Component

Projects

Your active and completed projects
Project image
Active

Website Redesign

Progress65%
Complete overhaul of the company website
Project image
Active

Mobile App

Progress40%
Native iOS and Android application development
Project image
Completed

API Integration

Progress100%
RESTful API development for third-parties
Project image
Active

Dashboard Analytics

Progress25%
Real-time analytics dashboard
Project image
Active

Cloud Migration

Progress80%
Moving infrastructure to cloud-native architecture
Project image
Archived

Security Audit

Progress100%
Comprehensive security review and improvements
Project image
Active

Payment Gateway

Progress55%
Integration with multiple payment providers
Project image
Active

Email Automation

Progress30%
Automated email campaigns and notifications
Project image
Completed

Data Pipeline

Progress100%
ETL processes and data warehouse

Props

PropTypeDefaultDescription
data*T[] | undefinedArray of entities to display (extends BaseEntity). If undefined, automatically triggers loading state.
keyExtractor(item: T, index: number) => string | numberFunction to extract unique key from entity. Default: tries _id, id, key, then falls back to index
children*ReactNodeCompound components: EntityGrid.Header, EntityGrid.Content, EntityGrid.Empty, EntityGrid.Error
gridGridPreset | GridColumns'4-col'Grid columns config: preset ('2-col', '3-col', '4-col', '6-col') or custom breakpoint object
gap'sm' | 'md' | 'lg''md'Gap between grid items
loadingbooleanfalseShows loading state when true
loadingVariant'skeleton' | 'overlay''skeleton'Loading display: skeleton cards or blurred overlay with spinner
loadingCountnumber6Number of skeleton items to show when loading
errorError | nullError object if data fetching failed
classNamestringAdditional CSS classes for the container
stagger'none' | 'fade' | 'slide-up' | 'slide-down' | 'scale' | 'fade-slide''none'Stagger animation preset for grid items entering the view
staggerDelaynumber0.05Delay in seconds between each staggered item animation
gridVariant'standard' | 'bento''standard'Grid layout variant. 'bento' enables asymmetric layouts with col/row spans.
bentoLayoutBentoSpan[]Array of span configurations for bento grid. Each item defines colSpan and rowSpan (can be responsive objects). Pattern repeats for items beyond array length.
bentoColumnsnumber | GridColumns4Number of columns for bento grid. Can be a fixed number or responsive breakpoint object.
cardHeightnumber200Height in pixels for each grid row (used in gridAutoRows). Cards with rowSpan > 1 will be multiples of this height.

Compound Components

EntityGrid.Header

The header section of the grid.

PropTypeDefaultDescription
childrenReactNodeActions content
titlestringTitle text
descriptionstringDescription text

EntityGrid.Content

The main content area displaying the grid.

PropTypeDefaultDescription
cardMode'entity' | 'image'The rendering mode for cards
cardPropsobjectProps passed to the underlying card component
childrenfunctionCustom render function (mutually exclusive with cardMode)

EntityGrid.Empty

The empty state display.

PropTypeDefaultDescription
titlestringTitle for the empty state
descriptionstringDescription for the empty state
iconLucideIconIcon for the empty state

EntityGrid.Error

The error state display.

PropTypeDefaultDescription
childrenReactNodeCustom error content

EntityGrid.Stats

A section for displaying statistics.

PropTypeDefaultDescription
childrenReactNodeStat card components
classNamestringAdditional CSS classes

EntityGrid.Filters

A popover-based filter section.

PropTypeDefaultDescription
childrenReactNodeFilter content
triggerReactNodeCustom trigger element
openbooleanControlled open state
onOpenChange(open: boolean) => voidOpen state change handler