Carousel
The Carousel examples of the Motion library, rebuilt in Composite: the same trigger, in steps, with the system's own parts.
the category
motion/_rebuilds- rebuilds
- 13
- from motion+
- 13
- easing
- steps() only
motion / carousel / carousel
after a motion+ example- Motion
- animate, a drag
- here
- a cut a slide
- trigger
- swipe 32 px, or an arrow key
- in view
- two slides
- original
- Carousel
A swipe of 32 px or more, or an arrow key, cuts the rail one whole slide. Nothing slides between two places.
motion / carousel / carousel: autoplay
after a motion+ example- Motion
- animate, a timer
- here
- every(), 10 frames
- a frame
- 200 ms, a cell of the line
- pause
- hover, focus, or the button
- original
- Carousel: Autoplay
A line fills one cell every 200 ms; when it is full, the deck cuts to the next slide and the line starts again. Hover, focus or the button stops it; reduced motion starts it stopped.
motion / carousel / carousel: coverflow
after a motion+ example- Motion
- a 3D tilt, a spring
- here
- Retro 3D, a cut a slide
- the sides
- turned 60°, a grey darker
- trigger
- swipe, press, arrows
- original
- Carousel: Coverflow
The slide in front faces the viewer, and the slides at its sides stand turned 60° in perspective, each one grey darker on the ladder. A swipe, a press or an arrow cuts the next slide to the front.
motion / carousel / carousel: free scroll
after a motion+ example- Motion
- none, native scroll
- here
- native scroll, no snap
- stops
- where you let go
- meter
- 16 cells
- original
- Carousel: Free scroll
The browser scrolls the slides and keeps no snap point. A 16-cell line follows the scroll, a cell at a time.
motion / carousel / carousel: lightbox
after a motion+ example- Motion
- AnimatePresence, animate
- here
- a cut
- open
- press a slide
- inside
- arrows, arrow keys, close
- original
- Carousel: Lightbox
A slide opens full size in a Dialog in one cut, and its neighbours are one arrow away. Each slide cuts to the next with no move between.
motion / carousel / carousel: loop
after a motion+ example- Motion
- none, a repeated rail
- here
- a turning rail, a cut a slide
- past the last
- the first
- in view
- three slides
- original
- Carousel: Loop
The slides turn round the window, so the first is always at the start and the rail has no end. Each step is one cut.
motion / carousel / carousel: pagination
after a motion+ example- Motion
- whileHover, whileTap
- here
- the State set
- at an end
- that arrow is disabled
- step
- one slide a cut
- original
- Carousel: Pagination
Two arrow buttons cut the deck one slide; each shows the State set, and the one at an end is disabled.
motion / carousel / carousel: pagination with page count
after a motion+ example- Motion
- whileHover, whileTap
- here
- the State set
- count
- 02 / 05, cut with the slide
- at an end
- that arrow is disabled
A count sits between the arrows and cuts with the slide: no number counts up between two pages.
motion / carousel / carousel: scaling pagination dots
after a motion+ example- Motion
- layoutId, animate
- here
- a cut
- current
- a long bar, in bone
- the rest
- small grey squares
The current dot is a long bone bar and the others are small grey squares. A press cuts to a slide, and the bar cuts with it; it does not grow.
motion / carousel / carousel: progress scrubber
after a motion+ example- Motion
- useMotionValue, a drag
- here
- native scroll, 16 cells
- scroll
- moves the line
- drag the line
- scrolls the slides
- original
- Carousel: Progress scrubber
The scroll fills a 16-cell line. The line is a slider: a press or drag on it, or an arrow key, sets the scroll in whole cells.
motion / carousel / carousel: rtl
after a motion+ example- Motion
- animate
- here
- dir=rtl, a cut a slide
- slide one
- at the right
- next
- to the left
- original
- Carousel: RTL
The deck reads right to left: slide one is at the right, a swipe to the right and the left arrow key go to the next slide, and the arrows point the other way.
motion / carousel / carousel: thumbnail gallery
after a motion+ example- Motion
- animate, whileHover
- here
- a cut
- large
- one slide in full
- thumbnails
- a row, the current in bone
- original
- Carousel: Thumbnail gallery
A press on a thumbnail cuts the large slide to it, and its frame turns bone. No slide travels between the two.
motion / carousel / carousel: vertical
after a motion+ example- Motion
- animate, whileHover
- here
- a cut a slide, on the y axis
- trigger
- swipe up or down, or the arrows
- in view
- two slides
- original
- Carousel: Vertical
The same deck turned on its side: a swipe up or down, an arrow key or a button cuts one slide.