The DlCallout block component displays attention-grabbing information blocks such as notes, info messages, and warnings. It supports a customizable title, type-based styling, and seamless content page integration. Use this component whenever you want to emphasize important information within your content.
Features
- š§ clear, type-based variants:
info,note,warning,alert - š·ļø optional, customizable title with icon and Markdown formatting
- š§© theme-friendly visual adjustments
- ā ļø extensive error reporter
Usage
Use the ::dl-callout as a block component with your content provided in the default slot.
Result:
This is an informational message.
With a dedicated type
To change the appearance, set the type prop. Available values are:
info(default) - informational message,note- helpful note,warning- important / alarming notice,alert- critical / error message.
Currently there's no way to define a custom type.
To show a note type.
Result:
This is a helpful note.
To show a warning type.
Result:
Proceed with caution.
With a custom title
To provide a custom title, use the title prop.
Result:
Custom Title
You can customize the title to better describe the message.
Configuration
DlCallout uses sensible defaults and does not require global configuration. However, it integrates with your theme via dedicated CSS variables for borders and backgrounds, allowing you to keep styling consistent across the app.
Colors via CSS variables
The component binds its colors to the following CSS variables:
| Type | Border Variable | Background Variable | Text Variable |
|---|---|---|---|
note | --app-callout-note-border | --app-callout-note-bg | --app-callout-note-text |
info | --app-callout-info-border | --app-callout-info-bg | --app-callout-info-text |
warning | --app-callout-warning-border | --app-callout-warning-bg | --app-callout-warning-text |
alert | --app-callout-alert-border | --app-callout-alert-bg | --app-callout-alert-text |
Define or override them in your style.css file to match your desired effect. Bellow you can check the default values assigned to these variables.
Props
Here are the properties you can use with the DlCallout 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. |
type |
| 'info' | Controls the visual style and icon for the component. |
title | string | boolean | empty string | Custom title text. Pass |
Slots
| name | description |
|---|---|
default | Default slot for the callout content. |
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 DlCallout component globally. More about theming and styling with CSS variables, you can read here.
