CardGrid
Loading example…
Equal cards that stack under 720 px of page container width.
Import
Section titled “Import”import { CardGrid } from "@jcsoftdev/ui/containers";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/containers/dashboard.
export const Default: Story = { render: () => ( <DashboardPage> <KpiRow aria-label="Cifras clave"> <Kpi label="Matrícula" value="1 240" description="+32 este mes" /> <Kpi label="Recaudación" value="86%" description="Meta 90%" /> <Kpi label="Morosidad" value="S/ 18 400" description="42 familias" /> <Kpi label="Asistencia" value="94%" description="Últimos 30 días" /> </KpiRow> <CardGrid columns={2}> <ChartCard title="Recaudación" subtitle="Miles de soles por mes" height={260}> <Collected /> </ChartCard> <ChartCard title="Recaudación (mes)" aside={<Chip tone="success">+8%</Chip>} height={260}> <Collected /> </ChartCard> </CardGrid> <TableCard title="Últimos pagos" subtitle="Hoy"> <Table> <TableHead> <TableRow> <TableHeaderCell>Familia</TableHeaderCell> <TableHeaderCell alignRight>Monto</TableHeaderCell> </TableRow> </TableHead> <TableBody> <TableRow> <TableCell>Quispe</TableCell> <TableCell alignRight>S/ 450</TableCell> </TableRow> <TableRow> <TableCell>Huamán</TableCell> <TableCell alignRight>S/ 380</TableCell> </TableRow> </TableBody> </Table> </TableCard> </DashboardPage> ),};Source of the Storybook story.
| Prop | Type | Default | Description |
|---|---|---|---|
columns |
2 | 3 |
2 |
Columns at the widest container: 2 (from 720 px) or 3 (2 from 720 px, 3 from 1180 px). Default 2. |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/containers/dashboard/dashboard.tsx