PhoenixPaper.RadioGroup (PhoenixPaper v0.1.0)

Copy Markdown View Source

A Material Design radio group (pp_radio_group/1) — a labeled set of mutually exclusive radio buttons sharing one name.

Accepts either a Phoenix Phoenix.HTML.FormField via field= or plain name/value attrs.

ripple={true} adds the Material ripple effect on click/tap, wired to each option's small box rather than its whole label — off by default (unlike Button/Fab/ToggleButton), since a radio's own instant fill/border-color change already reads as clear feedback on a target this small — see PhoenixPaper.Ripple.

Summary

Functions

pp_radio_group(assigns)

Attributes

  • id (:any) - Defaults to nil.
  • name (:any) - Defaults to nil.
  • label (:string) - Defaults to nil.
  • value (:any) - Defaults to nil.
  • options (:list) (required) - list of {label, value} tuples, or plain values.
  • field (Phoenix.HTML.FormField) - Defaults to nil.
  • disabled (:boolean) - Defaults to false.
  • paperize (:boolean) - Defaults to true.
  • ripple (:boolean) - the Material ripple effect on click/tap (default: false) — see PhoenixPaper.Ripple. Defaults to false.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["form", "autofocus"].