# Modal

# Most common usage scenario

NOT YET DOCUMENTED

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

  • cross

    • Cross closing modal button
    • type: boolean
    • defaultValue: true
  • visible

    • Visibility of the modal
    • type: boolean
    • defaultValue: () => false
  • overlay

    • Whether to show the overlay
    • type: boolean
    • defaultValue: true
  • persistent

    • If true clicking outside will not dismiss the modal
    • type: boolean
    • defaultValue: false
  • transitionOverlay

    • overlay transition effect
    • type: string
    • defaultValue: "fade"
  • transitionModal

    • overlay transition effect
    • type: string
    • defaultValue: "fade"

# Slots

  • close

    • Use this slot to place content inside the close button.
  • default

    • Use this slot to place content inside the modal.

# Events

  • close

  • open

# CSS modifiers

None.

# SCSS variables

$modal-background-color: $c-white !default;
$modal-width: 430px !default;
$modal-height: auto !default;
$modal-padding: 2.5em 5em !default;
$modal-border: solid 1px rgba($c-black, 0.5) !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/SfModal/SfModal.html"></template>
<script src="@storefront-ui/vue/src/components/molecules/SfModal/SfModal.js"></script>
<style lang="scss">
@import "~@storefront-ui/shared/styles/components/SfModal.scss";
</style>

You can read about using component partials here

# Play with this component

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