# Notification

# 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

  • visible

    • Visibility of the Notification. Default value is false.
    • type: boolean
    • defaultValue: false
  • title

    • Title that will be displayed in Notification.
    • type: string
    • defaultValue: ""
  • message

    • Message that will be displayed in Notification.
    • type: string
    • defaultValue: ""
  • action

    • Action that will be displayed in Notification.
    • type: string
    • defaultValue: ""
  • type

    • Notification type ("secondary", "info", "success", "warning", "danger"). Check "Knobs" section to see how they look like.
    • type: string
    • defaultValue: "secondary"

# Slots

  • icon

    • Custom notification icon. Slot content will replace default icon.
    • bindings: icon
  • title

    • Custom title. Slot content will replace default title.
    • bindings: title
  • message

    • Custom message. Slot content will replace default message.
    • bindings: message
  • action

    • Custom action. Slot content will replace default action.
    • bindings: action, actionHandler
  • close

    • Custom notification close icon. Slot content will replace default close icon.
    • bindings: closeHandler

# Events

  • click:action

    • Event for action button
  • click:close

    • Event for close icon

# CSS modifiers

  • .sf-notification--primary
  • .sf-notification--secondary
  • .sf-notification--info
  • .sf-notification--success
  • .sf-notification--warning
  • .sf-notification--danger
  • .sf-notification--light
  • .sf-notification--dark
  • .sf-notification--white
  • .sf-notification--black

# SCSS variables

$notification-max-width-desktop: 35rem !default;
$notification-border-radius-desktop: 5px !default;
$notification-font-family: $body-font-family-primary !default;
$notification-font-family-desktop: $body-font-family-secondary !default;
$notification-font-size: $font-size-regular-desktop !default;
$notification-font-weight: $body-font-weight-secondary !default;
$notification-font-weight-desktop: $body-font-weight-primary !default;
$notification-box-shadow-desktop: 0 8px 11px rgba(0, 0, 0, 0.1) !default;
$notification__title-font-size-desktop: $font-size-big-desktop !default;
$notification__title-font-weight: 300 !default;
$notification__title-font-weight-desktop: 700 !default;
$notification__action-font-weight: 500 !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/SfNotification/SfNotification.html"></template>
<script src="@storefront-ui/vue/src/components/molecules/SfNotification/SfNotification.js"></script>
<style lang="scss">
@import "~@storefront-ui/shared/styles/components/SfNotification.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.