AccordionAlertAlert DialogAspect RatioAvatarBadgeBreadcrumbButtonButton GroupCalendarCardCarouselChartCheckboxCollapsibleComboboxCommandContext MenuData TableDate PickerDialogDirectionDrawerDropdown MenuEmptyFieldHover CardInputInput GroupInput OTPItemKbdLabelMenubarNative SelectNavigation MenuPaginationPopoverProgressRadio GroupResizableScroll AreaSelectSeparatorSheetSidebarSkeletonSliderSonnerSpinnerSwitchTableTabsTextareaToastToggleToggle GroupTooltipTypography
Switch
A control that allows the user to toggle between checked and not checked.
templ
templ SwitchDemo() {
<div class="flex items-center space-x-2">
@ui.Switch("airplane-mode", false, false, "", templ.Attributes{"id": "airplane-mode"})
@ui.Label("", templ.Attributes{"for": "airplane-mode"}) {
Airplane Mode
}
</div>
}