InputTags
extends Component
in package
InputTags Laravel Blade Component
An input tags component that allows users to select multiple tags from a predefined list. Features customizable labels and supports both array and key-value pair options.
Features:
- Multiple tag selection
- Customizable labels
- Supports array and key-value pair options
- Form validation integration
- Livewire real-time updates
- Bulma CSS framework integration
- Mobile-friendly responsive design
Livewire Integration:
IMPORTANT: The component handles Livewire communication through custom events.
Events Dispatched:
-
InputTagsChanged- Fired when tag selection changes Payload: { value: array }
Events Listened For:
-
InitInputTags:{{ $name }}- Initialize component with initial value Payload: { value: array } -
ResetInputTags:{{ $name }}- Reset component to empty state Payload: none
Tags
Table of Contents
- $id : string|null
- $keyValue : bool
- $label : mixed
- $name : string
- $options : array<string|int, mixed>|Collection
- $value : mixed
- __construct() : mixed
- Constructor
- render() : View|Closure|string
- Get the view / contents that represent the component.
Properties
$id
public
string|null
$id
= null
$keyValue
public
bool
$keyValue
= false
$label
public
mixed
$label
= null
$name
public
string
$name
$options
public
array<string|int, mixed>|Collection
$options
= []
$value
public
mixed
$value
= []
Methods
__construct()
Constructor
public
__construct(string $name[, mixed|null $label = null ][, mixed $id = null ][, mixed $value = [] ][, array<string|int, mixed>|Collection $options = [] ][, bool $keyValue = false ]) : mixed
Parameters
- $name : string
-
The name of the input field
- $label : mixed|null = null
-
The label for the input field
- $id : mixed = null
-
The unique id of the input field
- $value : mixed = []
-
The initial selected tags
- $options : array<string|int, mixed>|Collection = []
-
Available tag options
- $keyValue : bool = false
-
Whether options are key-value pairs
Return values
mixed —render()
Get the view / contents that represent the component.
public
render() : View|Closure|string