{% comment %} Segmented control: one segment per choice of the form field, a sliding thumb under the chosen one (styled in forms/fields.css, up to five segments). Sized to the shared MD3 field height (56dp) so it can sit in a form row next to outlined fields. The form's RadioSelect draws each radio through segmented_control/options.html and segmented_control/option.html, so values, the checked segment, ids, disabled and every hx_* option reach each input; the chosen radio submits its own value. A disabled form field greys the whole control. Help text and errors render as MD3 supporting text. Looks: outlined + large (default, for forms) or variant="filled" size="small" (a pill, for toolbars and page headers). {% endcomment %} {% load phoxtail_core_tags %}
{% if show_label != False and label|default:field.label %} {{ label|default:field.label }}{% if show_required != False and required|default:field.field.required %} *{% endif %} {% endif %} {% with variant=variant|default:"outlined" size=size|default:"large" %}
{% widget field class="phx-segmented-control__radio" template_name="phoxtail_core/forms/fields/segmented_control/options.html" option_template_name="phoxtail_core/forms/fields/segmented_control/option.html" htmx=htmx %}
{% endwith %} {% if supporting == "errors" %}
{% for error in field.errors %}{{ error }}{% endfor %}
{% elif supporting == "help" %}
{{ help_text|default:field.help_text }}
{% endif %}