diff --git a/app/components/demo/MetricsGridDemo.vue b/app/components/demo/MetricsGridDemo.vue new file mode 100644 index 0000000..a8ca70e --- /dev/null +++ b/app/components/demo/MetricsGridDemo.vue @@ -0,0 +1,47 @@ + + + diff --git a/app/registry/blocks/metrics-grid/MetricsGrid.vue b/app/registry/blocks/metrics-grid/MetricsGrid.vue new file mode 100644 index 0000000..b97844f --- /dev/null +++ b/app/registry/blocks/metrics-grid/MetricsGrid.vue @@ -0,0 +1,137 @@ + + + diff --git a/app/registry/blocks/metrics-grid/index.ts b/app/registry/blocks/metrics-grid/index.ts new file mode 100644 index 0000000..089cc80 --- /dev/null +++ b/app/registry/blocks/metrics-grid/index.ts @@ -0,0 +1 @@ +export { default as MetricsGrid, type MetricsGridItem, type MetricsGridProps } from "./MetricsGrid.vue"; diff --git a/content/docs/2.components/13.metrics-grid.md b/content/docs/2.components/13.metrics-grid.md new file mode 100644 index 0000000..9a8ebcc --- /dev/null +++ b/content/docs/2.components/13.metrics-grid.md @@ -0,0 +1,97 @@ +--- +title: MetricsGrid +description: Render a responsive marketing metrics section from app-owned data. +category: marketing +--- + +::component-preview +--- +name: MetricsGridDemo +--- +:: + +## Installation + +```bash +npx shadcn-vue@latest add "https://ui.stackhacker.io/r/metrics-grid.json" +``` + +## Usage + +```vue + + + +``` + +## App-Owned Metrics + +`MetricsGrid` renders the values you pass in. Your app owns data loading, number formatting, localization, analytics, animation, and any metric definitions. + +Pass formatted strings such as `42%`, `< 90s`, or `12k+` through `items[].value`. Use `tone` for constrained visual emphasis instead of passing raw Tailwind classes through metric data. + +## Examples + +### Cards + +::component-preview +--- +name: MetricsGridDemo +--- +:: + +## API Reference + +### Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `headline` | `string` | — | Optional eyebrow shown above the title. | +| `title` | `string` | — | Optional section title. | +| `description` | `string` | — | Optional supporting section copy. | +| `items` | `MetricsGridItem[] \| null` | `[]` | Metrics supplied by your app. | +| `columns` | `2 \| 3 \| 4` | `4` | Maximum column count on large screens. | +| `variant` | `'default' \| 'cards'` | `'default'` | Visual treatment for metric cards. | +| `class` | `string` | — | Additional CSS classes for the section. | + +### Types + +```ts +interface MetricsGridItem { + id?: string + value: string + label: string + description?: string + tone?: 'default' | 'primary' | 'success' | 'warning' | 'muted' +} +``` diff --git a/scripts/registry-verify.ts b/scripts/registry-verify.ts index 5e5119f..7c60338 100644 --- a/scripts/registry-verify.ts +++ b/scripts/registry-verify.ts @@ -127,6 +127,10 @@ const expectedItems: Record = { dependencies: [], registryDependencies: [], }, + "metrics-grid": { + dependencies: [], + registryDependencies: [], + }, }; if (registryIndex) {