Select

Defines a select


Provides a wrapper for Phoenix.HTML.Form's select/4 function.

All options passed via opts will be sent to select/4, class can be set directly and will override anything in opts.



<div class="select">
  <Select form="user" field="role" options={{ "Admin": "admin", "User": "user" }} />
</div>

Other Select related components

  • MultipleSelect - Provides a wrapper for Phoenix.HTML.Form's multiple_select/4 function.

  • OptionsForSelect - Defines options to be used inside a select.

  • DateTimeSelect - Provides a wrapper for Phoenix.HTML.Form's datetime_select/3 function.

  • TimeSelect - Provides a wrapper for Phoenix.HTML.Form's time_select/3 function.



# Public API

Name Description Type Values Default
form The form identifier.

:form
field The field name.

:string
class The CSS class for the underlying tag.

:css_class
options The options in the select.

:any []
opts Options list.

:keyword []