Slider

A dependency-free, container-aware scroll-snap slider with native touch scrolling, keyboard navigation, autoplay, accessible controls, and component-local Design Center controls.

Using the slider item component

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Read more

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Read more

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Single slide

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Native scroll slider

Uses native scrolling and scroll snapping. The slider stops at the first and last slide rather than cloning slides for an infinite loop.

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Autoplay slider

Advances every five seconds. Use the Pause button to stop movement; it becomes Play when paused.

First story

This slider advances every five seconds until you pause it.

Second story

The accessible control can pause and resume autoplay with a mouse, touch or keyboard.

Third story

Autoplay pauses while this slider or one of its controls has focus.

Button styling

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Base Layout

Here I could put some lorem ipsum text but I am too lazy to Google for one so I wrote all this instead. Woo!

Responsive columns

The maximum is four cards per page. CSS container queries set one, two, three or four columns based on the slider's own width, so a slider in a narrow column adapts independently of the viewport. This example uses slideByPage, so each control moves every visible card at once.

Compact navigation with a next-slide peek

This example is deliberately constrained to a 32 rem container, so the next-card peek is visible here too. Below a 640 px slider container, the arrows move below the content for 44 px touch targets. When a title is supplied, the arrows instead share its row.

Slider with Segment

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

API

Parameter Default Type Description
true integer|boolean|null -
false boolean -
true boolean -
16:9 string -
true boolean -
slide string -
false boolean -
true boolean -
false string|boolean -
false string|boolean -
false string|boolean -
[] array -
0 integer -
2 integer -
1 integer -
false boolean -
true boolean -

Subcomponents

Child components for slider, including purpose and supported Blade parameters.

Slider Item

Blade directive: @slider__item()

-

Parameter Default Type Purpose
string|boolean -
string|boolean -
[] array|boolean -
false ComponentLibrary\Integrations\Image\ImageInterface|string|boolean -
false string|boolean -
?string -
false string|boolean -
string -
bottom string -
base string -
string -
false string|boolean -
string -
none string -
Illuminate\Support\HtmlString|Illuminate\View\ComponentSlot|string|null -
false string|boolean -
[] array Additional CSS classes added to the wrapping element.
[] array Additional HTML attributes added to the wrapping element.

CSS API

Variable Default Type Values Description
var(--base) range - Main unit that drives radius and spacing scales.
var(--space) range - Base spacing unit. Used for padding and margin inside components.
var(--border-radius) range - Border Radius
var(--color--primary) color - Controls the navigation icon color.
var(--color--alpha) rgba - Controls the overlay tone for content slides.
var(--font-family-heading) font - Falls back to body font if not set.
var(--font-family-base) font - Body Font
var(--font-size-100) range - Base font size.
var(--color--alpha-contrast) color - Used for text and icons on alpha overlays.
var(--shadow-color) rgba - Shadow Color
var(--shadow-amount) range - Multiplier for elevation shadows. 0 = none, 1 = default.
var(--color--surface) color - Controls the circular surface behind the play/pause icon.
var(--duration-100) range - For the most immediate feedback, such as a small selected-state change.
var(--duration-180) range - Default duration for nearby layers and component state changes.
2 range - Space between slides, measured in base units. A slider instance can override this through its gap parameter.
0 range - Horizontal inset inside the scroll track, measured in base units. A slider instance can override this through its padding parameter.
1.5 range - Vertical room reserved around cards so their shadows remain visible, measured in base units.
6 range - Visible width of the next card on compact sliders, measured in base units.
3 range - Width of the soft fade at the viewport edge, measured in base units.
75 range - Maximum readable line length for the slider preamble.
118 range - Maximum width of centered slide content, measured in base units.
70 range - Minimum height for card-layout segments inside a slider, measured in base units.
4 range - Space between title content and its navigation controls, measured in base units.
1 range - Space between title and preamble rows, measured in base units.
2 range - Space below the title area and above the slider track, measured in base units.
-1.5 range - Offset for floating navigation controls, measured in base units.
2.5 range - Inset for floating navigation controls in larger containers, measured in base units.
5 range - Size of the play/pause control, measured in base units.
1.5 range - Inset for the play/pause control, measured in base units.
100 range - Duration of the visibility fade used by ordinary slides.
180 range - Duration of the edge-fade handoff when the final slide is reached.
180 range - Duration of the play/pause control reveal.
0.8 range - Controls the opacity of the slide content overlay.