DlFeaturesGrid

Render a responsive features grid with animated and formatted tiles

The DlFeaturesGrid block component renders a responsive grid of feature tiles using named slots. The tiles sit in DlGrid. Each tile is defined in a slot and parsed for its position, title, description, icon, and optional link, then animated into view.

Features

  • 🧩 grid-based, responsive layout
  • 🪄 animated reveal with staggered timing
  • 🏷️ tiles defined via named slots with structured content
  • 🖼️ icon support per tile
  • 🔗 optional per-tile navigation
  • 🧩 theme-friendly visual adjustments
  • ⚠️ extensive error reporter

Usage

Use ::dl-features-grid as a block component to define tiles using named slots. Each slot name is #item-{n} plus the same position suffix as DlGrid. The slot body uses section markers for title, description, icon, and an optional link.

Slot content formatting

The component parses each tile’s slot content using a simple marker syntax - {marker}...{/marker}. Here are the available markers:

markerrequireddescription
title
✔

Tile title.

description
✔

Tile description. Inline formatting via strong, italic, code, and line breaks with br. Use /tag/text/tag/ (for example: /strong/text/strong/).

icon
✔

Icon name (for example: lucide:apple).

link
✗

Optional. A /path, a $path-marker, or $path-marker|hash. Clicking the tile navigates there. More about path markers, you can read here.

Since Vue's useSlots has an internal mechanism that escapes special characters, we've provided dedicated markers (e.g., /strong/) to allow you to introduce special formatting into the tiles' content.

More about available icon sets you can read here.

::dl-features-grid#item-1|1-5{title}Getting Started{/title}{description}Begin with /i/the basics/i/ and set up your /code/environment/code/. /br/ Move fast with sane defaults.{/description}{icon}vscode-icons:file-type-nuxt{/icon}{link}$docs-getting-started{/link}#item-2|5-9{title}Configuration{/title}{description}Tune the system for your needs with /strong/clear options/strong/.{/description}{icon}vscode-icons:file-type-yaml{/icon}::

Result:

Positioning

Position uses the same grid lines as DlGrid. Two numbers after the slot name are the column range. Four numbers add the row range: #item-1|1-5 or #item-1|1-5-1-2. Lines run from 1 through 13, and the end line must be greater than the start line.

Props

Here are the properties you can use with the DlFeaturesGrid component. Each property should be set on an individual component instance; they do not affect the global configuration. More about defining properties in MDC components you can read here.

nametypedefaultdescription
lazybooleanundefined

Whether to lazy load the component.

gridCols'lg:grid-cols-${number}''lg:grid-cols-8'

Grid columns at large breakpoints. Mobile alignment will be set automatically.

gridRows'lg:grid-rows-${number}''lg:grid-rows-1'

Grid rows at large breakpoints. Mobile alignment will be set automatically.

animatedBorderbooleantrue

Whether to animate the tile overlay on hover.

Slots

namedescription
#item-{n}|{c-c}-{r-r}?

One tile. Add a position suffix for columns or columns and rows. Body contains {title}, {description}, {icon}, and optional {link}. More about Grid positioning, you can read here.

ui

Dedicated slot for defining the component’s ui object. More about styling MDC components you can read here.

Styling

Styling from Markdown

Every DocLayer component can be styled directly within your Markdown file using dedicated slot/property configuration. This allows you to customize the appearance of the component's markup elements without modifying global styles. More about components styling you can read here.

Below you'll find the default set of Tailwind classes for the component's dedicated markup elements.

<script lang="ts">const ui = defineDoclayerComponentUi({  base: ['u-space-mb'],  tile: [    'uc-features-grid-tile-shadow',    'u-space-p',    'u-border-color',    'u-border-radius',    'border',    'relative',    'w-full',    'h-full',    'opacity-0',    'z-1',    'translate-y-[5rem]',    'transition-all',    'duration-1000',    'ease-in-out',  ],  title: ['u-text-color-secondary', 'u-font-weight-black', 'm-0!', 'text-lg!'],  icon: ['absolute', 'top-4', 'left-4', 'w-12', 'h-12', 'rotate-10', 'opacity-5', 'dark:opacity-8', 'grayscale-100'],  iconvsc: ['w-16', 'h-16', 'top-2!', 'opacity-12', 'dark:opacity-10'],  paragraph: ['break-normal', 'text-sm'],});</script>

CSS Variables

Here is a set of CSS variables you can use to customize the appearance of the DlFeaturesGrid component globally. More about theming and styling with CSS variables, you can read here.

@theme {  --app-features-grid-tile-hover-overlay: linear-gradient(    90deg,    var(--app-color-01),    var(--app-color-02),    var(--app-color-03),    var(--app-color-04)  );  --app-features-grid-tile-hover-box-shadow: 0 0 15px 2px var(--app-primary-doomed-light);  --app-features-grid-tile-overlay-bg-size: 300% 300%;  --app-features-grid-tile-background: light-dark(var(--app-primary-doomed-light), var(--app-primary-doomed-dark));  --app-features-grid-tile-dots-color: light-dark(var(--color-gray-100), var(--color-gray-900));}

CSS Utilities

Below are the CSS utility classes used by the DlFeaturesGrid component. They make use of the CSS variables described above and define the default styling for the component's markup elements.

/* FeaturesGrid tile hover shadow */@utility uc-features-grid-tile-shadow {  @apply shadow-(--app-features-grid-tile-box-shadow) transition-shadow duration-300;}/* FeaturesGrid tile dots and shade background pattern. */@utility uc-features-grid-tile-background {  /* instead of TW classes, pure CSS notation is used for better readability */  background:    linear-gradient(to left bottom, var(--app-features-grid-tile-bg), transparent 20rem),    radial-gradient(var(--app-features-grid-tile-dots-color) 0.05rem, transparent 0.1rem) 0 0 / 0.5rem 0.5rem;  @apply u-border-radius bg-(--ui-bg) absolute top-0 left-0 w-full h-full -z-1;}/* Feature Grid tile hover overlay - animated, gradient border effect */@utility uc-features-grid-tile-overlay {  /* pixes were used for better precision and */  @apply w-[calc(100%+2px)] h-[calc(100%+2px)] -top-[1px] -left-[1px]         u-border-radius absolute -z-2 transition-[background-image] duration-300;  @apply bg-(image:--app-features-grid-tile-overlay-bg);}@utility uc-features-grid-tile-hover-overlay {  @apply bg-(image:--app-features-grid-tile-overlay-bg-hover)         bg-(size:--app-features-grid-tile-overlay-bg-size)         bg-no-repeat;}