AccordionAlertAlert DialogAspect RatioAvatarBadgeBreadcrumbButtonButton GroupCalendarCardCarouselChartCheckboxCollapsibleComboboxCommandContext MenuData TableDate PickerDialogDirectionDrawerDropdown MenuEmptyFieldHover CardInputInput GroupInput OTPItemKbdLabelMenubarNative SelectNavigation MenuPaginationPopoverProgressRadio GroupResizableScroll AreaSelectSeparatorSheetSidebarSkeletonSliderSonnerSpinnerSwitchTableTabsTextareaToastToggleToggle GroupTooltipTypography
Select
Displays a list of options for the user to pick from — triggered by a button.
Apple
Banana
Blueberry
Grapes
Pineapple
templ
templ SelectDemo() {
@ui.Select(
"fruit",
"sel_fruit",
"Select a fruit",
[]ui.SelectOption{
{Value: "apple", Label: "Apple"},
{Value: "banana", Label: "Banana"},
{Value: "blueberry", Label: "Blueberry"},
{Value: "grapes", Label: "Grapes"},
{Value: "pineapple", Label: "Pineapple"},
},
"w-[180px]",
nil,
)
}