Kpi Grid
kpi-griduiBare responsive grid wrapper (2 / 3 / 4 columns). Pass any children — Cards, inline charts, custom tiles. No items prop, no item rendering.
Installation
$pnpm dlx shadcn-svelte@latest add https://uipkge.dev/r/svelte/kpi-grid.json$npx shadcn-svelte@latest add https://uipkge.dev/r/svelte/kpi-grid.json$yarn dlx shadcn-svelte@latest add https://uipkge.dev/r/svelte/kpi-grid.json$bunx shadcn-svelte@latest add https://uipkge.dev/r/svelte/kpi-grid.jsonManifest:
https://uipkge.dev/r/svelte/kpi-grid.jsonInstalls to:src/lib/components/ui/kpi-grid/Variants
Loading interactive previews…
Loading interactive previews…
Examples in Use
Full BlockExecutive metrics grid combining KPI cards, sparkline micro-charts, trend indicators, and responsive grid geometry.
Props
| Name | Type / Values | Default | Required |
|---|---|---|---|
columns | 2 | 3 | 4 | 4 | optional |
children | Snippet | — | optional |
ref | HTMLDivElement | null | — | optional |
Used by
Files installed (2)
src/lib/components/ui/kpi-grid/KpiGrid.svelte0.7 kB
<script lang="ts" module> import type { Snippet } from 'svelte' import type { HTMLAttributes } from 'svelte/elements' export interface KpiGridProps extends HTMLAttributes<HTMLDivElement> { columns?: 2 | 3 | 4 children?: Snippet ref?: HTMLDivElement | null } </script> <script lang="ts"> import { cn } from '$lib/utils' let { class: className, columns = 4, children, ref = $bindable(null), ...restProps }: KpiGridProps = $props() </script> <div bind:this={ref} data-uipkge="" data-slot="kpi-grid" class={cn( 'grid gap-4 md:grid-cols-2', columns === 3 ? 'lg:grid-cols-3' : columns === 2 ? 'lg:grid-cols-2' : 'lg:grid-cols-4', className, )} {...restProps} > {@render children?.()} </div>src/lib/components/ui/kpi-grid/index.ts0.1 kB
export { default as KpiGrid, type KpiGridProps } from './KpiGrid.svelte'
Raw manifest:https://uipkge.dev/r/svelte/kpi-grid.json