<select
    id="{{ handle }}"
    name="{{ handle }}{{ multiple ?= "[]" }}"
    {{ if multiple }}multiple{{ /if }}
    class="{{ [
        'block w-full rounded-md border-0 py-1.5 pl-3 pr-10 ring-1 ring-inset focus:ring-2 focus:ring-inset disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
        'text-gray-900 shadow-xs ring-gray-300 placeholder:text-gray-400 focus:ring-indigo-600' => !$error,
        'pr-10 text-red-900 ring-red-300 placeholder:text-red-300 focus:ring-red-500' => $error
    ] | classes }}"
    {{ if js_driver }}{{ js_attributes }}{{ /if }}
>
    {{ unless multiple }}
        <option value>
            {{ if placeholder }}
                {{ placeholder }}
            {{ else }}
                {{ trans key="Please select..." }}
            {{ /if }}
        </option>
    {{ /unless }}
    {{ foreach:options as="option|label" }}
        <option value="{{ option }}"{{ if multiple }}{{ if value|in_array:option }} selected{{ /if }}{{ else }}{{ if option == value }} selected{{ /if }}{{ /if }}>
            {{ label !== null ? label : option }}
        </option>
    {{ /foreach:options }}
</select>
