Month selection input — styled native <input type="month">.
Wraps the browser's native month picker with PhiaUI's input styling (borders, focus ring, size variants, error state). Supports standalone use or Phoenix form field integration with changeset error display.
Value format: "YYYY-MM" (e.g. "2026-03").
Zero JavaScript — uses the native browser month control.
Examples
<%!-- Standalone --%>
<.month_picker id="period" name="billing_month" label="Billing Month" value="2026-03" />
<%!-- With min/max constraints --%>
<.month_picker id="period" name="billing_month" min="2024-01" max="2026-12" />
<%!-- Form field integration --%>
<.month_picker
id="subscription_month"
name={@form[:month].name}
value={@form[:month].value}
errors={Enum.map(@form[:month].errors, &translate_error/1)}
label="Subscription Month"
/>
Summary
Functions
Attributes
id(:string) - HTMLidfor the input and labelforlink. Defaults tonil.name(:string) - HTMLnamefor form submission. Defaults tonil.value(:string) - Current month value as"YYYY-MM"(e.g."2026-03"). Defaults tonil.label(:string) - Label text rendered above the input. Defaults tonil.description(:string) - Helper text rendered below the label. Defaults tonil.errors(:list) - List of error message strings. Defaults to[].disabled(:boolean) - Disables the input. Defaults tofalse.size(:atom) - Input height/padding::sm(h-8),:default(h-10),:lg(h-12). Defaults to:default. Must be one of:sm,:default, or:lg.class(:string) - Additional CSS classes merged onto the input. Defaults tonil.- Global attributes are accepted. HTML attributes forwarded to the
<input>element. Supports all globals plus:["required", "placeholder", "phx-debounce", "min", "max"].