The m3e-callout component provides a visually distinct supporting container for contextual or
supplemental information. It can include an icon and label, and supports multiple appearance variants and
shapes.
import "@m3e/web/callout";
This section outlines usage examples and configuration guidance for the components in this module.
The m3e-callout component supports structured composition through named slots, enabling clear
organization of its visual elements:
(default) — Renders the main textual content of the callout. This is typically descriptive or
supplemental information.
icon — Renders the leading icon used to visually identify the callout's purpose or category.
label — Renders the callout's heading. Commonly used for short titles or summaries that
introduce the content.
<m3e-callout> <!-- Content omitted for brevity --> </m3e-callout> <m3e-callout> <span slot="label">Lorem ipsum dolor sit amet</span> <!-- Context omitted for brevity --> </m3e-callout> <m3e-callout> <m3e-icon slot="icon" name="info"></m3e-icon> <span slot="label">Lorem ipsum dolor sit amet</span> <!-- Context omitted for brevity --> </m3e-callout>
There are five callout appearance variants for presenting contextual information, allowing callouts to convey
different levels of emphasis. Use the variant attribute to change the appearance.
secondary (default) — Offers balanced visual emphasis suitable for general informational
content. Secondary tones are supportive and neutral, making them appropriate for most callout use cases.
primary — Provides stronger emphasis and is best used when highlighting information of higher
importance. Primary tones carry brand weight and should be used selectively.
tertiary — Offers an alternative emphasis that can be used for category-specific or
complementary information. Visually distinct from both primary and secondary while remaining non-critical.
error — Reserved for critical or blocking information. Uses error container tones to maintain
readability while signaling urgency. Intended only for failures, destructive actions, or issues requiring
immediate attention.
surface — Provides a neutral presentation aligned with the surrounding layout. Useful when the
callout should blend more subtly into the page while still offering structural clarity.
<m3e-callout variant="primary"> <m3e-icon slot="icon" name="info"></m3e-icon> <span slot="label">Lorem ipsum dolor sit amet</span> <!-- Content omitted for brevity --> </m3e-callout> <!-- Additional variants omitted for brevity -->
Callouts can come in two shapes: rounded (default) or square. Use the
shape attribute to control the shape of a callout.
<m3e-callout shape="square"> <!-- Content omitted for brevity --> </m3e-callout>
The m3e-callout component uses an internal <aside> element to represent
supplementary or contextual information. Assistive technologies announce the callout as a complementary region
and read its contents in natural order.
The error variant does not use role="alert". Callouts are static, non-interruptive
supplementary content and are not treated as live region alerts, even when presenting critical information.
The @m3e/web package uses
JavaScript Modules. To use it directly in a browser without a bundler, use a module script similar to the following.
<script type="module" src="/node_modules/@m3e/web/dist/callout.js"></script>
In addition, you must use an import map to include dependencies.
<script type="importmap">
{
"imports": {
"tslib": "https://cdn.jsdelivr.net/npm/tslib@2.8.1/+esm",
"lit": "https://cdn.jsdelivr.net/npm/lit@3.3.0/+esm",
"lit/": "https://cdn.jsdelivr.net/npm/lit@3.3.0/",
"lit-html": "https://cdn.jsdelivr.net/npm/lit-html@3.3.0/+esm",
"lit-html/directive.js": "https://cdn.jsdelivr.net/npm/lit-html@3.3.0/directive.js",
"@lit/reactive-element": "https://cdn.jsdelivr.net/npm/@lit/reactive-element@2.0.4/+esm",
"@lit/reactive-element/": "https://cdn.jsdelivr.net/npm/@lit/reactive-element@2.0.4/",
"@m3e/web/core": "/node_modules/@m3e/web/dist/core.js"
}
}
</script>
For production builds, use the minified files to ensure optimal load performance.
The @m3e/web package includes a
Custom Elements Manifest
(custom-elements.json), which documents the properties, attributes, slots, events and CSS custom
properties of each component.
You can explore the API below, or integrate the manifest into your own tooling.