Slider
The Slider component provides a reusable pattern for slider in the interface.
Using the slider item component
Single slide
Repeat slide
Button styling
Slider with Cards
Slider with Segment
API
| Parameter | Default | Description |
|---|---|---|
|
autoSlide
|
true | If set to true, slider will auto slide with default delay. Can also receive an int to set delay in seconds |
|
peekSlides
|
false | Adds some padding to show a peek of next and previous slides |
|
navigationHover
|
true | Only show navigation when hovering over the slider |
|
ratio
|
16:9 | The size ratio of the slider |
|
repeatSlide
|
true | Will allow the slide to repeat its cycle |
|
type
|
slide | - |
|
heroStyle
|
false | - |
|
shadow
|
true | - |
|
customButtons
|
false | False will use default buttons, otherwise pass a string of the value of data-js-slider-buttons |
|
arrowButtons
|
[] | - |
|
padding
|
0 | Sets the amount of padding between slides |
|
gap
|
2 | Sets the amount of gap between slides |
Subcomponents
Slider Item
A title for predefined layout
| Parameter | Default | Type | Purpose |
|---|---|---|---|
|
title
|
string|boolean | A title for predefined layout | |
|
text
|
string|boolean | A text for predefined layout | |
|
cta
|
[] | array|boolean | Adds button with a link, should conform with the button component specification (title, href) |
|
image
|
false | boolean|string|ImageInterface | An url or path to an image to use as background for the segment |
|
video
|
false | boolean|string | A video background for the segment |
|
alt
|
string | Alternative text | |
|
link
|
false | string|boolean | Where the slide should link to |
|
linkDescription
|
string | A description of the link | |
|
layout
|
bottom | string | Which layouts to use |
|
theme
|
base | string | The color palette to be used |
|
containerColor
|
string | Determines what color the container and text should be | |
|
heroStyle
|
false | string | Gives the slide a hero like appearance with larger text |
|
textAlignment
|
string | Aligns the text in the container | |
|
overlay
|
none | string | Adds an overlay to the image |
|
slot
|
false | boolean|string | A slot for custom content, placed above the predefined layout |
|
bottom
|
false | boolean|string | A slot for custom content, placed below the predefined layout |
|
classList
|
[] | array | Additional CSS classes added to the wrapping element. |
|
attributeList
|
[] | array | Additional HTML attributes added to the wrapping element. |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-slider--base
|
var(--base) | range | - | Main unit that drives radius and spacing scales. |
|
--c-slider--space
|
var(--space) | range | - | Base spacing unit. Used for padding and margin inside components. |
|
--c-slider--border-radius
|
var(--border-radius) | range | - | Border Radius |
|
--c-slider--color--primary
|
var(--color--primary) | color | - | Primary |
|
--c-slider--color--alpha
|
var(--color--alpha) | rgba | - | Used for overlays. Includes opacity — set both color and alpha together. |
|
--c-slider--font-family-heading
|
var(--font-family-heading) | font | - | Falls back to body font if not set. |
|
--c-slider--font-family-base
|
var(--font-family-base) | font | - | Body Font |
|
--c-slider--font-size-100
|
var(--font-size-100) | range | - | Base font size. |
|
--c-slider--color--alpha-contrast
|
var(--color--alpha-contrast) | color | - | Used for text and icons on alpha overlays. |
|
--c-slider--shadow-color
|
var(--shadow-color) | rgba | - | Shadow Color |
|
--c-slider--shadow-amount
|
var(--shadow-amount) | range | - | Multiplier for elevation shadows. 0 = none, 1 = default. |