Slide Group for M3E
npm install @m3e/slide-groupm3e-slide-group component presents directional pagination controls for navigating overflowing content. It orchestrates scrollable layouts with expressive slot-based icons and adaptive orientation, revealing navigation affordances only when content exceeds a defined threshold. It supports both horizontal and vertical flows, and encodes accessibility through customizable labels and interaction states.
bash
npm install @m3e/slide-group
`
๐ป Editor Integration
This package includes a Custom Elements Manifest to support enhanced editor tooling and developer experience.
$3
To enable autocomplete and hover documentation for @m3e/slide-group, install the Custom Elements Manifest Language Server extension. It will automatically detect the manifest bundled with this package and surface tag names, attributes, slots, and events in supported files.
Alternately, you can explicitly reference the html-custom-data.json and css-custom-data.json in your workspace settings:
`json
{
"html.customData": ["./node_modules/@m3e/slide-group/dist/html-custom-data.json"],
"css.customData": ["./node_modules/@m3e/slide-group/dist/css-custom-data.json"]
}
`
๐ Native Module Support
This package uses JavaScript Modules. To use it directly in a browser without a bundler, use a module script similar to the following.
`html
`
You also need a module script for @m3e/icon-button due to it being a dependency.
`html
`
In addition, you must use an import map to include dependencies.
`html
`
> For production, use index.min.js and bidi.min.js for faster load times.
๐๏ธ Elements
- m3e-slide-group โ Presents pagination controls used to scroll overflowing content.
๐งช Examples
- The following example illustrates a horizontally scrollable group of items with directional pagination buttons.
The scroll controls appear when content exceeds the 48px threshold.
`html
Item 1
Item 2
Item 3
Item 4
Item 5
`
๐ API Reference
This section details the attributes, slots and CSS custom properties available for the m3e-slide-group component.
$3
| Attribute | Type | Default | Description |
| --------------------- | --------- | ----------------- | -------------------------------------------------------------------------------------------------- |
| disabled | boolean | false | Whether scroll buttons are disabled. |
| next-page-label | string | "Next page" | The accessible label given to the button used to move to the previous page. |
| previous-page-label | string | "Previous page" | The accessible label given to the button used to move to the next page. |
| threshold | number | 0 | A value, in pixels, indicating the scroll threshold at which to begin showing pagination controls. |
| vertical | boolean | false | Whether content is oriented vertically. |
#### ๐งฉ Slots
| Slot | Description |
| ----------- | ---------------------------------------------------- |
| _(default)_ | Renders the content to paginate. |
| next-icon | Renders the icon to present for the next button. |
| prev-icon | Renders the icon to present for the previous button. |
$3
| Property | Description |
| ------------------------------------ | ----------------------------------------------------------------------------- |
| --m3e-slide-group-button-icon-size | Sets icon size for scroll buttons; overrides default small icon size. |
| --m3e-slide-group-button-size | Defines scroll button size; used for width (horizontal) or height (vertical). |
| --m3e-slide-group-divider-top | Adds top border to content container for visual separation. |
| --m3e-slide-group-divider-bottom | Adds bottom border to content container for visual separation. |
๐ค Contributing
See the root monorepo CONTRIBUTING.md` for guidelines on contributing to this package.