# Gallery

# Most common usage scenario


This section is not fully documented yet. We are doing our best to make our documentation a good and complete source of knowledge about Storefront UI. If you would like to help us, please don't hesitate to contribute to our docs. You can read more about it here.

# Props

  • images

    • Images list
    • type: array
    • defaultValue: () => []
  • current

    • Initial image number (starting from 1)
    • type: number
    • defaultValue: 1
  • sliderOptions

    • Glide slider options (https://glidejs.com/docs/options/)
    • type: object
    • defaultValue: function(){ return { type: "slider", autoplay: false, rewind: false, gap: 0 }; }

# Slots

  • thumbs
    • Custom markup for thumbnails (binds image object and index number)
    • bindings: images, active, go

# Events

  • click
    • Event for current image change (v-model)

# CSS modifiers

  • .sf-gallery__item--selected

# SCSS variables

$gallery-flex-direction: row !default;
$gallery__nav-width: 100px !default;
$gallery__nav-margin: 0 $spacer-extra-big 0 0 !default;
$gallery__item-margin-bottom: $spacer-medium !default;
$gallery__item-opacity: 0.5 !default;
$gallery__item-transition: opacity 0.15s linear !default;
$gallery__item-mobile-size: 10px !default;
$gallery__item-mobile-background: $c-gray-secondary !default;
$gallery__item-mobile--selected-background: $c-accent-primary !default;
$gallery__stage-width: 400px !default;
$gallery__stage-cursor: zoom-in !default;

You can override SCSS variable values bound to this component in sfui.scss in the root of your project.

# Partials

If you want to customize this component even more you can use its partials for limitless customization.

<template lang="html" src="@storefront-ui/vue/src/components/molecules/SfGallery/SfGallery.html"></template>
<script src="@storefront-ui/vue/src/components/molecules/SfGallery/SfGallery.js"></script>
<style lang="scss">
@import "~@storefront-ui/shared/styles/components/SfGallery.scss";

You can read about using component partials here

# Play with this component

See all available configurations and play with this component on Storybook.