PhoenixPaper.Select (PhoenixPaper v0.1.0)

Copy Markdown View Source

A Material Design select field (pp_select/1) — a native <select> styled to match PhoenixPaper.Input's outlined/filled variants.

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

Summary

Functions

pp_select(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.
  • prompt (:string) - Defaults to nil.
  • variant (:string) - Defaults to "outlined". Must be one of "outlined", or "filled".
  • shape (:atom) - corner radius token, see PhoenixPaper.Shape. Defaults to :sm. Must be one of :none, :xs, :sm, :md, :lg, :xl, or :full.
  • field (Phoenix.HTML.FormField) - Defaults to nil.
  • errors (:list) - Defaults to [].
  • helper_text (:string) - Defaults to nil.
  • disabled (:boolean) - Defaults to false.
  • paperize (:boolean) - Defaults to true.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["autofocus", "form", "multiple", "required"].