{% stories fieldset with { title: 'Components/Form/Fieldset' } %}

  {% story default with {
    args: {
      
    }
  } %}

    {# Render label #}
    {% set label %}
        {{ include('tailpine:form-element--label', {title:"Married", title_display:"after", required: true, attributes: create_attribute()}) }}
    {% endset %}

    {# Render input #}
    {% set input %}
      {% embed 'tailpine:input' with {attributes: create_attribute({'type': "checkbox", 'name': "married"})} %}
      {% endembed %}
    {% endset %}

    {# Render form element #}
    {% set element %}
      {% embed 'tailpine:form-element' with {
        attributes: create_attribute(),
        type: "checkbox",
        name: "married",
        label: label,
        label_display: "after",
      } %}
        {% block children %}
          {{ input }}
        {% endblock %}
      {% endembed %}
    {% endset %}
    
    {% set attributes = create_attribute() %}
    {% set legend_attributes = create_attribute() %}
    {% embed 'tailpine:fieldset' with {
      attributes: attributes,
      legend: {'attributes': legend_attributes, title: "Legend"}
    } %}
      {% block children %}
        {{ element }}
      {% endblock %}
    
    {% endembed %}

  {% endstory %}

{% endstories %}