The pixel card: a card to choose from (a model, a module, an integration) that, on hover or keyboard focus, lights up a matrix of pixels in its top right corner, in the card's colour.
<.pixel_card navigate={~p"/novo/loja"} color="red" icon="huge-shopping-cart-01"
title="Loja" description="PDV, estoque, NFC-e" />
<.pixel_card phx-click="pick" phx-value-id="agenda" color="ink" icon="huge-calendar-03"
title="Agenda" description="Horários e lembretes" />With href, navigate or patch the card is a link; with none it is a
<button type="button"> that takes phx-click and the other events through rest. The
keyboard focus does what the hover does: the pixels, the stronger outline and the arrow
(arrow={false} leaves the arrow out).
color takes a palette name (red, rose, green, teal, blue, violet, amber,
ink); without it the card takes the accent. Any other colour goes through the --px
custom property (style="--px: #f97316").
The pixel matrix is drawn by the LedgerUI.PixelCard hook (three random patterns that swap
every 0.3s, from lu-px in the stylesheet). The hook needs a DOM id: pass id, or it is
derived from the title.
Summary
Functions
Attributes
id(:string) - The hook's DOM id; derived from the title when omitted. Defaults tonil.title(:string) (required) - The bold name of the option.description(:string) - The muted line under the name. Defaults tonil.icon(:string) - An icon, drawn white in a round chip of the colour. Defaults tonil.color(:string) - Defaults tonil.Must be one ofnil,"red","rose","green","teal","blue","violet","amber", or"ink".arrow(:boolean) - Defaults totrue.class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["href", "navigate", "patch", "method", "disabled"].
Slots
inner_block- Extra content under the description.