diff --git a/app/components/demo/FeatureGridDemo.vue b/app/components/demo/FeatureGridDemo.vue new file mode 100644 index 0000000..7e81c16 --- /dev/null +++ b/app/components/demo/FeatureGridDemo.vue @@ -0,0 +1,73 @@ + + + + + + + + + diff --git a/app/registry/blocks/feature-grid/FeatureGrid.vue b/app/registry/blocks/feature-grid/FeatureGrid.vue new file mode 100644 index 0000000..6b7b973 --- /dev/null +++ b/app/registry/blocks/feature-grid/FeatureGrid.vue @@ -0,0 +1,146 @@ + + + + + + + + {{ headline }} + + + + {{ title }} + + + + {{ description }} + + + + + + + + + + + {{ item.title }} + + + + {{ item.description }} + + + + + + diff --git a/app/registry/blocks/feature-grid/index.ts b/app/registry/blocks/feature-grid/index.ts new file mode 100644 index 0000000..498b6e2 --- /dev/null +++ b/app/registry/blocks/feature-grid/index.ts @@ -0,0 +1 @@ +export { default as FeatureGrid, type FeatureGridItem, type FeatureGridProps } from "./FeatureGrid.vue"; diff --git a/content/docs/2.components/14.feature-grid.md b/content/docs/2.components/14.feature-grid.md new file mode 100644 index 0000000..ea1329a --- /dev/null +++ b/content/docs/2.components/14.feature-grid.md @@ -0,0 +1,125 @@ +--- +title: FeatureGrid +description: Render a complete feature section from app-owned feature data. +category: marketing +--- + +::component-preview +--- +name: FeatureGridDemo +--- +:: + +## Installation + +```bash +npx shadcn-vue@latest add "https://ui.stackhacker.io/r/feature-grid.json" +``` + +## Usage + +```vue + + + + + + + + + +``` + +## FeatureGrid vs FeatureCard + +`FeatureGrid` owns the full marketing section: optional headline, title, description, responsive grid layout, and repeated feature items. Use it when you want to install a complete section that can drop into a landing page, docs overview, or product page. + +`FeatureCard` remains the smaller card primitive for one-off feature, content, or navigation cards. Use it when your app already owns the surrounding section layout or when you need to compose custom grids by hand. + +## App-Owned Feature Data + +Your app owns the `items` array, route generation, analytics events, active states, CMS mapping, localization, and icon rendering. The component intentionally does not accept Nuxt Icon string names, require `NuxtLink`, or install an icon package. + +Pass icon markup through the scoped `icon` slot. That keeps the block portable across Lucide, Nuxt Icon, custom SVGs, or no icons at all. + +When an item has `href`, it renders as an anchor. When `href` is omitted, it renders static article content. For `target="_blank"`, the component adds `rel="noopener noreferrer"` unless you provide a custom `rel` value. + +## Examples + +### Default + +::component-preview +--- +name: FeatureGridDemo +--- +:: + +## API Reference + +### Props + +| Prop | Type | Default | Description | +|------|------|---------|-------------| +| `headline` | `string` | — | Optional eyebrow label shown above the section title. | +| `title` | `string` | — | Optional section title. | +| `description` | `string` | — | Optional section description. | +| `items` | `FeatureGridItem[]` | `[]` | Feature items supplied by your app. | +| `columns` | `2 \| 3 \| 4` | `3` | Responsive column count for large screens. | +| `class` | `string` | — | Additional CSS classes for the section. | + +### Types + +```ts +interface FeatureGridItem { + id?: string + title: string + description?: string + href?: string + target?: HTMLAnchorElement['target'] + rel?: string +} +``` + +### Slots + +| Slot | Props | Description | +|------|-------|-------------| +| `icon` | `{ item: FeatureGridItem }` | Optional icon markup rendered above each item title. | diff --git a/scripts/registry-verify.ts b/scripts/registry-verify.ts index a6529d1..6a47a3a 100644 --- a/scripts/registry-verify.ts +++ b/scripts/registry-verify.ts @@ -123,6 +123,10 @@ const expectedItems: Record = { dependencies: [], registryDependencies: [], }, + "feature-grid": { + dependencies: [], + registryDependencies: [], + }, "changelog-timeline": { dependencies: [], registryDependencies: [],
+ {{ headline }} +
+ {{ description }} +
+ {{ item.description }} +