View Source SaladUI.Select (SaladUI v1.0.0-beta.3)
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 value="apple">Apple</.select_item>
<.select_item value="banana">Banana</.select_item>
<.select_item value="blueberry">Blueberry</.select_item>
<.select_separator />
<.select_item disabled value="grapes">Grapes</.select_item>
<.select_item 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
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
value
(:string
) (required)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
class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
placeholder
(:string
) - Defaults tonil
.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
.multiple
(:boolean
) - Allow multiple selection. Defaults tofalse
.use-portal
(:boolean
) - Whether to render the content in a portal. Defaults tofalse
.portal-container
(:string
) - CSS selector for the portal container. Defaults tonil
.on-value-changed
(:any
) - Handler for value changed event. Defaults tonil
.on-open
(:any
) - Handler for select open event. Defaults tonil
.on-close
(:any
) - Handler for select closed event. 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
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
value
(:string
) (required)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
class
(:string
) - Defaults tonil
.- Global attributes are accepted.
Slots
inner_block
(required)
Attributes
placeholder
(:string
) - Defaults tonil
.class
(:string
) - Defaults tonil
.- Global attributes are accepted.