The DlHeading block component renders a section heading with an optional descriptive paragraph. It supports h1 or h2 levels and offers a spacing toggle for layout rhythm.
Features
- 🏷️ semantic headings (
h1,h2) - 📝 optional description under the title
- 🧩 theme-friendly visual adjustments
- 📐 optional extra top spacing for section separation
Usage
Use ::dl-heading as a block component with content through the title and description named slots. Choose the heading level as needed.
Result:
As h1 heading level
Having accessibility in mind you can decide which HTML heading level to use by setting the headingLevel prop. We assume that Hero components are usually h1 and section headings are h2 by default. U can use h3 as well.
Result:
With extra top spacing
Enable spaced to add extra top margin for improved section separation.
Result:
Props
Here are the properties you can use with the DlHeading 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.
| name | type | default | description |
|---|---|---|---|
lazy | boolean | undefined | Whether to lazy load the component. |
headingLevel | 'h1' | 'h2' | 'h3' | 'h2' | HTML heading level to render. |
spaced | boolean | string | false | Adds extra top spacing to the component. Accepts boolean or |
Slots
| name | description |
|---|---|
title | Heading content. Use plain text or Markdown. |
description | Optional paragraph under the title. |
ui | Dedicated slot for defining the component’s |
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.
CSS Variables
Here is a set of CSS variables you can use to customize the appearance of the DlHeading component globally. More about theming and styling with CSS variables, you can read here.
CSS Utilities
Below are the CSS utility classes used by the DlHeading component. They make use of the CSS variables described above and define the default styling for the component's markup elements.
