The m3e-divider component visually separates content within layouts, lists, or containers using a
thin, unobtrusive line.
import "@m3e/web/divider";
This section outlines usage examples and configuration guidance for the components in this package.
The following example illustrates use of the m3e-divider to provide separators between items in a
m3e-list. For more information on lists, see List.
<m3e-list> <m3e-list-item>Item 1</m3e-list-item> <m3e-divider></m3e-divider> <m3e-list-item>Item 2</m3e-list-item> <m3e-divider></m3e-divider> <m3e-list-item>Item 3</m3e-list-item> </m3e-list>
A m3e-divider can be used on its own to create a horizontal (or vertical) line.
Use the inset attribute to control whether the divider is inset. Alternately, use
inset-start and inset-end to control the start or end inset.
<m3e-divider></m3e-divider> <m3e-divider inset></m3e-divider> <m3e-divider inset-start></m3e-divider> <m3e-divider inset-end></m3e-divider>
Use the vertical attribute to control whether a divider is oriented vertically.
<m3e-divider vertical></m3e-divider> <m3e-divider vertical inset></m3e-divider> <m3e-divider vertical inset-start></m3e-divider> <m3e-divider vertical inset-end></m3e-divider>
The m3e-divider applies the ARIA role="separator", implementing a non-focusable
separator used to separate content.
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/divider.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-html/directives/if-defined.js": "https://cdn.jsdelivr.net/npm/lit-html@3.3.0/directives/if-defined.js",
"lit-html/directives/class-map.js": "https://cdn.jsdelivr.net/npm/lit-html@3.3.0/directives/class-map.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.