{% load rest_framework %}

<div class="grid gap-4">
  <div class="fieldset">
    {% if field.label %}
    <label
      for="{{ field.name }}"
      class="fieldset-legend{% if style.hide_label %} sr-only{% endif %}"
    >
      {{ field.label }}
    </label>
    {% endif %}

    <!---->
    {% for key, text in field.choices|items %}
    <label class="flex items-center gap-4">
      <input
        type="checkbox"
        name="{{ field.name }}"
        value="{{ key }}"
        class="checkbox focus:checkbox-primary active:checkbox-primary checked:checkbox-primary"
        {% if key|as_string in field.value|as_list_of_strings %}checked{% endif %}
      />
      {{ text }}
    </label>
    {% endfor %}
  
    <!---->
    {% if field.help_text %}
    <p class="fieldset-label">{{ field.help_text|safe }}</p>
    {% endif %}
  </div>

  {% include 'rest_framework/components/field_errors.html' %}
</div>
