Skip to main content

CardView

A responsive card grid that maps each data item to a renderCard output. Use inside DataViewContainer or standalone for a masonry/grid display.

πŸ“– Storybook

Preview​

Import​

import { CardView } from "@xocialive/ui-components";

Basic usage​

<CardView
data={projects}
renderCard={(project) => (
<GenericCard key={project.id} onClick={() => navigate(`/projects/${project.id}`)}>
<Typography variant="h6">{project.name}</Typography>
<Typography variant="body2">{project.description}</Typography>
</GenericCard>
)}
isLoading={isLoading}
columns={{ xs: 1, sm: 2, md: 3, lg: 4 }}
/>

Props​

PropTypeDefaultDescription
dataT[]β€”Card data array
renderCard(item: T) => ReactNodeβ€”Card renderer
isLoadingbooleanfalseShows skeleton cards during loading
skeletonCountnumber8Number of skeleton cards
columnsPartial<Record<Breakpoint, number>>{ xs: 1, sm: 2, md: 3 }Responsive column counts
sxSxProps<Theme>β€”Root grid style overrides