The chip (lu-chip): a small tag for a quick filter, an applied filter or a selected person.
<.chip>Hoje</.chip>
<.chip selected={@pro?} phx-click="toggle" value="pro">Pro</.chip>
<.chip selected={false} count={12}>Atrasados</.chip>
<.chip dashed icon="plus">Filtro</.chip>
<.chip label="Situação: Aprovação" on_remove={JS.hide(to: "#c1")} id="c1" />
<.chip avatar="Marina Costa" on_remove="remove_person" id="p-1">Marina Costa</.chip>
<.chip patch={~p"/extract?account=1"} label="Conta 1" />
<.chip label="Aberta" remove_patch={~p"/tasks"} />- a plain chip is a
<span>; withselected(true/false) it is a toggle button (aria-pressed, theonstate is the inverse colour) that flips in the browser unless you give it aphx-click;dashedandphx-clickmake it a button too; - with
href,navigateorpatchit is a link and has no x; on_remove(an event name, pushed with%{"id" => id}totarget, or aJScommand) adds the x button;remove_patchmakes the x apatchlink instead.
Summary
Functions
Attributes
label(:string) - Defaults tonil.selected(:boolean) -true/falsemakes the chip a toggle. Defaults tonil.dashed(:boolean) - Defaults tofalse.tone(:string) - Defaults tonil.Must be one ofnil,"default", or"acc".icon(:string) - Defaults tonil.count(:any) - Defaults tonil.avatar(:string) - Defaults tonil.avatar_color(:string) - Defaults tonil.avatar_src(:string) - Defaults tonil.on_remove(:any) - Defaults tonil.remove_patch(:string) - Defaults tonil.id(:string) - Defaults tonil.target(:any) - Defaults tonil.remove_label(:string) - Defaults to"Remove".class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["href", "navigate", "patch", "method", "download", "value", "disabled"].
Slots
inner_block