diff --git a/packages/forms/docs/03-fields/14-tags-input.md b/packages/forms/docs/03-fields/14-tags-input.md index c9b88cfb58..fe7e1aa92f 100644 --- a/packages/forms/docs/03-fields/14-tags-input.md +++ b/packages/forms/docs/03-fields/14-tags-input.md @@ -85,6 +85,28 @@ TagsInput::make('percentages') ->tagSuffix('%') ``` +## Reordering tags + +You can allow the user to reorder tags within the field using the `reorderable()` method: + +```php +use Filament\Forms\Components\TagsInput; + +TagsInput::make('tags') + ->reorderable() +``` + +## Changing the color of tags + +You can change the color of the tags by passing a color to the `color()` method. It may be either `danger`, `gray`, `info`, `primary`, `success` or `warning`: + +```php +use Filament\Forms\Components\TagsInput; + +TagsInput::make('tags') + ->color('danger') +``` + ## Tags validation You may add validation rules for each tag by passing an array of rules to the `nestedRecursiveRules()` method: @@ -98,14 +120,3 @@ TagsInput::make('tags') 'max:255', ]) ``` - -## Reordering tags - -You can allow the user to reorder tags within the field using the `reorderable()` method: - -```php -use Filament\Forms\Components\TagsInput; - -TagsInput::make('tags') - ->reorderable() -``` diff --git a/packages/forms/resources/views/components/tags-input.blade.php b/packages/forms/resources/views/components/tags-input.blade.php index bb41d56766..70579888ec 100644 --- a/packages/forms/resources/views/components/tags-input.blade.php +++ b/packages/forms/resources/views/components/tags-input.blade.php @@ -1,6 +1,7 @@ @php use Filament\Support\Facades\FilamentView; + $color = $getColor(); $hasInlineLabel = $hasInlineLabel(); $id = $getId(); $isDisabled = $isDisabled(); @@ -92,6 +93,7 @@ class="hidden" >