# Select

# 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

  • label

    • Select field label
    • type: string
    • defaultValue: ""
  • selected

    • Selected item value
    • type: string|object
    • defaultValue: ""
  • size

    • Dropdown list size
    • type: number
    • defaultValue: 5
  • required

    • Required attribute
    • type: boolean
    • defaultValue: false
  • valid

    • Validate value of form input
    • type: boolean
    • defaultValue: undefined
  • errorMessage

    • Error message value of form select. It will be appeared if valid is true.
    • type: string
    • defaultValue: "This field is not correct."

# Slots

  • label

  • default

  • errorMessage

# Events

  • change

# CSS modifiers

  • .sf-select-option--active
  • .sf-select--bordered
  • .sf-select--bordered.sf-select--is-active
  • .sf-select--bordered.sf-select--is-selected
  • .sf-select--underlined
  • .sf-select--is-active
  • .sf-select--is-selected
  • .sf-select--is-required

# SCSS variables

$select-option-padding-y: 0.75rem !default;
$select-option-padding-x: 1.875rem !default;
$select-option-padding-y-desktop: 0.75rem !default;
$select-option-padding-x-desktop: 0 !default;
$select-color: $c-text-primary !default;
$select-color-primary: $c-light-primary !default;
$select-color-active: $c-accent-primary !default;
$select-color-invalid: #d12727 !default;
$select-font-family: $body-font-family-secondary !default;
$select-font-size: $font-size-big-mobile !default;
$select-font-size-desktop: $font-size-big-desktop !default;
$select-font-weight: $body-font-weight-secondary !default;
$select-line-height: 1.6 !default;
$select__label-focus-font-size: $font-size-small-mobile !default;
$select__label-focus-font-size-desktop: $font-size-extra-small-desktop !default;
$select__label-transition: all 350ms ease-in-out !default;
$select__bar-transition: all 150ms ease-in-out !default;
$select__error-message-font-family: $body-font-family-primary !default;
$select__error-message-font-size: $font-size-small-mobile !default;
$select__cancel-color: #a3a5ad !default;

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

# Internal components

# SelectOption

# Props

  • value
    • type: string|object
    • defaultValue: ""

# Slots

  • default

# Events

None.

# CSS modifiers

None.

# SCSS variables

None.

# 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/SfSelect/SfSelect.html"></template>
<script src="@storefront-ui/vue/src/components/molecules/SfSelect/SfSelect.js"></script>
<style lang="scss">
@import "~@storefront-ui/shared/styles/components/SfSelect.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.