PhoenixPaper.ToggleButton (PhoenixPaper v0.1.0)

Copy Markdown View Source

A Material Design toggle button (pp_toggle_button/1) — a button with a boolean pressed state, filled when pressed. Combine several inside a PhoenixPaper.ButtonGroup for a segmented toggle control (e.g. text alignment, view mode).

Summary

Functions

Renders a toggle button. See the module doc.

Functions

pp_toggle_button(assigns)

Renders a toggle button. See the module doc.

Attributes

  • pressed (:boolean) - Defaults to false.
  • color (:string) - Defaults to "primary". Must be one of "primary", "secondary", "tertiary", or "error".
  • shape (:atom) - corner radius token, see PhoenixPaper.Shape. Defaults to :md. Must be one of :none, :xs, :sm, :md, :lg, :xl, or :full.
  • ripple (:boolean) - the Material ripple effect on click/tap — off whenever paperize is false, see PhoenixPaper.Ripple. Defaults to true.
  • disabled (:boolean) - Defaults to false.
  • type (:string) - Defaults to "button". Must be one of "button", "submit", or "reset".
  • paperize (:boolean) - Defaults to true.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["form", "name", "value", "phx-click"].

Slots

  • inner_block (required)