The round pills of a filter bar: on or off, with a ×, and the dashed one that adds a filter.
filter_pill/1 is a filter that is on or off (active fills it with ink; tone={:warn} is the amber one for
what needs a look) and, with remove_event, carries a × that takes it away; add_pill/1 is the dashed
"+ Filter" that opens the choice of a new one. They are the canvas's "pills com estado".
A pill is a toggle button with aria-pressed; the caller keeps the state and learns of a press through
event (phx-value-value, the value or the label). The × is a second button named by remove_label,
where %{label} is the text of the pill, so a screen reader hears "Remove SGE" and not N equal buttons. For
the field where the person types the pills, see DevactionUI.Pillbox.
Summary
Functions
Attributes
label(:string) (required) - what it adds, such as "Filter".event(:string) - sent when the pill is pressed. Defaults tonil.target(:any) - aphx-target(a@myself) inside a LiveComponent. Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
icon- replaces the typographic + before the label.
Attributes
id(:string) - Defaults tonil.label(:string) (required)value(:string) - sent asphx-value-value; the label when not given. Defaults tonil.active(:boolean) - the filter is on: filled with ink. Defaults tofalse.tone(:atom) - the look of an inactive pill;:warnis the amber one. Defaults to:neutral. Must be one of:neutral, or:warn.event(:string) - sent when the pill is pressed. Defaults tonil.remove_event(:string) - shows the × and is sent when it is pressed. Defaults tonil.remove_label(:string) - names the ×, as in"Remove %{label}"; required withremove_event. Defaults tonil.target(:any) - aphx-target(a@myself) when used inside a LiveComponent. Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
icon- a mark before the label.remove_icon- replaces the typographic × that removes the pill.