A field of removable pills, for labels, e-mails, stacks: type and press Enter (or a comma) to add one,
Backspace on an empty field removes the last, the × on a pill removes that one. Each pill is a hidden
input named name[], so the form submits the list as it stands; the hook fires input on the box so
phx-change hears every change. The browser owns the pills after mount (phx-update="ignore"): give
it a new id to reset it from the server.
Summary
Functions
Attributes
id(:string) (required)name(:string) (required) - the field name; the values are sent asname[].values(:list) - Defaults to[].label(:string) (required) - what the field is, for assistive technology.placeholder(:string) - Defaults tonil.remove_label(:string) (required) - "Remove", for the × of each pill.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
remove_icon- replaces the typographic × that removes a pill.