component

Slideshow

A full carousel component with arrows, dragging and dots control.

You can change the width of the slideshow by changing the --slideshow-max-width value. The slideshow height property is controlled by JavaScript. When it loads, the --slideshow-height variable is set to the active slideshow image height. This property is also use for other calculations like the top porperty of the arrows controls.

Basic usage

  • The default --slideshow-max-width variable is set to 780px:
  • If you need to show some ebooks, you can use the is-ebook-previewer modiffier on the slideshow main container. The --slideshow-max-width variable will be set to 340px:
  • You can combine it with captions:
  • Lorem ipsum dolor sit amet consectetur adipisicing elit

  • Incidunt voluptas quia error quibusdam nulla, provident, voluptate maxime amet, aut illo velit commodi!

  • Cumque neque consequuntur voluptate facere nulla doloremque rerum.

  • You can set it up to full width by applying the is-fullwidth modiffier to it which will set the --slideshow-max-width variable to 100%.

JavaScript

Variables

  :root {
    --slideshow-padding: 1.25rem;
    --slideshow-max-width: 360px;
    --slideshow-height: 452px;
    --slideshow-transition: 600ms cubic-bezier(0.2,0,0.5,1) 0s;
    --slideshow-border-radius: var(--radius-lg, .5rem);
    --slideshow-arrow-size: 2.5rem;
    --slideshow-arrow-color: var(--color-accent);
    --slideshow-arrow-background: var(--color-white);
    --slideshow-arrow-border-radius: var(--radius-full, 9999px);
    --slideshow-arrow-shadow: 0 6px 20px 0 rgba(36, 41, 47, .4);
    --slideshow-control-size: .625rem;
    --slideshow-control-gap: .375rem;
    --slideshow-controls-border-radius: var(--radius-full, 9999px);
  }