View Source SaladUI.Select (SaladUI v0.14.0)
Implement of select components from https://ui.shadcn.com/docs/components/select
Examples:
<form>
<.select default="banana" id="fruit-select">
<.select_trigger class="w-[180px]">
<.select_value placeholder=".select a fruit"/>
</.select_trigger>
<.select_content>
<.select_group>
<.select_label>Fruits</.select_label>
<.select_item name="fruit" value="apple">Apple</.select_item>
<.select_item name="fruit" value="banana">Banana</.select_item>
<.select_item name="fruit" value="blueberry">Blueberry</.select_item>
<.select_separator />
<.select_item name="fruit" disabled value="grapes">Grapes</.select_item>
<.select_item name="fruit" value="pineapple">Pineapple</.select_item>
</.select_group>
</.select_content>
</.select>
<.button type="submit">Submit</.button>
</form>
Summary
Functions
Ready to use select component with all required parts.
Attributes
builder
(:map
) (required) - The builder of the select component.class
(:string
) - Defaults tonil
.side
(:string
) - Defaults to"bottom"
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
builder
(:map
) (required) - The builder of the select component.value
(:string
) (required)label
(:string
) - Defaults tonil
.disabled
(:boolean
) - Defaults tofalse
.class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
builder
(:map
) (required) - The builder of the select component.class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Functions
Ready to use select component with all required parts.
Attributes
id
(:string
) - Defaults tonil
.name
(:any
) - Defaults tonil
.value
(:any
) - The value of the select. Defaults tonil
.default-value
(:any
) - The default value of the select. Defaults tonil
.field
(Phoenix.HTML.FormField
) - a form field struct retrieved from the form, for example: @form[:email].label
(:string
) - The display label of the select value. If not provided, the value will be used. Defaults tonil
.placeholder
(:string
) - The placeholder text when no value is selected. Defaults tonil
.class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
builder
(:map
) (required) - The builder of the select component.class
(:string
) - Defaults tonil
.side
(:string
) - Defaults to"bottom"
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
builder
(:map
) (required) - The builder of the select component.value
(:string
) (required)label
(:string
) - Defaults tonil
.disabled
(:boolean
) - Defaults tofalse
.class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
builder
(:map
) (required) - The builder of the select component.class
(:string
) - Defaults tonil
.- Global attributes are accepted.