NervesGateWeb.CoreComponents (nerves_gate v0.1.0)

Copy Markdown

Reusable, stateless controls and surfaces for the local gateway UI.

Summary

Functions

A native, keyboard-accessible radio group. Choices stay visible; no popup or custom JS.

An icon button that opens a short list of buttons or links. LiveView closes it.

Phoenix's generated theme toggle; the root layout's script applies the choice.

Functions

back_link(assigns)

Attributes

  • navigate (:string) (required)

Slots

  • inner_block (required)

button(assigns)

Attributes

  • href (:string) - Defaults to nil.
  • type (:string) - Defaults to "button".
  • variant (:string) - Defaults to "primary". Must be one of "primary", "secondary", "quiet", or "danger".
  • icon (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • loading (:boolean) - Defaults to false.
  • disabled (:boolean) - Defaults to false.
  • Global attributes are accepted. Supports all globals plus: ["form", "name", "value", "target", "rel", "referrerpolicy"].

Slots

  • inner_block

choice_group(assigns)

A native, keyboard-accessible radio group. Choices stay visible; no popup or custom JS.

Attributes

Slots

  • option (required) - Accepts attributes:
    • value (:string) (required)
    • title (:string) (required)
    • description (:string)
    • icon (:string)

field(assigns)

Attributes

  • field (Phoenix.HTML.FormField) (required)
  • label (:string) (required)
  • help (:string) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["required", "placeholder", "autocomplete", "inputmode", "disabled"].

icon(assigns)

Attributes

  • name (:string) (required)
  • class (:string) - Defaults to nil.

notice(assigns)

Attributes

  • title (:string) - Defaults to nil.
  • tone (:string) - Defaults to "neutral". Must be one of "neutral", "warning", or "good".
  • icon (:string) - Defaults to "info".
  • Global attributes are accepted.

Slots

  • inner_block (required)

notifications(assigns)

Attributes

  • flash (:map) (required)

page_header(assigns)

Attributes

  • eyebrow (:string) - Defaults to nil.
  • title (:string) (required)
  • description (:string) - Defaults to nil.

Slots

  • actions

panel(assigns)

Attributes

  • title (:string) (required)
  • description (:string) - Defaults to nil.
  • icon (:string) - Defaults to nil.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • meta
  • inner_block (required)
  • footer

setting_row(assigns)

Attributes

  • label (:string) (required)
  • description (:string) - Defaults to nil.

Slots

  • inner_block (required)

status(assigns)

Attributes

  • tone (:string) - Defaults to "neutral". Must be one of "neutral", "good", "warning", or "busy".

Slots

  • inner_block (required)

theme_toggle(assigns)

Phoenix's generated theme toggle; the root layout's script applies the choice.