AccrueAdmin.Components.Checkbox (accrue_admin v1.5.0)

Copy Markdown View Source

Shared checkbox form control for mounted admin pages.

Renders an inline ax-field-inline label wrapping the native <input type="checkbox">. Supports three states: unchecked, checked, and indeterminate. Because indeterminate is not a standard HTML attribute it must be set via a JS hook or phx-hook; this component emits data-indeterminate for the hook to pick up, and sets aria-checked="mixed" for screen readers when indeterminate is true.

Summary

Functions

checkbox(assigns)

Attributes

  • id (:string) (required)
  • name (:string) (required)
  • label (:string) (required)
  • checked (:boolean) - Defaults to false.
  • indeterminate (:boolean) - Defaults to false.
  • disabled (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["phx-click", "phx-value-id", "value", "form", "phx-hook"].