{# @description daisyUI's fieldset: a legend naming a group of controls, the group itself, a description line and error messages. The legend names the group, not a control inside it, so a fieldset holding one control still gives that control its own c-form.label. With id, the description carries -description and the errors carry -errors, so a control names both in aria-describedby; without id, neither is emitted. A description or error message containing HTML is escaped; a named slot of the same name takes markup instead. A named slot filled with whitespace only still renders its element. See the fieldset gallery entry for a composition naming every control. #} {# @prop legend:text | description:"Group heading, rendered as the first child. Also fillable as the legend slot." #} {# @prop description:text | description:"Help text rendered as a description line after the slot. Also fillable as the description slot. Empty renders nothing." #} {# @prop errors:text | description:"A string or a list of strings (a Django ErrorList works), each rendered as an error-coloured description line after the description. Also fillable as the errors slot. Empty renders nothing." #} {# @prop id:text | description:"Fieldset id. When given, the description and errors carry -description and -errors for aria-describedby." #} {# @prop class:text | description:"Extra classes added to the fieldset." #} {# @slot:legend Account — The group heading, as an alternative to the legend attribute. #} {# @slot https://EnterBuilding forms with daisy-cotton.Nothing yet.Quantity — A form section showing every control labelled, invalid and disabled: a required, invalid email field naming both derived ids in aria-describedby, a floating-labelled field, a labelled field with prefixed start content, a labelled search field with an icon and a keyboard hint, and a labelled disabled field; a labelled textarea with an invalid and a disabled example, a labelled select, a select named by its own start content, a floating-labelled select, and an invalid and a disabled select; a nested fieldset with a legend holding three labelled radios sharing a name, one checked and one disabled and one invalid, then a labelled checked checkbox, an invalid one and a disabled one, and a labelled checked toggle, an invalid one and a disabled one; a labelled file input, an invalid one and a disabled one, then a labelled range with a value, a labelled vertical range, an invalid one and a disabled one; then a nested fieldset with a legend holding four filters: one named by the legend with nothing chosen, a labelled one with three value and label options and one chosen, and a primary small one and an accent large one; then a nested fieldset with a legend holding a single date calendar with a chosen date, a minimum and a maximum, and a two-month range calendar, both with icon font paging icons; then a nested fieldset with a legend holding a labelled six-digit one-time code, a joined four-digit one and a disabled one; then a nested fieldset with a legend holding a clearable rating, a half-star rating with a value, a disabled rating with a value and a read-only rating with a value. #} {# @slot:description Changes apply everywhere you sign in. — Help text, as an alternative to the description attribute. The slot content is placed inside one description line, so it takes inline markup only. #} {# @slot:errors — Error messages, as an alternative to the errors attribute. The slot content is placed inside one error line, so it takes inline markup only. #} {# djlint:off #}
{% if legend %}{{ legend }}{% endif %}{{ slot }}{% if description %}

{{ description }}

{% endif %}{% if errors %}
{% if errors == errors|stringformat:"s" %}

{{ errors }}

{% else %}{% for error in errors %}

{{ error }}

{% endfor %}{% endif %}
{% endif %}
{# djlint:on #}