# SearchBar

Search bar component with placeholder text and icon.

# Most common usage scenario

<template>
  <SfSearchBar
    :class="customClass"
    :placeholder="placeholder"
    aria-label="Search"
    v-model="value"
  />
</template>
<script>
import { SfSearchBar } from "@storefront-ui/vue";
export default {
  components: {
    SfSearchBar,
  },
  data() {
    return {
      value: "",
      placeholder: "Search for items",
    };
  },
};
</script>

# Props

  • placeholder

    • type: string
    • defaultValue: ""
  • value

    • type: number|string
    • defaultValue: null

# Slots

  • icon

# Events

None.

# CSS modifiers

  • .sf-search-bar--position-center
  • .sf-search-bar--no-icon

# CSS custom properties (variables)

  • --search-bar-display
  • --search-bar-background
  • --search-bar-padding
  • --search-bar-width
  • --search-bar-height
  • --search-bar-icon-right
  • --search-bar-icon-display
  • --search-bar-input-text-align
  • --search-bar-font
  • --search-bar-font-weight
  • --search-bar-font-size
  • --search-bar-font-line-height
  • --search-bar-font-family
  • --search-bar-border
  • --search-bar-border-width
  • --search-bar-placeholder-color
  • --search-bar-placeholder-transition
  • --search-bar-placeholder-color-focus
  • --search-bar-icon-flex-direction

# Overridden other components CSS variables

  • --icon-size

You can override CSS variables values bound to this component.

# Play with this component

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