Skip to content

Search bar - AvSearchBar

✨ Introduction

The AvSearchBar is a navigation system that allows users to quickly access content by searching for a keyword or phrase.

🏗️ Structure

The search bar is composed by:

  • an input
  • a button

🏷️ Props

NameTypeDefaultMandatoryDescription
idstringsearch-bar-${crypto.randomUUID()}Unique id for the search bar.
labelstring'Recherche'Label of the search bar.
modelValuestring''Current value linked to the search bar.
placeholderstring'Rechercher...'Placeholder for the search bar.
disabledbooleanfalseIf true, disable the search bar.

🔊 Events

NameData (payload)Description
update:modelValuestring | undefinedEmitted when the input value changes
searchstring | undefinedEmitted when the button is clicked or the enter key pressed

🎨 Slots

None.

🚀 Storybook demos

You can find examples of use and demo of the component on its dedicated Storybook page.

💡 Examples of use

vue
<script>
const state = ref(false)
</script>

<template>
  <AvSearchBar
    label="Search"
    :model-value="modelValue"
    placeholder="Search..."
    @update:model-value="emit('update:modelValue', $event)"
    @search="emit('search', $event)"
  />
</template>