Default value Select Input

To set a default value, you do this in the form.

def mount(_params, _session, socket)
  changeset = User.changeset(user, %{theme: "Dark"})
  {:ok, assign(socket, form: to_form(changeset))}

If you are looking to set a default value that isn’t one of the options, you can add a prompt. Ie ‘Choose xxx’

<.input
  field={@form[:theme]}
  type="select"
  prompt="Choose a theme..."
  options={["Light", "Dark"]}
/>