{# doc Render a Select with options #}
{# def widget: Annotated[fastlife.adapters.jinjax.widgets.dropdown.DropDownWidget, "widget to display."] #}

<pydantic_form.Widget :widget="widget">
  <div class="pt-4">
    <Label :for="widget.id">{{widget.title}}</Label>
    <Select :name="widget.name" :id="widget.id">
      {%- for opt in widget.options -%}
      <Option :value="opt.value" id={{widget.id + "-" + opt.value.replace(" ", " -")}}
        :selected="widget.value==opt.value">
        {{- opt.text -}}
      </Option>
      {%- endfor -%}
    </Select>
    <pydantic_form.Error :text="widget.error" />
    <pydantic_form.Hint :text="widget.hint" />
  </div>
</pydantic_form.Widget>
