Download the PHP package vitisstudio/filament-choosable-chips without Composer

On this page you can find all versions of the php package vitisstudio/filament-choosable-chips. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-choosable-chips

Choosable Chips for Filament

Choosable Chips for Filament

Latest Version on Packagist Tests Total Downloads

A FilamentPHP v5 form field that renders checkbox/radio options as dismissable, colorable, icon-bearing badge chips. The API is patterned after Select/ToggleButtons, so per-option labels, colors, and icons are supplied through the same fluent option map you already know. Each chip is a native Filament badge, so it inherits Filament's theme out of the box.

The Choosable Chips field in a Filament form

Features

Requirements

Installation

Install the package via Composer:

That's all that's required — the field uses Filament's existing badge styles, so there is nothing to publish or build for the default look.

If you use a custom panel theme, register the package views as a Tailwind source in your theme's CSS so the chip utility classes are compiled:

Then rebuild your theme (npm run build).

Usage

Use the field anywhere you build a Filament schema (a resource form, a custom page, a relation manager, an action, etc.). Single-select (radio semantics) is the default — the field stores a single scalar value:

Single select

Multiple selection

Call ->multiple() for checkbox semantics. The field then stores an array of values (cast the underlying Eloquent attribute as array):

Multiple select

Icons and disabled options

Per-option icons accept a Heroicon enum case or an icon name. Disable individual options with ->disableOptionWhen():

Icons and a disabled option

Check on selected

Call ->checkSelected() to prepend a check mark to selected chips. The check is colored with ->selectedColor() (defaults to success). When you don't configure checkSelected() explicitly, it turns on automatically for fields that have no per-option icons(), so it never collides with a leading icon. While the check is shown it replaces the dismiss × (the check already signals selection, and clicking the chip clears it):

Check on selected

Sizes

Set the chip size with ->size(), passing a Size enum (or its string value). The default is Size::Medium. Filament's badge styles only render xs and sm distinctly — md, lg, and xl share the base size.

To change the size for every chip field at once, set a default in a service provider:

Extra small chips Small chips Medium chips

Enums

Pass a backed enum to options(). Labels, colors, and icons are read automatically from the enum when it implements Filament's HasLabel, HasColor, and HasIcon contracts:

API

Method Description
options(array \| Arrayable \| string \| Closure) The value => label option map (or an enum class string).
multiple(bool \| Closure = true) Switch to multi-select (checkbox) mode. Default is single-select.
colors(array \| Arrayable \| Closure) Per-option color map keyed by value (any Filament color token).
icons(array \| Arrayable \| Closure) Per-option icon map keyed by value (Heroicon or icon name).
descriptions(array \| Arrayable \| Closure) Per-option helper text keyed by value.
disableOptionWhen(Closure) Disable specific options; disabled chips can't be selected or removed.
dismissible(bool \| Closure = true) Show a × on selected chips to clear them. Enabled by default, but suppressed while the selected check is shown.
checkSelected(bool \| Closure = true) Prepend a check mark to selected chips. Auto-on when no icons() are set.
selectedColor(string \| Closure \| null) Color of the selection check. Defaults to success.
checkIcon(string \| BackedEnum \| Closure) Icon used to mark selected chips. Defaults to a check mark.
size(Size \| string \| Closure) Badge size (Size enum or its string value, e.g. 'sm').
defaultColor(string \| Closure \| null) Color used for options with no explicit color. Defaults to primary.
gridDirection(GridDirection \| string \| Closure) Lay chips out by column (default) or row.

Publishing the views

The default look needs no publishing. To customise the chip markup, publish the view and edit it:

The view is published to resources/views/vendor/filament-choosable-chips/.

Example app

A full Filament v5 panel using the field lives in example/README.md for setup; in short:

Testing

To preview the field in a browser without a full app, the package ships a Testbench workbench app:

Upgrading

This package follows semantic versioning. Review the changelog before upgrading across a major version.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover a security vulnerability, please email [email protected] rather than using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-choosable-chips with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
filament/forms Version ^5.0
illuminate/contracts Version ^11.0||^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vitisstudio/filament-choosable-chips contains the following files

Loading the files please wait ...