The m3e-slide-group component presents directional pagination controls for navigating overflowing
content.
npm i @m3e/slide-group
This section outlines usage examples and configuration guidance for the components in this package.
To use the m3e-slide-group, simply nest content inside it. When content overflows, directional
pagination buttons will appear allowing the user to click to scroll its content.
<m3e-slide-group> <div>Item 1</div> <!-- Additional items omitted for brevity --> </m3e-slide-group>
By default, scroll groups are oriented horizontally. Use the vertical attribute to create a
vertically oriented scroll group.
<m3e-slide-group vertical> <div>Item 1</div> <!-- Additional items omitted for brevity --> </m3e-slide-group>
Scroll groups are not given an ARIA role, indicating that they are treated as neutral, non-semantic elements in the accessibility tree unless explicitly referenced or annotated.
Pagination buttons are intentionally excluded from the tab order and strong focus indicators are not supported. This reduces focus noise and streamlines keyboard navigation.
Use the previous-page-label and next-page-label attributes to provide accessible
labels to pagination buttons.
This 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/slide-group/dist/index.js"></script>
You also need a module script for @m3e/icon-button due to being a dependency.
<script type="module" src="/node_modules/@m3e/icon-button/dist/index.js"></script>
In addition, you must use an import map to include additional dependencies.
<script type="importmap">
{
"imports": {
"lit": "https://cdn.jsdelivr.net/npm/lit@3.3.0/+esm",
"@m3e/core": "/node_modules/@m3e/core/dist/index.js",
"@m3e/core/a11y": "/node_modules/@m3e/core/dist/a11y.js"
}
}
</script>
For production, use index.min.js and a11y.min.js for faster load times.
This 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.