Skip to content

OrInputTags

Creates an input that displays results in a dropdown as a user types.

Basic

html
<or-input-tags :options="users" v-model="selectedUser" placeholder="Select user"/>
<or-input-tags :options="users" v-model="selectedUser" placeholder="Select user"/>

Formatting

The example above showed the dropdown options as is without any kind of formatting. We can change this by using scoped slots

html
<or-input-tags :options="users" v-model="selectedUser" placeholder="Select user">
    <template #value="{selected}">
        {{ selected.firstName }} {{ selected.lastName }}
    </template>
    <template #option="{option}">
        {{ option.firstName }} {{ option.lastName }}
    </template>
</or-input-tags>
<or-input-tags :options="users" v-model="selectedUser" placeholder="Select user">
    <template #value="{selected}">
        {{ selected.firstName }} {{ selected.lastName }}
    </template>
    <template #option="{option}">
        {{ option.firstName }} {{ option.lastName }}
    </template>
</or-input-tags>

Props

PropRequiredDefaultTypeDescription
optionstrue[]ArrayThe items to be displayed on the dropdown

D2B ___ Chidi Ikeoha