Select dropdown component for Laravel - supports Livewire and Vue
mrshanebarron/select is a Laravel package for select dropdown component for laravel - supports livewire and vue.
It currently has 0 GitHub stars and 8 downloads on Packagist (latest version v1.0.1).
Install it with composer require mrshanebarron/select.
Discover more Laravel packages by mrshanebarron
or browse all Laravel packages to compare alternatives.
Last updated
A custom select dropdown component for Laravel applications. Supports search, multi-select, and custom styling. Works with Livewire and Vue 3.
composer require mrshanebarron/select
<livewire:sb-select
wire:model="country"
:options="['us' => 'United States', 'ca' => 'Canada', 'mx' => 'Mexico']"
/>
<livewire:sb-select
wire:model="status"
:options="$statuses"
placeholder="Select a status"
/>
<livewire:sb-select
wire:model="country"
:options="$countries"
:searchable="true"
placeholder="Search countries..."
/>
<livewire:sb-select
wire:model="tags"
:options="$availableTags"
:multiple="true"
placeholder="Select tags"
/>
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| wire:model | mixed | null | Selected value(s) |
| options | array | required | Key-value options |
| placeholder | string | 'Select an option' | Placeholder text |
| searchable | boolean | false | Enable search |
| multiple | boolean | false | Allow multiple selections |
| disabled | boolean | false | Disable select |
import { SbSelect } from './vendor/sb-select';
app.component('SbSelect', SbSelect);
<template>
<SbSelect v-model="selected" :options="options" />
</template>
<script setup>
import { ref } from 'vue';
const selected = ref(null);
const options = {
draft: 'Draft',
published: 'Published',
archived: 'Archived'
};
</script>
<template>
<SbSelect
v-model="selected"
:options="options"
placeholder="Choose a status..."
/>
</template>
<template>
<SbSelect
v-model="country"
:options="countries"
searchable
placeholder="Search countries..."
/>
</template>
<script setup>
import { ref } from 'vue';
const country = ref(null);
const countries = {
us: 'United States',
ca: 'Canada',
uk: 'United Kingdom',
de: 'Germany',
fr: 'France',
// ... more countries
};
</script>
<template>
<SbSelect
v-model="selectedTags"
:options="tags"
multiple
placeholder="Select tags"
/>
<p>Selected: {{ selectedTags }}</p>
</template>
<script setup>
import { ref } from 'vue';
const selectedTags = ref([]);
const tags = {
frontend: 'Frontend',
backend: 'Backend',
design: 'Design',
devops: 'DevOps'
};
</script>
<template>
<form @submit.prevent="submit" class="space-y-4">
<div>
<label class="block text-sm font-medium mb-1">Category</label>
<SbSelect
v-model="form.category"
:options="categories"
placeholder="Select category"
/>
</div>
<div>
<label class="block text-sm font-medium mb-1">Tags</label>
<SbSelect
v-model="form.tags"
:options="tags"
multiple
searchable
placeholder="Select tags"
/>
</div>
<button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded">
Save
</button>
</form>
</template>
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| modelValue | Any | null | Selected value(s) |
| options | Object | required | { value: 'Label' } pairs |
| placeholder | String | 'Select an option' | Placeholder text |
| searchable | Boolean | false | Enable filtering |
| multiple | Boolean | false | Multi-select mode |
| disabled | Boolean | false | Disable interaction |
| Event | Payload | Description |
|-------|---------|-------------|
| update:modelValue | any | Emitted when selection changes |
// Object format (value => label)
const options = {
draft: 'Draft',
published: 'Published',
archived: 'Archived'
};
When multiple is true, the model value is an array:
// Single select
const selected = ref('draft'); // string
// Multi-select
const selected = ref(['frontend', 'backend']); // array
Uses Tailwind CSS:
MIT License