GreenAsh.Components (GreenAsh v0.3.0)

Copy Markdown View Source

Self-contained UI components for the console: the full-screen "green terminal" stylesheet, a generic <.input> (driven by an AshPhoenix form field), and a <.button>. No dependency on the host's components.

Summary

Functions

"Terminal"-styled button.

Generic form field, driven by a Phoenix.HTML.FormField — the type (inferred by GreenAsh.Field) selects the rendered widget (text, number, date, checkbox, select, textarea).

Terminal stylesheet (to include once per screen).

Functions

button(assigns)

"Terminal"-styled button.

Attributes

  • type (:string) - Defaults to "text".
  • Global attributes are accepted. Supports all globals plus: ["disabled"].

Slots

  • inner_block (required)

input(assigns)

Generic form field, driven by a Phoenix.HTML.FormField — the type (inferred by GreenAsh.Field) selects the rendered widget (text, number, date, checkbox, select, textarea).

Attributes

  • field (Phoenix.HTML.FormField) (required)
  • type (:string) - Defaults to "text".
  • label (:string) - Defaults to nil.
  • options (:list) - Defaults to [].
  • prompt (:string) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["step", "min", "max", "maxlength", "minlength", "placeholder", "readonly", "disabled", "autocomplete", "pattern"].

styles(assigns)

Terminal stylesheet (to include once per screen).