horizon-design 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2444 -0
- package/dist/components/accordion/Accordion.svelte +36 -0
- package/dist/components/accordion/Accordion.svelte.d.ts +14 -0
- package/dist/components/accordion/AccordionItem.svelte +49 -0
- package/dist/components/accordion/AccordionItem.svelte.d.ts +11 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/action-bar/ActionBar.svelte +25 -0
- package/dist/components/action-bar/ActionBar.svelte.d.ts +9 -0
- package/dist/components/action-bar/ActionBarSeparator.svelte +18 -0
- package/dist/components/action-bar/ActionBarSeparator.svelte.d.ts +7 -0
- package/dist/components/action-bar/index.d.ts +2 -0
- package/dist/components/action-bar/index.js +2 -0
- package/dist/components/alert/Alert.svelte +78 -0
- package/dist/components/alert/Alert.svelte.d.ts +13 -0
- package/dist/components/alert/index.d.ts +1 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/alert-dialog/AlertDialog.svelte +89 -0
- package/dist/components/alert-dialog/AlertDialog.svelte.d.ts +16 -0
- package/dist/components/alert-dialog/index.d.ts +1 -0
- package/dist/components/alert-dialog/index.js +1 -0
- package/dist/components/angle-slider/AngleSlider.svelte +49 -0
- package/dist/components/angle-slider/AngleSlider.svelte.d.ts +12 -0
- package/dist/components/angle-slider/index.d.ts +1 -0
- package/dist/components/angle-slider/index.js +1 -0
- package/dist/components/announcement/Announcement.svelte +25 -0
- package/dist/components/announcement/Announcement.svelte.d.ts +9 -0
- package/dist/components/announcement/index.d.ts +1 -0
- package/dist/components/announcement/index.js +1 -0
- package/dist/components/aspect-ratio/AspectRatio.svelte +27 -0
- package/dist/components/aspect-ratio/AspectRatio.svelte.d.ts +10 -0
- package/dist/components/aspect-ratio/index.d.ts +1 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/avatar/Avatar.svelte +48 -0
- package/dist/components/avatar/Avatar.svelte.d.ts +12 -0
- package/dist/components/avatar/AvatarGroup.svelte +18 -0
- package/dist/components/avatar/AvatarGroup.svelte.d.ts +9 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/badge/Badge.svelte +42 -0
- package/dist/components/badge/Badge.svelte.d.ts +11 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/bottom-navigation/BottomNavigation.svelte +49 -0
- package/dist/components/bottom-navigation/BottomNavigation.svelte.d.ts +15 -0
- package/dist/components/bottom-navigation/index.d.ts +1 -0
- package/dist/components/bottom-navigation/index.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.svelte +49 -0
- package/dist/components/breadcrumb/Breadcrumb.svelte.d.ts +12 -0
- package/dist/components/breadcrumb/index.d.ts +1 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/button/Button.svelte +94 -0
- package/dist/components/button/Button.svelte.d.ts +14 -0
- package/dist/components/button/button-variants.d.ts +33 -0
- package/dist/components/button/button-variants.js +31 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/button-group/ButtonGroup.svelte +34 -0
- package/dist/components/button-group/ButtonGroup.svelte.d.ts +10 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/calendar/Calendar.svelte +180 -0
- package/dist/components/calendar/Calendar.svelte.d.ts +9 -0
- package/dist/components/calendar/index.d.ts +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/Card.svelte +52 -0
- package/dist/components/card/Card.svelte.d.ts +12 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/carousel/Carousel.svelte +67 -0
- package/dist/components/carousel/Carousel.svelte.d.ts +12 -0
- package/dist/components/carousel/index.d.ts +1 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/checkbox/Checkbox.svelte +64 -0
- package/dist/components/checkbox/Checkbox.svelte.d.ts +13 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/circular-progress/CircularProgress.svelte +82 -0
- package/dist/components/circular-progress/CircularProgress.svelte.d.ts +15 -0
- package/dist/components/circular-progress/index.d.ts +1 -0
- package/dist/components/circular-progress/index.js +1 -0
- package/dist/components/circular-slider/CircularSlider.svelte +115 -0
- package/dist/components/circular-slider/CircularSlider.svelte.d.ts +14 -0
- package/dist/components/circular-slider/circular-slider-context.d.ts +9 -0
- package/dist/components/circular-slider/circular-slider-context.js +8 -0
- package/dist/components/circular-slider/index.d.ts +1 -0
- package/dist/components/circular-slider/index.js +1 -0
- package/dist/components/clipboard/Clipboard.svelte +53 -0
- package/dist/components/clipboard/Clipboard.svelte.d.ts +10 -0
- package/dist/components/clipboard/index.d.ts +1 -0
- package/dist/components/clipboard/index.js +1 -0
- package/dist/components/collapsible/Collapsible.svelte +42 -0
- package/dist/components/collapsible/Collapsible.svelte.d.ts +12 -0
- package/dist/components/collapsible/index.d.ts +1 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/color-picker/ColorPicker.svelte +101 -0
- package/dist/components/color-picker/ColorPicker.svelte.d.ts +11 -0
- package/dist/components/color-picker/index.d.ts +1 -0
- package/dist/components/color-picker/index.js +1 -0
- package/dist/components/combobox/Combobox.svelte +73 -0
- package/dist/components/combobox/Combobox.svelte.d.ts +14 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/context-menu/ContextMenu.svelte +66 -0
- package/dist/components/context-menu/ContextMenu.svelte.d.ts +15 -0
- package/dist/components/context-menu/index.d.ts +1 -0
- package/dist/components/context-menu/index.js +1 -0
- package/dist/components/data-list/DataList.svelte +40 -0
- package/dist/components/data-list/DataList.svelte.d.ts +13 -0
- package/dist/components/data-list/index.d.ts +1 -0
- package/dist/components/data-list/index.js +1 -0
- package/dist/components/date-picker/DatePicker.svelte +173 -0
- package/dist/components/date-picker/DatePicker.svelte.d.ts +12 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/dialog/Dialog.svelte +93 -0
- package/dist/components/dialog/Dialog.svelte.d.ts +17 -0
- package/dist/components/dialog/DialogClose.svelte +44 -0
- package/dist/components/dialog/DialogClose.svelte.d.ts +9 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/drawer/Drawer.svelte +89 -0
- package/dist/components/drawer/Drawer.svelte.d.ts +17 -0
- package/dist/components/drawer/DrawerClose.svelte +16 -0
- package/dist/components/drawer/DrawerClose.svelte.d.ts +8 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/editable/Editable.svelte +44 -0
- package/dist/components/editable/Editable.svelte.d.ts +12 -0
- package/dist/components/editable/index.d.ts +1 -0
- package/dist/components/editable/index.js +1 -0
- package/dist/components/field/Field.svelte +44 -0
- package/dist/components/field/Field.svelte.d.ts +13 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/file-tree/FileTree.svelte +214 -0
- package/dist/components/file-tree/FileTree.svelte.d.ts +28 -0
- package/dist/components/file-tree/index.d.ts +3 -0
- package/dist/components/file-tree/index.js +2 -0
- package/dist/components/file-upload/FileUpload.svelte +50 -0
- package/dist/components/file-upload/FileUpload.svelte.d.ts +12 -0
- package/dist/components/file-upload/index.d.ts +1 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/float/Float.svelte +32 -0
- package/dist/components/float/Float.svelte.d.ts +10 -0
- package/dist/components/float/index.d.ts +1 -0
- package/dist/components/float/index.js +1 -0
- package/dist/components/floating-panel/FloatingPanel.svelte +66 -0
- package/dist/components/floating-panel/FloatingPanel.svelte.d.ts +13 -0
- package/dist/components/floating-panel/index.d.ts +1 -0
- package/dist/components/floating-panel/index.js +1 -0
- package/dist/components/frame/Frame.svelte +41 -0
- package/dist/components/frame/Frame.svelte.d.ts +10 -0
- package/dist/components/frame/index.d.ts +1 -0
- package/dist/components/frame/index.js +1 -0
- package/dist/components/hierarchy-view/HierarchyView.svelte +763 -0
- package/dist/components/hierarchy-view/HierarchyView.svelte.d.ts +27 -0
- package/dist/components/hierarchy-view/index.d.ts +1 -0
- package/dist/components/hierarchy-view/index.js +1 -0
- package/dist/components/hint/Hint.svelte +18 -0
- package/dist/components/hint/Hint.svelte.d.ts +9 -0
- package/dist/components/hint/index.d.ts +1 -0
- package/dist/components/hint/index.js +1 -0
- package/dist/components/horizon-layout/HorizonLayout.svelte +78 -0
- package/dist/components/horizon-layout/HorizonLayout.svelte.d.ts +51 -0
- package/dist/components/horizon-layout/horizon-layout.css +425 -0
- package/dist/components/horizon-layout/index.d.ts +2 -0
- package/dist/components/horizon-layout/index.js +2 -0
- package/dist/components/hover-card/HoverCard.svelte +41 -0
- package/dist/components/hover-card/HoverCard.svelte.d.ts +12 -0
- package/dist/components/hover-card/index.d.ts +1 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/image-cropper/ImageCropper.svelte +88 -0
- package/dist/components/image-cropper/ImageCropper.svelte.d.ts +11 -0
- package/dist/components/image-cropper/index.d.ts +1 -0
- package/dist/components/image-cropper/index.js +1 -0
- package/dist/components/input/Input.svelte +33 -0
- package/dist/components/input/Input.svelte.d.ts +9 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input-group/InputAddon.svelte +25 -0
- package/dist/components/input-group/InputAddon.svelte.d.ts +9 -0
- package/dist/components/input-group/InputGroup.svelte +25 -0
- package/dist/components/input-group/InputGroup.svelte.d.ts +9 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/index.js +2 -0
- package/dist/components/item/Item.svelte +25 -0
- package/dist/components/item/Item.svelte.d.ts +9 -0
- package/dist/components/item/index.d.ts +1 -0
- package/dist/components/item/index.js +1 -0
- package/dist/components/kbd/Kbd.svelte +25 -0
- package/dist/components/kbd/Kbd.svelte.d.ts +9 -0
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/kbd/index.js +1 -0
- package/dist/components/link-overlay/LinkBox.svelte +18 -0
- package/dist/components/link-overlay/LinkBox.svelte.d.ts +9 -0
- package/dist/components/link-overlay/LinkOverlay.svelte +25 -0
- package/dist/components/link-overlay/LinkOverlay.svelte.d.ts +10 -0
- package/dist/components/link-overlay/index.d.ts +2 -0
- package/dist/components/link-overlay/index.js +2 -0
- package/dist/components/listbox/Listbox.svelte +62 -0
- package/dist/components/listbox/Listbox.svelte.d.ts +20 -0
- package/dist/components/listbox/index.d.ts +1 -0
- package/dist/components/listbox/index.js +1 -0
- package/dist/components/marquee/Marquee.svelte +30 -0
- package/dist/components/marquee/Marquee.svelte.d.ts +10 -0
- package/dist/components/marquee/MarqueeItem.svelte +18 -0
- package/dist/components/marquee/MarqueeItem.svelte.d.ts +9 -0
- package/dist/components/marquee/index.d.ts +2 -0
- package/dist/components/marquee/index.js +2 -0
- package/dist/components/menu/Menu.svelte +43 -0
- package/dist/components/menu/Menu.svelte.d.ts +13 -0
- package/dist/components/menu/MenuGroup.svelte +21 -0
- package/dist/components/menu/MenuGroup.svelte.d.ts +10 -0
- package/dist/components/menu/MenuGroupLabel.svelte +23 -0
- package/dist/components/menu/MenuGroupLabel.svelte.d.ts +9 -0
- package/dist/components/menu/MenuItem.svelte +29 -0
- package/dist/components/menu/MenuItem.svelte.d.ts +10 -0
- package/dist/components/menu/MenuSeparator.svelte +18 -0
- package/dist/components/menu/MenuSeparator.svelte.d.ts +7 -0
- package/dist/components/menu/index.d.ts +5 -0
- package/dist/components/menu/index.js +5 -0
- package/dist/components/native-select/NativeSelect.svelte +31 -0
- package/dist/components/native-select/NativeSelect.svelte.d.ts +9 -0
- package/dist/components/native-select/index.d.ts +1 -0
- package/dist/components/native-select/index.js +1 -0
- package/dist/components/number-input/NumberInput.svelte +55 -0
- package/dist/components/number-input/NumberInput.svelte.d.ts +12 -0
- package/dist/components/number-input/index.d.ts +1 -0
- package/dist/components/number-input/index.js +1 -0
- package/dist/components/pagination/Pagination.svelte +63 -0
- package/dist/components/pagination/Pagination.svelte.d.ts +12 -0
- package/dist/components/pagination/PaginationContext.svelte +7 -0
- package/dist/components/pagination/PaginationContext.svelte.d.ts +4 -0
- package/dist/components/pagination/PaginationEllipsis.svelte +30 -0
- package/dist/components/pagination/PaginationEllipsis.svelte.d.ts +10 -0
- package/dist/components/pagination/PaginationItem.svelte +30 -0
- package/dist/components/pagination/PaginationItem.svelte.d.ts +10 -0
- package/dist/components/pagination/PaginationNextTrigger.svelte +26 -0
- package/dist/components/pagination/PaginationNextTrigger.svelte.d.ts +9 -0
- package/dist/components/pagination/PaginationPrevTrigger.svelte +26 -0
- package/dist/components/pagination/PaginationPrevTrigger.svelte.d.ts +9 -0
- package/dist/components/pagination/index.d.ts +6 -0
- package/dist/components/pagination/index.js +6 -0
- package/dist/components/pin-input/PinInput.svelte +45 -0
- package/dist/components/pin-input/PinInput.svelte.d.ts +13 -0
- package/dist/components/pin-input/index.d.ts +1 -0
- package/dist/components/pin-input/index.js +1 -0
- package/dist/components/popover/Popover.svelte +70 -0
- package/dist/components/popover/Popover.svelte.d.ts +16 -0
- package/dist/components/popover/PopoverClose.svelte +19 -0
- package/dist/components/popover/PopoverClose.svelte.d.ts +9 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +2 -0
- package/dist/components/progress/Progress.svelte +37 -0
- package/dist/components/progress/Progress.svelte.d.ts +13 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/prose/Prose.svelte +25 -0
- package/dist/components/prose/Prose.svelte.d.ts +9 -0
- package/dist/components/prose/index.d.ts +1 -0
- package/dist/components/prose/index.js +1 -0
- package/dist/components/qr-code/QrCode.svelte +25 -0
- package/dist/components/qr-code/QrCode.svelte.d.ts +10 -0
- package/dist/components/qr-code/index.d.ts +1 -0
- package/dist/components/qr-code/index.js +1 -0
- package/dist/components/radio-group/RadioGroup.svelte +81 -0
- package/dist/components/radio-group/RadioGroup.svelte.d.ts +19 -0
- package/dist/components/radio-group/index.d.ts +1 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/rating-group/RatingGroup.svelte +41 -0
- package/dist/components/rating-group/RatingGroup.svelte.d.ts +10 -0
- package/dist/components/rating-group/index.d.ts +1 -0
- package/dist/components/rating-group/index.js +1 -0
- package/dist/components/scroll-area/ScrollArea.svelte +36 -0
- package/dist/components/scroll-area/ScrollArea.svelte.d.ts +10 -0
- package/dist/components/scroll-area/index.d.ts +1 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/segment-group/SegmentGroup.svelte +74 -0
- package/dist/components/segment-group/SegmentGroup.svelte.d.ts +16 -0
- package/dist/components/segment-group/index.d.ts +1 -0
- package/dist/components/segment-group/index.js +1 -0
- package/dist/components/select/Select.svelte +84 -0
- package/dist/components/select/Select.svelte.d.ts +18 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/separator/Separator.svelte +27 -0
- package/dist/components/separator/Separator.svelte.d.ts +9 -0
- package/dist/components/separator/index.d.ts +1 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/sheet/Sheet.svelte +98 -0
- package/dist/components/sheet/Sheet.svelte.d.ts +17 -0
- package/dist/components/sheet/index.d.ts +1 -0
- package/dist/components/sheet/index.js +1 -0
- package/dist/components/sidebar/Sidebar.svelte +45 -0
- package/dist/components/sidebar/Sidebar.svelte.d.ts +12 -0
- package/dist/components/sidebar/SidebarItem.svelte +44 -0
- package/dist/components/sidebar/SidebarItem.svelte.d.ts +11 -0
- package/dist/components/sidebar/SidebarSection.svelte +25 -0
- package/dist/components/sidebar/SidebarSection.svelte.d.ts +10 -0
- package/dist/components/sidebar/index.d.ts +3 -0
- package/dist/components/sidebar/index.js +3 -0
- package/dist/components/signature-pad/SignaturePad.svelte +44 -0
- package/dist/components/signature-pad/SignaturePad.svelte.d.ts +11 -0
- package/dist/components/signature-pad/index.d.ts +1 -0
- package/dist/components/signature-pad/index.js +1 -0
- package/dist/components/skeleton/Skeleton.svelte +17 -0
- package/dist/components/skeleton/Skeleton.svelte.d.ts +7 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skip-nav/SkipNav.svelte +28 -0
- package/dist/components/skip-nav/SkipNav.svelte.d.ts +10 -0
- package/dist/components/skip-nav/index.d.ts +1 -0
- package/dist/components/skip-nav/index.js +1 -0
- package/dist/components/slider/Slider.svelte +55 -0
- package/dist/components/slider/Slider.svelte.d.ts +13 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/spinner/Spinner.svelte +31 -0
- package/dist/components/spinner/Spinner.svelte.d.ts +9 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/splitter/Splitter.svelte +29 -0
- package/dist/components/splitter/Splitter.svelte.d.ts +11 -0
- package/dist/components/splitter/SplitterPanel.svelte +21 -0
- package/dist/components/splitter/SplitterPanel.svelte.d.ts +10 -0
- package/dist/components/splitter/SplitterResizeTrigger.svelte +24 -0
- package/dist/components/splitter/SplitterResizeTrigger.svelte.d.ts +8 -0
- package/dist/components/splitter/index.d.ts +3 -0
- package/dist/components/splitter/index.js +3 -0
- package/dist/components/status/Status.svelte +28 -0
- package/dist/components/status/Status.svelte.d.ts +8 -0
- package/dist/components/status/index.d.ts +1 -0
- package/dist/components/status/index.js +1 -0
- package/dist/components/steps/Steps.svelte +90 -0
- package/dist/components/steps/Steps.svelte.d.ts +18 -0
- package/dist/components/steps/index.d.ts +1 -0
- package/dist/components/steps/index.js +1 -0
- package/dist/components/swap/Swap.svelte +32 -0
- package/dist/components/swap/Swap.svelte.d.ts +14 -0
- package/dist/components/swap/index.d.ts +1 -0
- package/dist/components/swap/index.js +1 -0
- package/dist/components/switch/Switch.svelte +130 -0
- package/dist/components/switch/Switch.svelte.d.ts +16 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/Table.svelte +69 -0
- package/dist/components/table/Table.svelte.d.ts +18 -0
- package/dist/components/table/TableBody.svelte +18 -0
- package/dist/components/table/TableBody.svelte.d.ts +9 -0
- package/dist/components/table/TableCell.svelte +25 -0
- package/dist/components/table/TableCell.svelte.d.ts +9 -0
- package/dist/components/table/TableHead.svelte +25 -0
- package/dist/components/table/TableHead.svelte.d.ts +9 -0
- package/dist/components/table/TableHeader.svelte +22 -0
- package/dist/components/table/TableHeader.svelte.d.ts +9 -0
- package/dist/components/table/TableRow.svelte +25 -0
- package/dist/components/table/TableRow.svelte.d.ts +9 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/Tabs.svelte +111 -0
- package/dist/components/tabs/Tabs.svelte.d.ts +19 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/textarea/Textarea.svelte +21 -0
- package/dist/components/textarea/Textarea.svelte.d.ts +7 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/theme-switch/ThemeSwitch.svelte +125 -0
- package/dist/components/theme-switch/ThemeSwitch.svelte.d.ts +7 -0
- package/dist/components/theme-switch/index.d.ts +1 -0
- package/dist/components/theme-switch/index.js +1 -0
- package/dist/components/thumb-card/ThumbCard.svelte +42 -0
- package/dist/components/thumb-card/ThumbCard.svelte.d.ts +11 -0
- package/dist/components/thumb-card/index.d.ts +1 -0
- package/dist/components/thumb-card/index.js +1 -0
- package/dist/components/timer/Timer.svelte +61 -0
- package/dist/components/timer/Timer.svelte.d.ts +11 -0
- package/dist/components/timer/index.d.ts +1 -0
- package/dist/components/timer/index.js +1 -0
- package/dist/components/toast/Toast.svelte +61 -0
- package/dist/components/toast/Toast.svelte.d.ts +13 -0
- package/dist/components/toast/Toaster.svelte +29 -0
- package/dist/components/toast/Toaster.svelte.d.ts +9 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toast/index.js +3 -0
- package/dist/components/toggle/Toggle.svelte +45 -0
- package/dist/components/toggle/Toggle.svelte.d.ts +13 -0
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/index.js +1 -0
- package/dist/components/toggle-group/ToggleGroup.svelte +43 -0
- package/dist/components/toggle-group/ToggleGroup.svelte.d.ts +15 -0
- package/dist/components/toggle-group/index.d.ts +1 -0
- package/dist/components/toggle-group/index.js +1 -0
- package/dist/components/toggle-tooltip/ToggleTooltip.svelte +40 -0
- package/dist/components/toggle-tooltip/ToggleTooltip.svelte.d.ts +11 -0
- package/dist/components/toggle-tooltip/index.d.ts +1 -0
- package/dist/components/toggle-tooltip/index.js +1 -0
- package/dist/components/tooltip/Tooltip.svelte +47 -0
- package/dist/components/tooltip/Tooltip.svelte.d.ts +14 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tour/Tour.svelte +126 -0
- package/dist/components/tour/Tour.svelte.d.ts +14 -0
- package/dist/components/tour/index.d.ts +1 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/fonts/EncodeSans.woff2 +0 -0
- package/dist/fonts/Lilex.woff2 +0 -0
- package/dist/horizon-design.css +716 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +91 -0
- package/dist/monaco-theme.d.ts +12 -0
- package/dist/monaco-theme.js +153 -0
- package/dist/theme.svelte.d.ts +12 -0
- package/dist/theme.svelte.js +52 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +5 -0
- package/package.json +76 -0
package/README.md
ADDED
|
@@ -0,0 +1,2444 @@
|
|
|
1
|
+
# horizon-design
|
|
2
|
+
|
|
3
|
+
Horizon's design system and Svelte 5 UI component library. Built on [Ark UI](https://ark-ui.com) for headless behaviour and [Tailwind CSS v4](https://tailwindcss.com) for styling, with OKLCH color tokens and full dark/light theme support.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add horizon-design
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import the global design CSS in your root layout:
|
|
14
|
+
|
|
15
|
+
```svelte
|
|
16
|
+
<!-- src/routes/+layout.svelte -->
|
|
17
|
+
<script>
|
|
18
|
+
import 'horizon-design/horizon-design.css';
|
|
19
|
+
</script>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The dark theme is the default (`:root`). Add `.light` to `<html>` for the light variant.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Developing
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pnpm dev # start the showcase app
|
|
30
|
+
pnpm check # svelte-check type checking
|
|
31
|
+
pnpm build # build library → dist/
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Components
|
|
37
|
+
|
|
38
|
+
### Accordion
|
|
39
|
+
|
|
40
|
+
Collapsible sections. `trigger` accepts a string or Snippet for rich content.
|
|
41
|
+
|
|
42
|
+
```svelte
|
|
43
|
+
<script>
|
|
44
|
+
import { Accordion, AccordionItem } from 'horizon-design';
|
|
45
|
+
|
|
46
|
+
let openItems = $state([]);
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<Accordion bind:value={openItems}>
|
|
50
|
+
<AccordionItem value="faq-1" trigger="Question?">Answer.</AccordionItem>
|
|
51
|
+
<AccordionItem value="faq-2" trigger="Another question?">Another answer.</AccordionItem>
|
|
52
|
+
</Accordion>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Component | Prop | Type | Default |
|
|
56
|
+
| --------------- | --------------- | ----------------------- | ----------- |
|
|
57
|
+
| `Accordion` | `collapsible` | `boolean` | `true` |
|
|
58
|
+
| | `multiple` | `boolean` | `false` |
|
|
59
|
+
| | `lazyMount` | `boolean` | `true` |
|
|
60
|
+
| | `unmountOnExit` | `boolean` | `true` |
|
|
61
|
+
| | `value` | `string[]` | `undefined` |
|
|
62
|
+
| | `defaultValue` | `string[]` | — |
|
|
63
|
+
| `AccordionItem` | `value` | `string` **(required)** | — |
|
|
64
|
+
| | `trigger` | `string \| Snippet` | — |
|
|
65
|
+
| | `disabled` | `boolean` | — |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### ActionBar
|
|
70
|
+
|
|
71
|
+
Floating contextual action bar for compact page-level actions.
|
|
72
|
+
|
|
73
|
+
```svelte
|
|
74
|
+
<script>
|
|
75
|
+
import { ActionBar, ActionBarSeparator, Button } from 'horizon-design';
|
|
76
|
+
import MingcuteArchiveLine from '~icons/mingcute/archive-line';
|
|
77
|
+
import MingcuteCopy2Line from '~icons/mingcute/copy2-line';
|
|
78
|
+
import MingcuteDelete2Line from '~icons/mingcute/delete2-line';
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<ActionBar>
|
|
82
|
+
<Button variant="ghost" size="icon-sm" aria-label="Archive">
|
|
83
|
+
<MingcuteArchiveLine class="size-4" />
|
|
84
|
+
</Button>
|
|
85
|
+
<Button variant="ghost" size="icon-sm" aria-label="Copy">
|
|
86
|
+
<MingcuteCopy2Line class="size-4" />
|
|
87
|
+
</Button>
|
|
88
|
+
<ActionBarSeparator />
|
|
89
|
+
<Button variant="ghost" size="icon-sm" aria-label="Delete">
|
|
90
|
+
<MingcuteDelete2Line class="size-4" />
|
|
91
|
+
</Button>
|
|
92
|
+
</ActionBar>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`ActionBar` is fixed to the bottom center by default. Use `ActionBarSeparator` to split action groups.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Alert
|
|
100
|
+
|
|
101
|
+
Contextual feedback message with icon, title, and description.
|
|
102
|
+
|
|
103
|
+
```svelte
|
|
104
|
+
<script>
|
|
105
|
+
import { Alert } from 'horizon-design';
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<Alert variant="success" title="Saved!" description="Your changes were saved successfully." />
|
|
109
|
+
<Alert variant="error" title="Error" description="Something went wrong." />
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
| Prop | Type | Default |
|
|
113
|
+
| ------------- | -------------------------------------------------------------- | ------------------------ |
|
|
114
|
+
| `variant` | `'info' \| 'success' \| 'warning' \| 'error' \| 'destructive'` | `'info'` |
|
|
115
|
+
| `title` | `string` | — |
|
|
116
|
+
| `description` | `string` | — |
|
|
117
|
+
| `icon` | `Snippet` | default icon per variant |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### AlertDialog
|
|
122
|
+
|
|
123
|
+
A confirmation dialog that prevents accidental actions.
|
|
124
|
+
|
|
125
|
+
```svelte
|
|
126
|
+
<script>
|
|
127
|
+
import { AlertDialog } from 'horizon-design';
|
|
128
|
+
import { buttonVariants } from 'horizon-design';
|
|
129
|
+
import MingcuteDelete2Line from '~icons/mingcute/delete2-line';
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
{#snippet trigger()}
|
|
133
|
+
<MingcuteDelete2Line class="size-4" />
|
|
134
|
+
Delete
|
|
135
|
+
{/snippet}
|
|
136
|
+
|
|
137
|
+
<AlertDialog
|
|
138
|
+
{trigger}
|
|
139
|
+
triggerClass={buttonVariants({ variant: 'destructive' })}
|
|
140
|
+
title="Are you absolutely sure?"
|
|
141
|
+
description="This action cannot be undone."
|
|
142
|
+
cancelLabel="Cancel"
|
|
143
|
+
actionLabel="Delete"
|
|
144
|
+
/>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
| Prop | Type | Default |
|
|
148
|
+
| -------------- | --------- | ----------- |
|
|
149
|
+
| `trigger` | `Snippet` | — |
|
|
150
|
+
| `triggerClass` | `string` | `''` |
|
|
151
|
+
| `title` | `string` | — |
|
|
152
|
+
| `description` | `string` | — |
|
|
153
|
+
| `cancelLabel` | `string` | `'Cancel'` |
|
|
154
|
+
| `actionLabel` | `string` | `'Confirm'` |
|
|
155
|
+
| `cancelClass` | `string` | — |
|
|
156
|
+
| `actionClass` | `string` | — |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### AngleSlider
|
|
161
|
+
|
|
162
|
+
A circular drag-handle for picking an angle (0–360°).
|
|
163
|
+
|
|
164
|
+
```svelte
|
|
165
|
+
<script>
|
|
166
|
+
import { AngleSlider } from 'horizon-design';
|
|
167
|
+
|
|
168
|
+
let angle = $state(45);
|
|
169
|
+
</script>
|
|
170
|
+
|
|
171
|
+
<AngleSlider bind:value={angle} />
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| Prop | Type | Default |
|
|
175
|
+
| -------------- | -------- | ------- |
|
|
176
|
+
| `value` | `number` | `0` |
|
|
177
|
+
| `defaultValue` | `number` | — |
|
|
178
|
+
| `size` | `number` | `120` |
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### Announcement
|
|
183
|
+
|
|
184
|
+
A compact pill-shaped badge for highlighting news or updates.
|
|
185
|
+
|
|
186
|
+
```svelte
|
|
187
|
+
<script>
|
|
188
|
+
import { Announcement } from 'horizon-design';
|
|
189
|
+
import { MingcuteLightningLine } from '~icons/mingcute/lightning-line';
|
|
190
|
+
</script>
|
|
191
|
+
|
|
192
|
+
<Announcement>
|
|
193
|
+
<MingcuteLightningLine class="size-3.5" />
|
|
194
|
+
New: horizon-design
|
|
195
|
+
</Announcement>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
### AspectRatio
|
|
201
|
+
|
|
202
|
+
Maintains a fixed aspect ratio for its children.
|
|
203
|
+
|
|
204
|
+
```svelte
|
|
205
|
+
<script>
|
|
206
|
+
import { AspectRatio } from 'horizon-design';
|
|
207
|
+
</script>
|
|
208
|
+
|
|
209
|
+
<AspectRatio ratio={16 / 9} class="overflow-hidden rounded-lg">
|
|
210
|
+
<img src="/photo.jpg" alt="Photo" class="h-full w-full object-cover" />
|
|
211
|
+
</AspectRatio>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
| Prop | Type | Default |
|
|
215
|
+
| ------- | -------- | ------- |
|
|
216
|
+
| `ratio` | `number` | `1` |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
### Avatar
|
|
221
|
+
|
|
222
|
+
User avatar with image and text fallback.
|
|
223
|
+
|
|
224
|
+
```svelte
|
|
225
|
+
<script>
|
|
226
|
+
import { Avatar, AvatarGroup } from 'horizon-design';
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<Avatar src="/photo.jpg" alt="User" fallback="AB" size="md" />
|
|
230
|
+
|
|
231
|
+
<AvatarGroup>
|
|
232
|
+
<Avatar fallback="A" />
|
|
233
|
+
<Avatar fallback="B" />
|
|
234
|
+
<Avatar fallback="C" />
|
|
235
|
+
</AvatarGroup>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
| Prop | Type | Default |
|
|
239
|
+
| ---------- | ------------------------------ | ------- |
|
|
240
|
+
| `src` | `string` | — |
|
|
241
|
+
| `alt` | `string` | — |
|
|
242
|
+
| `fallback` | `string` | — |
|
|
243
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` |
|
|
244
|
+
|
|
245
|
+
`AvatarGroup` is a layout wrapper that overlaps its children with negative margins.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
### Badge
|
|
250
|
+
|
|
251
|
+
Small status or label indicator.
|
|
252
|
+
|
|
253
|
+
```svelte
|
|
254
|
+
<script>
|
|
255
|
+
import { Badge } from 'horizon-design';
|
|
256
|
+
</script>
|
|
257
|
+
|
|
258
|
+
<Badge>New</Badge>
|
|
259
|
+
<Badge variant="success">Active</Badge>
|
|
260
|
+
<Badge variant="warning">Pending</Badge>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
| Prop | Type | Default |
|
|
264
|
+
| --------- | -------------------------------------------------------------------------------------------- | ----------- |
|
|
265
|
+
| `variant` | `'default' \| 'secondary' \| 'outline' \| 'destructive' \| 'success' \| 'warning' \| 'info'` | `'default'` |
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
### BottomNavigation
|
|
270
|
+
|
|
271
|
+
Fixed bottom navigation bar for mobile interfaces. `icon` in each item is a Snippet.
|
|
272
|
+
|
|
273
|
+
```svelte
|
|
274
|
+
<script>
|
|
275
|
+
import { BottomNavigation } from 'horizon-design';
|
|
276
|
+
import MingcuteHomeLine from '~icons/mingcute/home-line';
|
|
277
|
+
import MingcuteSearchLine from '~icons/mingcute/search-line';
|
|
278
|
+
</script>
|
|
279
|
+
|
|
280
|
+
{#snippet iconHome()}<MingcuteHomeLine class="size-5" />{/snippet}
|
|
281
|
+
{#snippet iconSearch()}<MingcuteSearchLine class="size-5" />{/snippet}
|
|
282
|
+
|
|
283
|
+
<BottomNavigation
|
|
284
|
+
items={[
|
|
285
|
+
{ label: 'Home', href: '/', icon: iconHome, active: true },
|
|
286
|
+
{ label: 'Search', href: '/search', icon: iconSearch }
|
|
287
|
+
]}
|
|
288
|
+
/>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
| Prop | Type | Default |
|
|
292
|
+
| ------- | -------------------------------------------------------------------------- | ------- |
|
|
293
|
+
| `items` | `Array<{ label: string; href: string; icon?: Snippet; active?: boolean }>` | `[]` |
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
### Breadcrumb
|
|
298
|
+
|
|
299
|
+
Navigation trail showing the current page location.
|
|
300
|
+
|
|
301
|
+
```svelte
|
|
302
|
+
<script>
|
|
303
|
+
import { Breadcrumb } from 'horizon-design';
|
|
304
|
+
</script>
|
|
305
|
+
|
|
306
|
+
<Breadcrumb
|
|
307
|
+
items={[
|
|
308
|
+
{ label: 'Home', href: '/' },
|
|
309
|
+
{ label: 'Components', href: '/components' },
|
|
310
|
+
{ label: 'Breadcrumb' }
|
|
311
|
+
]}
|
|
312
|
+
/>
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
| Prop | Type | Default |
|
|
316
|
+
| ------- | ----------------------------------------- | ------- |
|
|
317
|
+
| `items` | `Array<{ label: string; href?: string }>` | `[]` |
|
|
318
|
+
|
|
319
|
+
The last item (without `href`) is treated as the current page (`aria-current="page"`).
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
### Button
|
|
324
|
+
|
|
325
|
+
Primary interactive element.
|
|
326
|
+
|
|
327
|
+
```svelte
|
|
328
|
+
<script>
|
|
329
|
+
import { Button, buttonVariants } from 'horizon-design';
|
|
330
|
+
</script>
|
|
331
|
+
|
|
332
|
+
<Button>Click me</Button>
|
|
333
|
+
<Button variant="outline" size="lg">Outline</Button>
|
|
334
|
+
<Button isLoading>Saving…</Button>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
| Prop | Type | Default |
|
|
338
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------- | ----------- |
|
|
339
|
+
| `variant` | `'default' \| 'outline' \| 'secondary' \| 'ghost' \| 'link' \| 'destructive' \| 'success' \| 'warning' \| 'info'` | `'default'` |
|
|
340
|
+
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'icon-xs' \| 'icon-sm' \| 'icon-md' \| 'icon-lg' \| 'icon-xl'` | `'md'` |
|
|
341
|
+
| `isLoading` | `boolean` | `false` |
|
|
342
|
+
| `clickEffect` | `boolean` | `true` |
|
|
343
|
+
| `pill` | `boolean` | `false` |
|
|
344
|
+
| `disabled` | `boolean` | `false` |
|
|
345
|
+
|
|
346
|
+
`buttonVariants({ variant, size })` returns the class string for use on non-button elements.
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
### ButtonGroup
|
|
351
|
+
|
|
352
|
+
Groups buttons into a visually connected row.
|
|
353
|
+
|
|
354
|
+
```svelte
|
|
355
|
+
<script>
|
|
356
|
+
import { ButtonGroup } from 'horizon-design';
|
|
357
|
+
import { Button } from 'horizon-design';
|
|
358
|
+
</script>
|
|
359
|
+
|
|
360
|
+
<ButtonGroup>
|
|
361
|
+
<Button variant="outline" size="sm">Cut</Button>
|
|
362
|
+
<Button variant="outline" size="sm">Copy</Button>
|
|
363
|
+
<Button variant="outline" size="sm">Paste</Button>
|
|
364
|
+
</ButtonGroup>
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
### Calendar
|
|
370
|
+
|
|
371
|
+
Standalone inline date picker (no popover). Built on the DatePicker primitive with `inline` mode.
|
|
372
|
+
|
|
373
|
+
```svelte
|
|
374
|
+
<script>
|
|
375
|
+
import { Calendar } from 'horizon-design';
|
|
376
|
+
</script>
|
|
377
|
+
|
|
378
|
+
<Calendar onValueChange={(d) => console.log(d.value)} />
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Supports all DatePicker props: `value`, `defaultValue`, `min`, `max`, `selectionMode` (`'single' | 'range' | 'multiple'`), `onValueChange`.
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
### Card
|
|
386
|
+
|
|
387
|
+
Content container with optional header and footer.
|
|
388
|
+
|
|
389
|
+
```svelte
|
|
390
|
+
<script>
|
|
391
|
+
import { Card } from 'horizon-design';
|
|
392
|
+
import { Button } from 'horizon-design';
|
|
393
|
+
</script>
|
|
394
|
+
|
|
395
|
+
<Card title="Title" description="Subtitle">
|
|
396
|
+
Body content goes here.
|
|
397
|
+
{#snippet footer()}
|
|
398
|
+
<Button>Save</Button>
|
|
399
|
+
{/snippet}
|
|
400
|
+
</Card>
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
| Prop | Type | Default |
|
|
404
|
+
| ------------- | --------- | ------- |
|
|
405
|
+
| `title` | `string` | — |
|
|
406
|
+
| `description` | `string` | — |
|
|
407
|
+
| `footer` | `Snippet` | — |
|
|
408
|
+
| `class` | `string` | `''` |
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
### Carousel
|
|
413
|
+
|
|
414
|
+
Slideshow with prev/next controls and indicator dots. Each slide is a Snippet.
|
|
415
|
+
|
|
416
|
+
```svelte
|
|
417
|
+
<script>
|
|
418
|
+
import { Carousel } from 'horizon-design';
|
|
419
|
+
</script>
|
|
420
|
+
|
|
421
|
+
{#snippet slide1()}
|
|
422
|
+
<div class="flex h-40 items-center justify-center rounded-lg bg-blue-100">Slide 1</div>
|
|
423
|
+
{/snippet}
|
|
424
|
+
{#snippet slide2()}
|
|
425
|
+
<div class="flex h-40 items-center justify-center rounded-lg bg-green-100">Slide 2</div>
|
|
426
|
+
{/snippet}
|
|
427
|
+
|
|
428
|
+
<Carousel slides={[slide1, slide2]} />
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
| Prop | Type | Default |
|
|
432
|
+
| ---------------- | ----------- | ------- |
|
|
433
|
+
| `slides` | `Snippet[]` | `[]` |
|
|
434
|
+
| `showIndicators` | `boolean` | `true` |
|
|
435
|
+
| `showArrows` | `boolean` | `true` |
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
### Checkbox
|
|
440
|
+
|
|
441
|
+
Accessible checkbox with label.
|
|
442
|
+
|
|
443
|
+
```svelte
|
|
444
|
+
<script>
|
|
445
|
+
import { Checkbox } from 'horizon-design';
|
|
446
|
+
|
|
447
|
+
let accepted = $state(false);
|
|
448
|
+
</script>
|
|
449
|
+
|
|
450
|
+
<Checkbox label="Accept terms" bind:checked={accepted} />
|
|
451
|
+
<Checkbox label="Newsletter" defaultChecked />
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
| Prop | Type | Default |
|
|
455
|
+
| ---------------- | --------- | ------- |
|
|
456
|
+
| `label` | `string` | — |
|
|
457
|
+
| `checked` | `boolean` | — |
|
|
458
|
+
| `defaultChecked` | `boolean` | — |
|
|
459
|
+
| `disabled` | `boolean` | — |
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
### CircularProgress
|
|
464
|
+
|
|
465
|
+
SVG ring progress indicator with percentage label.
|
|
466
|
+
|
|
467
|
+
```svelte
|
|
468
|
+
<script>
|
|
469
|
+
import { CircularProgress } from 'horizon-design';
|
|
470
|
+
</script>
|
|
471
|
+
|
|
472
|
+
<CircularProgress value={72} showLabel />
|
|
473
|
+
<CircularProgress value={72} label="Complete" />
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
| Prop | Type | Default |
|
|
477
|
+
| ----------- | --------- | ------- |
|
|
478
|
+
| `value` | `number` | `0` |
|
|
479
|
+
| `max` | `number` | `100` |
|
|
480
|
+
| `showLabel` | `boolean` | `true` |
|
|
481
|
+
| `label` | `string` | — |
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
### CircularSlider
|
|
486
|
+
|
|
487
|
+
A circular angle-based slider rendered with SVG rings, with an optional value display.
|
|
488
|
+
|
|
489
|
+
```svelte
|
|
490
|
+
<script>
|
|
491
|
+
import { CircularSlider } from 'horizon-design';
|
|
492
|
+
|
|
493
|
+
let angle = $state(90);
|
|
494
|
+
</script>
|
|
495
|
+
|
|
496
|
+
<CircularSlider size={120} thickness={8} bind:value={angle} suffix="°" />
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
| Prop | Type | Default |
|
|
500
|
+
| ----------- | --------- | ------- |
|
|
501
|
+
| `size` | `number` | `100` |
|
|
502
|
+
| `thickness` | `number` | `6` |
|
|
503
|
+
| `step` | `number` | `1` |
|
|
504
|
+
| `showValue` | `boolean` | `true` |
|
|
505
|
+
| `prefix` | `string` | `''` |
|
|
506
|
+
| `suffix` | `string` | `''` |
|
|
507
|
+
| `value` | `number` | `0` |
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
### Clipboard
|
|
512
|
+
|
|
513
|
+
Copy-to-clipboard input with a toggle trigger icon.
|
|
514
|
+
|
|
515
|
+
```svelte
|
|
516
|
+
<script>
|
|
517
|
+
import { Clipboard } from 'horizon-design';
|
|
518
|
+
</script>
|
|
519
|
+
|
|
520
|
+
<Clipboard value="npm install horizon-design" label="Install command" />
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
| Prop | Type | Default |
|
|
524
|
+
| ------- | ----------------------- | ------- |
|
|
525
|
+
| `value` | `string` **(required)** | — |
|
|
526
|
+
| `label` | `string` | — |
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
### Collapsible
|
|
531
|
+
|
|
532
|
+
A section that can be toggled open or closed.
|
|
533
|
+
|
|
534
|
+
```svelte
|
|
535
|
+
<script>
|
|
536
|
+
import { Collapsible } from 'horizon-design';
|
|
537
|
+
|
|
538
|
+
let open = $state(false);
|
|
539
|
+
</script>
|
|
540
|
+
|
|
541
|
+
<Collapsible bind:open>
|
|
542
|
+
{#snippet trigger()}Toggle{/snippet}
|
|
543
|
+
Hidden content
|
|
544
|
+
</Collapsible>
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
| Prop | Type | Default |
|
|
548
|
+
| ------------- | --------- | ------- |
|
|
549
|
+
| `trigger` | `Snippet` | — |
|
|
550
|
+
| `open` | `boolean` | `false` |
|
|
551
|
+
| `defaultOpen` | `boolean` | — |
|
|
552
|
+
| `disabled` | `boolean` | — |
|
|
553
|
+
|
|
554
|
+
---
|
|
555
|
+
|
|
556
|
+
### ColorPicker
|
|
557
|
+
|
|
558
|
+
Full-featured HSLA color picker with hex input and swatches.
|
|
559
|
+
|
|
560
|
+
```svelte
|
|
561
|
+
<script>
|
|
562
|
+
import { ColorPicker } from 'horizon-design';
|
|
563
|
+
|
|
564
|
+
let color = $state('#737efa');
|
|
565
|
+
</script>
|
|
566
|
+
|
|
567
|
+
<ColorPicker label="Brand color" bind:value={color} />
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
| Prop | Type | Default |
|
|
571
|
+
| -------------- | -------- | ------- |
|
|
572
|
+
| `label` | `string` | — |
|
|
573
|
+
| `defaultValue` | `string` | — |
|
|
574
|
+
| `value` | `string` | — |
|
|
575
|
+
|
|
576
|
+
---
|
|
577
|
+
|
|
578
|
+
### Combobox
|
|
579
|
+
|
|
580
|
+
Searchable dropdown that filters a list of options.
|
|
581
|
+
|
|
582
|
+
```svelte
|
|
583
|
+
<script>
|
|
584
|
+
import { Combobox } from 'horizon-design';
|
|
585
|
+
|
|
586
|
+
const items = [
|
|
587
|
+
{ label: 'Svelte', value: 'svelte' },
|
|
588
|
+
{ label: 'React', value: 'react' }
|
|
589
|
+
];
|
|
590
|
+
</script>
|
|
591
|
+
|
|
592
|
+
<Combobox {items} label="Framework" placeholder="Search…" />
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
| Prop | Type | Default |
|
|
596
|
+
| ------------- | ----------------------------------------- | ----------- |
|
|
597
|
+
| `items` | `Array<{ label: string; value: string }>` | `[]` |
|
|
598
|
+
| `label` | `string` | — |
|
|
599
|
+
| `placeholder` | `string` | `'Search…'` |
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
### ContextMenu
|
|
604
|
+
|
|
605
|
+
Menu triggered on right-click. Pass the target area as `children`.
|
|
606
|
+
|
|
607
|
+
```svelte
|
|
608
|
+
<script>
|
|
609
|
+
import { ContextMenu } from 'horizon-design';
|
|
610
|
+
</script>
|
|
611
|
+
|
|
612
|
+
{#snippet area()}
|
|
613
|
+
<div class="rounded-lg border-2 border-dashed p-4">Right-click here</div>
|
|
614
|
+
{/snippet}
|
|
615
|
+
|
|
616
|
+
<ContextMenu
|
|
617
|
+
items={[
|
|
618
|
+
{ type: 'label', label: 'Actions' },
|
|
619
|
+
{ type: 'separator' },
|
|
620
|
+
{ value: 'edit', label: 'Edit' },
|
|
621
|
+
{ value: 'copy', label: 'Copy' },
|
|
622
|
+
{ type: 'separator' },
|
|
623
|
+
{ value: 'delete', label: 'Delete' }
|
|
624
|
+
]}
|
|
625
|
+
>
|
|
626
|
+
{@render area()}
|
|
627
|
+
</ContextMenu>
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
| Prop | Type | Default |
|
|
631
|
+
| ---------- | -------------------------------------------------------------------------------------------------------- | ------- |
|
|
632
|
+
| `items` | `Array<{ type?: 'item' \| 'separator' \| 'label'; value?: string; label?: string; disabled?: boolean }>` | `[]` |
|
|
633
|
+
| `children` | `Snippet` | — |
|
|
634
|
+
|
|
635
|
+
---
|
|
636
|
+
|
|
637
|
+
### DataList
|
|
638
|
+
|
|
639
|
+
Key–value pair list. Values can be strings or Snippets.
|
|
640
|
+
|
|
641
|
+
```svelte
|
|
642
|
+
<script>
|
|
643
|
+
import { DataList } from 'horizon-design';
|
|
644
|
+
</script>
|
|
645
|
+
|
|
646
|
+
{#snippet statusBadge()}
|
|
647
|
+
<Badge variant="success">Active</Badge>
|
|
648
|
+
{/snippet}
|
|
649
|
+
|
|
650
|
+
<DataList
|
|
651
|
+
items={[
|
|
652
|
+
{ label: 'Name', value: 'John Doe' },
|
|
653
|
+
{ label: 'Role', value: 'Admin' },
|
|
654
|
+
{ label: 'Status', value: statusBadge }
|
|
655
|
+
]}
|
|
656
|
+
/>
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
| Prop | Type | Default |
|
|
660
|
+
| ------- | ---------------------------------------------------- | ------- |
|
|
661
|
+
| `items` | `Array<{ label: string; value: string \| Snippet }>` | `[]` |
|
|
662
|
+
|
|
663
|
+
---
|
|
664
|
+
|
|
665
|
+
### DatePicker
|
|
666
|
+
|
|
667
|
+
Date picker with a calendar popover.
|
|
668
|
+
|
|
669
|
+
```svelte
|
|
670
|
+
<script>
|
|
671
|
+
import { DatePicker } from 'horizon-design';
|
|
672
|
+
|
|
673
|
+
let selectedDates = $state([]);
|
|
674
|
+
</script>
|
|
675
|
+
|
|
676
|
+
<DatePicker label="Event date" bind:value={selectedDates} placeholder="Pick a date" />
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
| Prop | Type | Default |
|
|
680
|
+
| -------------- | ------------- | ------- |
|
|
681
|
+
| `label` | `string` | — |
|
|
682
|
+
| `placeholder` | `string` | — |
|
|
683
|
+
| `value` | `DateValue[]` | — |
|
|
684
|
+
| `defaultValue` | `DateValue[]` | — |
|
|
685
|
+
|
|
686
|
+
---
|
|
687
|
+
|
|
688
|
+
### Dialog
|
|
689
|
+
|
|
690
|
+
Modal dialog with backdrop.
|
|
691
|
+
|
|
692
|
+
```svelte
|
|
693
|
+
<script>
|
|
694
|
+
import { Dialog } from 'horizon-design';
|
|
695
|
+
import { Button } from 'horizon-design';
|
|
696
|
+
|
|
697
|
+
let open = $state(false);
|
|
698
|
+
</script>
|
|
699
|
+
|
|
700
|
+
<Dialog title="Edit Profile" description="Update your information." bind:open>
|
|
701
|
+
{#snippet trigger()}
|
|
702
|
+
<Button variant="outline">Edit</Button>
|
|
703
|
+
{/snippet}
|
|
704
|
+
<p>Form fields go here.</p>
|
|
705
|
+
{#snippet footer()}
|
|
706
|
+
<Button variant="outline" onclick={() => (open = false)}>Cancel</Button>
|
|
707
|
+
<Button>Save</Button>
|
|
708
|
+
{/snippet}
|
|
709
|
+
</Dialog>
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
| Prop | Type | Default |
|
|
713
|
+
| -------------- | --------- | ------- |
|
|
714
|
+
| `trigger` | `Snippet` | — |
|
|
715
|
+
| `triggerClass` | `string` | `''` |
|
|
716
|
+
| `title` | `string` | — |
|
|
717
|
+
| `description` | `string` | — |
|
|
718
|
+
| `footer` | `Snippet` | — |
|
|
719
|
+
| `showClose` | `boolean` | `true` |
|
|
720
|
+
| `open` | `boolean` | `false` |
|
|
721
|
+
| `defaultOpen` | `boolean` | — |
|
|
722
|
+
| `modal` | `boolean` | `true` |
|
|
723
|
+
|
|
724
|
+
---
|
|
725
|
+
|
|
726
|
+
### Drawer
|
|
727
|
+
|
|
728
|
+
Slide-in panel from an edge of the viewport.
|
|
729
|
+
|
|
730
|
+
```svelte
|
|
731
|
+
<script>
|
|
732
|
+
import { Drawer } from 'horizon-design';
|
|
733
|
+
import { Button } from 'horizon-design';
|
|
734
|
+
|
|
735
|
+
let open = $state(false);
|
|
736
|
+
</script>
|
|
737
|
+
|
|
738
|
+
<Drawer title="Settings" side="right" bind:open>
|
|
739
|
+
{#snippet trigger()}
|
|
740
|
+
<Button variant="outline">Open</Button>
|
|
741
|
+
{/snippet}
|
|
742
|
+
<p>Drawer body.</p>
|
|
743
|
+
</Drawer>
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
| Prop | Type | Default |
|
|
747
|
+
| -------------- | ---------------------------------------- | --------- |
|
|
748
|
+
| `trigger` | `Snippet` | — |
|
|
749
|
+
| `triggerClass` | `string` | `''` |
|
|
750
|
+
| `title` | `string` | — |
|
|
751
|
+
| `description` | `string` | — |
|
|
752
|
+
| `footer` | `Snippet` | — |
|
|
753
|
+
| `side` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'right'` |
|
|
754
|
+
| `showClose` | `boolean` | `true` |
|
|
755
|
+
| `open` | `boolean` | `false` |
|
|
756
|
+
| `defaultOpen` | `boolean` | — |
|
|
757
|
+
|
|
758
|
+
---
|
|
759
|
+
|
|
760
|
+
### Editable
|
|
761
|
+
|
|
762
|
+
Inline-editable text field that shows a preview until clicked.
|
|
763
|
+
|
|
764
|
+
```svelte
|
|
765
|
+
<script>
|
|
766
|
+
import { Editable } from 'horizon-design';
|
|
767
|
+
|
|
768
|
+
let name = $state('Click me to edit');
|
|
769
|
+
</script>
|
|
770
|
+
|
|
771
|
+
<Editable label="Display Name" bind:value={name} />
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
| Prop | Type | Default |
|
|
775
|
+
| -------------- | -------- | ------- |
|
|
776
|
+
| `label` | `string` | — |
|
|
777
|
+
| `defaultValue` | `string` | — |
|
|
778
|
+
| `value` | `string` | — |
|
|
779
|
+
| `placeholder` | `string` | — |
|
|
780
|
+
|
|
781
|
+
---
|
|
782
|
+
|
|
783
|
+
### Field
|
|
784
|
+
|
|
785
|
+
Wraps a form control with accessible label, helper text, and error text.
|
|
786
|
+
|
|
787
|
+
```svelte
|
|
788
|
+
<script>
|
|
789
|
+
import { Field } from 'horizon-design';
|
|
790
|
+
import { Input } from 'horizon-design';
|
|
791
|
+
</script>
|
|
792
|
+
|
|
793
|
+
<Field label="Email" helperText="We'll never share your email.">
|
|
794
|
+
<Input type="email" />
|
|
795
|
+
</Field>
|
|
796
|
+
|
|
797
|
+
<Field invalid label="Email" errorText="Invalid email address.">
|
|
798
|
+
<Input type="email" />
|
|
799
|
+
</Field>
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
`label`, `helperText`, and `errorText` accept a string or a `Snippet` for rich content.
|
|
803
|
+
|
|
804
|
+
| Prop | Type | Default |
|
|
805
|
+
| ------------ | ------------------- | ------- |
|
|
806
|
+
| `label` | `string \| Snippet` | — |
|
|
807
|
+
| `helperText` | `string \| Snippet` | — |
|
|
808
|
+
| `errorText` | `string \| Snippet` | — |
|
|
809
|
+
| `invalid` | `boolean` | — |
|
|
810
|
+
| `disabled` | `boolean` | — |
|
|
811
|
+
| `required` | `boolean` | — |
|
|
812
|
+
|
|
813
|
+
---
|
|
814
|
+
|
|
815
|
+
### FileUpload
|
|
816
|
+
|
|
817
|
+
Drag-and-drop file upload area with a hidden file input.
|
|
818
|
+
|
|
819
|
+
```svelte
|
|
820
|
+
<script>
|
|
821
|
+
import { FileUpload } from 'horizon-design';
|
|
822
|
+
</script>
|
|
823
|
+
|
|
824
|
+
<FileUpload label="Attachments" accept="image/*" maxFiles={3} />
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
| Prop | Type | Default |
|
|
828
|
+
| ------------- | -------- | ------- |
|
|
829
|
+
| `label` | `string` | — |
|
|
830
|
+
| `accept` | `string` | — |
|
|
831
|
+
| `maxFiles` | `number` | — |
|
|
832
|
+
| `maxFileSize` | `number` | — |
|
|
833
|
+
|
|
834
|
+
---
|
|
835
|
+
|
|
836
|
+
### Float
|
|
837
|
+
|
|
838
|
+
Positions its children as a floating overlay (e.g. FAB button).
|
|
839
|
+
|
|
840
|
+
```svelte
|
|
841
|
+
<script>
|
|
842
|
+
import { Float } from 'horizon-design';
|
|
843
|
+
import { Button } from 'horizon-design';
|
|
844
|
+
</script>
|
|
845
|
+
|
|
846
|
+
<Float position="bottom-right">
|
|
847
|
+
<Button size="icon-md" class="rounded-full shadow-lg">+</Button>
|
|
848
|
+
</Float>
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
| Prop | Type | Default |
|
|
852
|
+
| ---------- | -------------------------------------------------------------- | ---------------- |
|
|
853
|
+
| `position` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'bottom-right'` |
|
|
854
|
+
|
|
855
|
+
---
|
|
856
|
+
|
|
857
|
+
### FloatingPanel
|
|
858
|
+
|
|
859
|
+
A draggable floating panel anchored to a trigger button. Drag the header to reposition.
|
|
860
|
+
|
|
861
|
+
```svelte
|
|
862
|
+
<script>
|
|
863
|
+
import { FloatingPanel } from 'horizon-design';
|
|
864
|
+
</script>
|
|
865
|
+
|
|
866
|
+
{#snippet panelTrigger()}Open Panel{/snippet}
|
|
867
|
+
{#snippet panelBody()}
|
|
868
|
+
<p class="text-muted-foreground text-sm">Drag the header to move this panel.</p>
|
|
869
|
+
{/snippet}
|
|
870
|
+
|
|
871
|
+
<FloatingPanel title="Settings" trigger={panelTrigger}>
|
|
872
|
+
{@render panelBody()}
|
|
873
|
+
</FloatingPanel>
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
| Prop | Type | Default |
|
|
877
|
+
| -------------- | --------- | ------- |
|
|
878
|
+
| `trigger` | `Snippet` | — |
|
|
879
|
+
| `triggerClass` | `string` | `''` |
|
|
880
|
+
| `title` | `string` | — |
|
|
881
|
+
| `children` | `Snippet` | — |
|
|
882
|
+
|
|
883
|
+
---
|
|
884
|
+
|
|
885
|
+
### Frame
|
|
886
|
+
|
|
887
|
+
A code-editor-style container with a title bar and traffic-light dots.
|
|
888
|
+
|
|
889
|
+
```svelte
|
|
890
|
+
<script>
|
|
891
|
+
import { Frame } from 'horizon-design';
|
|
892
|
+
</script>
|
|
893
|
+
|
|
894
|
+
<Frame title="app.svelte" class="h-32">
|
|
895
|
+
<div class="p-4 font-mono text-xs">let count = $state(0);</div>
|
|
896
|
+
</Frame>
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
| Prop | Type | Default |
|
|
900
|
+
| ------- | -------- | ------- |
|
|
901
|
+
| `title` | `string` | — |
|
|
902
|
+
|
|
903
|
+
---
|
|
904
|
+
|
|
905
|
+
### Hint
|
|
906
|
+
|
|
907
|
+
Small helper text below a form field.
|
|
908
|
+
|
|
909
|
+
```svelte
|
|
910
|
+
<script>
|
|
911
|
+
import { Hint } from 'horizon-design';
|
|
912
|
+
import { Input } from 'horizon-design';
|
|
913
|
+
</script>
|
|
914
|
+
|
|
915
|
+
<Input type="password" />
|
|
916
|
+
<Hint>Must be at least 8 characters.</Hint>
|
|
917
|
+
```
|
|
918
|
+
|
|
919
|
+
---
|
|
920
|
+
|
|
921
|
+
### HoverCard
|
|
922
|
+
|
|
923
|
+
Rich preview card revealed on hover.
|
|
924
|
+
|
|
925
|
+
```svelte
|
|
926
|
+
<script>
|
|
927
|
+
import { HoverCard } from 'horizon-design';
|
|
928
|
+
</script>
|
|
929
|
+
|
|
930
|
+
<HoverCard>
|
|
931
|
+
{#snippet trigger()}
|
|
932
|
+
<a href="#">@username</a>
|
|
933
|
+
{/snippet}
|
|
934
|
+
<p>User profile preview content.</p>
|
|
935
|
+
</HoverCard>
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
| Prop | Type | Default |
|
|
939
|
+
| -------------- | --------- | ------- |
|
|
940
|
+
| `trigger` | `Snippet` | — |
|
|
941
|
+
| `triggerClass` | `string` | `''` |
|
|
942
|
+
| `openDelay` | `number` | — |
|
|
943
|
+
| `closeDelay` | `number` | — |
|
|
944
|
+
|
|
945
|
+
---
|
|
946
|
+
|
|
947
|
+
### LinkOverlay
|
|
948
|
+
|
|
949
|
+
Clickable overlay link for making a full card area follow its primary link.
|
|
950
|
+
|
|
951
|
+
```svelte
|
|
952
|
+
<script>
|
|
953
|
+
import { LinkBox, LinkOverlay } from 'horizon-design';
|
|
954
|
+
</script>
|
|
955
|
+
|
|
956
|
+
<LinkBox class="rounded-xl border p-4">
|
|
957
|
+
<h3>
|
|
958
|
+
<LinkOverlay href="/projects/alpha">Project Alpha</LinkOverlay>
|
|
959
|
+
</h3>
|
|
960
|
+
<p>Open the project overview.</p>
|
|
961
|
+
</LinkBox>
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
Use `LinkBox` as the positioned wrapper and `LinkOverlay` for the main link.
|
|
965
|
+
|
|
966
|
+
---
|
|
967
|
+
|
|
968
|
+
### ImageCropper
|
|
969
|
+
|
|
970
|
+
Interactive image crop area with drag handles, grid lines, and resize handles.
|
|
971
|
+
|
|
972
|
+
```svelte
|
|
973
|
+
<script>
|
|
974
|
+
import { ImageCropper } from 'horizon-design';
|
|
975
|
+
</script>
|
|
976
|
+
|
|
977
|
+
<ImageCropper src="/photo.jpg" alt="Photo" axis="both" />
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
| Prop | Type | Default |
|
|
981
|
+
| ------ | -------------------------------------- | -------- |
|
|
982
|
+
| `src` | `string` **(required)** | — |
|
|
983
|
+
| `alt` | `string` | `''` |
|
|
984
|
+
| `axis` | `'horizontal' \| 'vertical' \| 'both'` | `'both'` |
|
|
985
|
+
|
|
986
|
+
---
|
|
987
|
+
|
|
988
|
+
### Input
|
|
989
|
+
|
|
990
|
+
Styled text input field.
|
|
991
|
+
|
|
992
|
+
```svelte
|
|
993
|
+
<script>
|
|
994
|
+
import { Input } from 'horizon-design';
|
|
995
|
+
</script>
|
|
996
|
+
|
|
997
|
+
<Input placeholder="Enter text…" />
|
|
998
|
+
<Input size="lg" type="email" />
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
| Prop | Type | Default |
|
|
1002
|
+
| ------ | ---------------------- | ------- |
|
|
1003
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` |
|
|
1004
|
+
|
|
1005
|
+
Accepts all HTML `<input>` attributes.
|
|
1006
|
+
|
|
1007
|
+
---
|
|
1008
|
+
|
|
1009
|
+
### InputGroup
|
|
1010
|
+
|
|
1011
|
+
Connects an input with prefix/suffix addons.
|
|
1012
|
+
|
|
1013
|
+
```svelte
|
|
1014
|
+
<script>
|
|
1015
|
+
import { InputGroup, InputAddon } from 'horizon-design';
|
|
1016
|
+
import { Input } from 'horizon-design';
|
|
1017
|
+
</script>
|
|
1018
|
+
|
|
1019
|
+
<InputGroup>
|
|
1020
|
+
<InputAddon>https://</InputAddon>
|
|
1021
|
+
<Input placeholder="yoursite.com" />
|
|
1022
|
+
</InputGroup>
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
---
|
|
1026
|
+
|
|
1027
|
+
### Item
|
|
1028
|
+
|
|
1029
|
+
A styled list row (label + icon/trailing slot).
|
|
1030
|
+
|
|
1031
|
+
```svelte
|
|
1032
|
+
<script>
|
|
1033
|
+
import { Item } from 'horizon-design';
|
|
1034
|
+
import MingcuteUserLine from '~icons/mingcute/user-line';
|
|
1035
|
+
</script>
|
|
1036
|
+
|
|
1037
|
+
<Item>
|
|
1038
|
+
<MingcuteUserLine class="text-muted-foreground size-4" />
|
|
1039
|
+
<span class="text-sm">Profile</span>
|
|
1040
|
+
</Item>
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
---
|
|
1044
|
+
|
|
1045
|
+
### Kbd
|
|
1046
|
+
|
|
1047
|
+
Keyboard shortcut badge.
|
|
1048
|
+
|
|
1049
|
+
```svelte
|
|
1050
|
+
<script>
|
|
1051
|
+
import { Kbd } from 'horizon-design';
|
|
1052
|
+
</script>
|
|
1053
|
+
|
|
1054
|
+
<Kbd>⌘K</Kbd>
|
|
1055
|
+
<Kbd size="lg">Ctrl+S</Kbd>
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
| Prop | Type | Default |
|
|
1059
|
+
| ------ | ---------------------- | ------- |
|
|
1060
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` |
|
|
1061
|
+
|
|
1062
|
+
---
|
|
1063
|
+
|
|
1064
|
+
### Listbox
|
|
1065
|
+
|
|
1066
|
+
A scrollable list that lets users select one or more items.
|
|
1067
|
+
|
|
1068
|
+
```svelte
|
|
1069
|
+
<script>
|
|
1070
|
+
import { Listbox } from 'horizon-design';
|
|
1071
|
+
|
|
1072
|
+
const items = [
|
|
1073
|
+
{ label: 'Svelte', value: 'svelte' },
|
|
1074
|
+
{ label: 'React', value: 'react' }
|
|
1075
|
+
];
|
|
1076
|
+
|
|
1077
|
+
let selected = $state([]);
|
|
1078
|
+
</script>
|
|
1079
|
+
|
|
1080
|
+
<Listbox {items} label="Choose a framework" bind:value={selected} />
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
| Prop | Type | Default |
|
|
1084
|
+
| -------------- | ----------------------------------------- | ------- |
|
|
1085
|
+
| `items` | `Array<{ label: string; value: string }>` | `[]` |
|
|
1086
|
+
| `label` | `string` | — |
|
|
1087
|
+
| `multiple` | `boolean` | `false` |
|
|
1088
|
+
| `value` | `string[]` | `[]` |
|
|
1089
|
+
| `defaultValue` | `string[]` | — |
|
|
1090
|
+
|
|
1091
|
+
---
|
|
1092
|
+
|
|
1093
|
+
### Marquee
|
|
1094
|
+
|
|
1095
|
+
Horizontally scrolling ticker band.
|
|
1096
|
+
|
|
1097
|
+
```svelte
|
|
1098
|
+
<script>
|
|
1099
|
+
import { Marquee, MarqueeItem } from 'horizon-design';
|
|
1100
|
+
import { Badge } from 'horizon-design';
|
|
1101
|
+
</script>
|
|
1102
|
+
|
|
1103
|
+
<Marquee class="py-2">
|
|
1104
|
+
{#each ['Svelte', 'TypeScript', 'Tailwind'] as name (name)}
|
|
1105
|
+
<MarqueeItem class="px-3">
|
|
1106
|
+
<Badge variant="outline">{name}</Badge>
|
|
1107
|
+
</MarqueeItem>
|
|
1108
|
+
{/each}
|
|
1109
|
+
</Marquee>
|
|
1110
|
+
```
|
|
1111
|
+
|
|
1112
|
+
| Prop | Type | Default |
|
|
1113
|
+
| -------------- | --------- | ------- |
|
|
1114
|
+
| `speed` | `number` | — |
|
|
1115
|
+
| `pauseOnHover` | `boolean` | — |
|
|
1116
|
+
| `reverse` | `boolean` | — |
|
|
1117
|
+
|
|
1118
|
+
---
|
|
1119
|
+
|
|
1120
|
+
### Menu
|
|
1121
|
+
|
|
1122
|
+
Dropdown menu with items, separators, and groups.
|
|
1123
|
+
|
|
1124
|
+
```svelte
|
|
1125
|
+
<script>
|
|
1126
|
+
import { Menu, MenuItem, MenuSeparator, MenuGroup, MenuGroupLabel } from 'horizon-design';
|
|
1127
|
+
import { Button } from 'horizon-design';
|
|
1128
|
+
|
|
1129
|
+
let menuOpen = $state(false);
|
|
1130
|
+
</script>
|
|
1131
|
+
|
|
1132
|
+
<Menu bind:open={menuOpen}>
|
|
1133
|
+
{#snippet trigger()}
|
|
1134
|
+
<Button variant="outline">Options</Button>
|
|
1135
|
+
{/snippet}
|
|
1136
|
+
<MenuItem value="edit">Edit</MenuItem>
|
|
1137
|
+
<MenuItem value="delete">Delete</MenuItem>
|
|
1138
|
+
<MenuSeparator />
|
|
1139
|
+
<MenuItem value="help">Help</MenuItem>
|
|
1140
|
+
</Menu>
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
| `Menu` Prop | Type | Default |
|
|
1144
|
+
| -------------- | --------- | ------- |
|
|
1145
|
+
| `trigger` | `Snippet` | — |
|
|
1146
|
+
| `triggerClass` | `string` | `''` |
|
|
1147
|
+
| `contentClass` | `string` | `''` |
|
|
1148
|
+
| `open` | `boolean` | `false` |
|
|
1149
|
+
|
|
1150
|
+
---
|
|
1151
|
+
|
|
1152
|
+
### NativeSelect
|
|
1153
|
+
|
|
1154
|
+
A styled native `<select>` element.
|
|
1155
|
+
|
|
1156
|
+
```svelte
|
|
1157
|
+
<script>
|
|
1158
|
+
import { NativeSelect } from 'horizon-design';
|
|
1159
|
+
</script>
|
|
1160
|
+
|
|
1161
|
+
<NativeSelect>
|
|
1162
|
+
<option value="">Choose…</option>
|
|
1163
|
+
<option value="svelte">Svelte</option>
|
|
1164
|
+
<option value="react">React</option>
|
|
1165
|
+
</NativeSelect>
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1168
|
+
---
|
|
1169
|
+
|
|
1170
|
+
### NumberInput
|
|
1171
|
+
|
|
1172
|
+
Numeric input with increment/decrement buttons.
|
|
1173
|
+
|
|
1174
|
+
```svelte
|
|
1175
|
+
<script>
|
|
1176
|
+
import { NumberInput } from 'horizon-design';
|
|
1177
|
+
|
|
1178
|
+
let qty = $state('1');
|
|
1179
|
+
</script>
|
|
1180
|
+
|
|
1181
|
+
<NumberInput label="Quantity" min={0} max={100} bind:value={qty} />
|
|
1182
|
+
```
|
|
1183
|
+
|
|
1184
|
+
| Prop | Type | Default |
|
|
1185
|
+
| -------------- | --------- | ------- |
|
|
1186
|
+
| `label` | `string` | — |
|
|
1187
|
+
| `min` | `number` | — |
|
|
1188
|
+
| `max` | `number` | — |
|
|
1189
|
+
| `step` | `number` | `1` |
|
|
1190
|
+
| `defaultValue` | `string` | — |
|
|
1191
|
+
| `value` | `string` | `''` |
|
|
1192
|
+
| `disabled` | `boolean` | — |
|
|
1193
|
+
|
|
1194
|
+
---
|
|
1195
|
+
|
|
1196
|
+
### Pagination
|
|
1197
|
+
|
|
1198
|
+
Page navigation controls.
|
|
1199
|
+
|
|
1200
|
+
```svelte
|
|
1201
|
+
<script>
|
|
1202
|
+
import { Pagination } from 'horizon-design';
|
|
1203
|
+
|
|
1204
|
+
let currentPage = $state(1);
|
|
1205
|
+
</script>
|
|
1206
|
+
|
|
1207
|
+
<Pagination count={100} pageSize={10} bind:page={currentPage} />
|
|
1208
|
+
```
|
|
1209
|
+
|
|
1210
|
+
| Prop | Type | Default |
|
|
1211
|
+
| -------------- | ----------------------- | ------- |
|
|
1212
|
+
| `count` | `number` **(required)** | — |
|
|
1213
|
+
| `pageSize` | `number` | `10` |
|
|
1214
|
+
| `siblingCount` | `number` | `1` |
|
|
1215
|
+
| `page` | `number` | `1` |
|
|
1216
|
+
| `defaultPage` | `number` | — |
|
|
1217
|
+
|
|
1218
|
+
---
|
|
1219
|
+
|
|
1220
|
+
### PinInput
|
|
1221
|
+
|
|
1222
|
+
One-time code entry with individual digit boxes.
|
|
1223
|
+
|
|
1224
|
+
```svelte
|
|
1225
|
+
<script>
|
|
1226
|
+
import { PinInput } from 'horizon-design';
|
|
1227
|
+
|
|
1228
|
+
let code = $state([]);
|
|
1229
|
+
</script>
|
|
1230
|
+
|
|
1231
|
+
<PinInput label="Verification code" length={6} bind:value={code} />
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
| Prop | Type | Default |
|
|
1235
|
+
| ----------------- | --------------------------------------------- | ----------- |
|
|
1236
|
+
| `label` | `string` | — |
|
|
1237
|
+
| `length` | `number` | `4` |
|
|
1238
|
+
| `placeholder` | `string` | `'○'` |
|
|
1239
|
+
| `type` | `'numeric' \| 'alphabetic' \| 'alphanumeric'` | `'numeric'` |
|
|
1240
|
+
| `value` | `string[]` | `[]` |
|
|
1241
|
+
| `onValueComplete` | `(details) => void` | — |
|
|
1242
|
+
|
|
1243
|
+
---
|
|
1244
|
+
|
|
1245
|
+
### Popover
|
|
1246
|
+
|
|
1247
|
+
Floating content panel anchored to a trigger.
|
|
1248
|
+
|
|
1249
|
+
```svelte
|
|
1250
|
+
<script>
|
|
1251
|
+
import { Popover } from 'horizon-design';
|
|
1252
|
+
import { Button } from 'horizon-design';
|
|
1253
|
+
|
|
1254
|
+
let open = $state(false);
|
|
1255
|
+
</script>
|
|
1256
|
+
|
|
1257
|
+
<Popover title="Info" bind:open>
|
|
1258
|
+
{#snippet trigger()}
|
|
1259
|
+
<Button variant="outline" size="icon-md">?</Button>
|
|
1260
|
+
{/snippet}
|
|
1261
|
+
<p>Helpful information here.</p>
|
|
1262
|
+
</Popover>
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
| Prop | Type | Default |
|
|
1266
|
+
| -------------- | --------- | ------- |
|
|
1267
|
+
| `trigger` | `Snippet` | — |
|
|
1268
|
+
| `triggerClass` | `string` | `''` |
|
|
1269
|
+
| `title` | `string` | — |
|
|
1270
|
+
| `description` | `string` | — |
|
|
1271
|
+
| `footer` | `Snippet` | — |
|
|
1272
|
+
| `contentClass` | `string` | `''` |
|
|
1273
|
+
| `open` | `boolean` | `false` |
|
|
1274
|
+
| `defaultOpen` | `boolean` | — |
|
|
1275
|
+
|
|
1276
|
+
---
|
|
1277
|
+
|
|
1278
|
+
### Progress
|
|
1279
|
+
|
|
1280
|
+
Horizontal progress bar.
|
|
1281
|
+
|
|
1282
|
+
```svelte
|
|
1283
|
+
<script>
|
|
1284
|
+
import { Progress } from 'horizon-design';
|
|
1285
|
+
|
|
1286
|
+
let progress = $state(60);
|
|
1287
|
+
</script>
|
|
1288
|
+
|
|
1289
|
+
<Progress label="Loading" bind:value={progress} />
|
|
1290
|
+
<Progress value={null} /><!-- indeterminate -->
|
|
1291
|
+
```
|
|
1292
|
+
|
|
1293
|
+
| Prop | Type | Default |
|
|
1294
|
+
| ------- | ---------------- | ------- |
|
|
1295
|
+
| `label` | `string` | — |
|
|
1296
|
+
| `value` | `number \| null` | `0` |
|
|
1297
|
+
| `max` | `number` | `100` |
|
|
1298
|
+
|
|
1299
|
+
---
|
|
1300
|
+
|
|
1301
|
+
### Prose
|
|
1302
|
+
|
|
1303
|
+
Rich text typography wrapper for rendered Markdown, CMS content, or long-form copy.
|
|
1304
|
+
|
|
1305
|
+
```svelte
|
|
1306
|
+
<script>
|
|
1307
|
+
import { Prose } from 'horizon-design';
|
|
1308
|
+
</script>
|
|
1309
|
+
|
|
1310
|
+
<Prose>
|
|
1311
|
+
<h2>Release notes</h2>
|
|
1312
|
+
<p>Use Prose to style headings, paragraphs, lists, quotes, and inline code.</p>
|
|
1313
|
+
<ul>
|
|
1314
|
+
<li>Consistent spacing</li>
|
|
1315
|
+
<li>Design-system colours</li>
|
|
1316
|
+
</ul>
|
|
1317
|
+
</Prose>
|
|
1318
|
+
```
|
|
1319
|
+
|
|
1320
|
+
---
|
|
1321
|
+
|
|
1322
|
+
### QrCode
|
|
1323
|
+
|
|
1324
|
+
Renders a QR code SVG for a given string value.
|
|
1325
|
+
|
|
1326
|
+
```svelte
|
|
1327
|
+
<script>
|
|
1328
|
+
import { QrCode } from 'horizon-design';
|
|
1329
|
+
</script>
|
|
1330
|
+
|
|
1331
|
+
<QrCode value="https://github.com" size={120} />
|
|
1332
|
+
```
|
|
1333
|
+
|
|
1334
|
+
| Prop | Type | Default |
|
|
1335
|
+
| ------- | ----------------------- | ------- |
|
|
1336
|
+
| `value` | `string` **(required)** | — |
|
|
1337
|
+
| `size` | `number` | `200` |
|
|
1338
|
+
|
|
1339
|
+
---
|
|
1340
|
+
|
|
1341
|
+
### RadioGroup
|
|
1342
|
+
|
|
1343
|
+
A group of mutually exclusive radio buttons. Pass an `items` config array for a self-contained component, or use `children` for fully custom markup.
|
|
1344
|
+
|
|
1345
|
+
```svelte
|
|
1346
|
+
<script>
|
|
1347
|
+
import { RadioGroup } from 'horizon-design';
|
|
1348
|
+
|
|
1349
|
+
let plan = $state('pro');
|
|
1350
|
+
</script>
|
|
1351
|
+
|
|
1352
|
+
<RadioGroup
|
|
1353
|
+
label="Subscription plan"
|
|
1354
|
+
bind:value={plan}
|
|
1355
|
+
items={[
|
|
1356
|
+
{ value: 'free', label: 'Free' },
|
|
1357
|
+
{ value: 'pro', label: 'Pro' },
|
|
1358
|
+
{ value: 'enterprise', label: 'Enterprise', disabled: true }
|
|
1359
|
+
]}
|
|
1360
|
+
/>
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
Items can also use a `Snippet` for rich labels:
|
|
1364
|
+
|
|
1365
|
+
```svelte
|
|
1366
|
+
{#snippet proLabel()}
|
|
1367
|
+
<span>Pro <Badge variant="info">Popular</Badge></span>
|
|
1368
|
+
{/snippet}
|
|
1369
|
+
|
|
1370
|
+
<RadioGroup items={[{ value: 'pro', label: proLabel }]} />
|
|
1371
|
+
```
|
|
1372
|
+
|
|
1373
|
+
| Prop | Type | Default |
|
|
1374
|
+
| -------------- | ------------------------------------------------------------------- | ------- |
|
|
1375
|
+
| `label` | `string` | — |
|
|
1376
|
+
| `items` | `{ value: string; label: string \| Snippet; disabled?: boolean }[]` | — |
|
|
1377
|
+
| `value` | `string` | `''` |
|
|
1378
|
+
| `defaultValue` | `string` | — |
|
|
1379
|
+
| `disabled` | `boolean` | — |
|
|
1380
|
+
| `children` | `Snippet` | — |
|
|
1381
|
+
|
|
1382
|
+
---
|
|
1383
|
+
|
|
1384
|
+
### RatingGroup
|
|
1385
|
+
|
|
1386
|
+
Star rating input.
|
|
1387
|
+
|
|
1388
|
+
```svelte
|
|
1389
|
+
<script>
|
|
1390
|
+
import { RatingGroup } from 'horizon-design';
|
|
1391
|
+
|
|
1392
|
+
let rating = $state(3);
|
|
1393
|
+
</script>
|
|
1394
|
+
|
|
1395
|
+
<RatingGroup label="Rate this" count={5} bind:value={rating} />
|
|
1396
|
+
```
|
|
1397
|
+
|
|
1398
|
+
| Prop | Type | Default |
|
|
1399
|
+
| -------------- | -------- | ------- |
|
|
1400
|
+
| `label` | `string` | — |
|
|
1401
|
+
| `count` | `number` | `5` |
|
|
1402
|
+
| `defaultValue` | `number` | — |
|
|
1403
|
+
| `value` | `number` | `0` |
|
|
1404
|
+
|
|
1405
|
+
---
|
|
1406
|
+
|
|
1407
|
+
### ScrollArea
|
|
1408
|
+
|
|
1409
|
+
Thin custom scrollbars in a fixed-height container.
|
|
1410
|
+
|
|
1411
|
+
```svelte
|
|
1412
|
+
<script>
|
|
1413
|
+
import { ScrollArea } from 'horizon-design';
|
|
1414
|
+
</script>
|
|
1415
|
+
|
|
1416
|
+
<ScrollArea class="h-64">
|
|
1417
|
+
<p>Long content…</p>
|
|
1418
|
+
</ScrollArea>
|
|
1419
|
+
```
|
|
1420
|
+
|
|
1421
|
+
---
|
|
1422
|
+
|
|
1423
|
+
### SegmentGroup
|
|
1424
|
+
|
|
1425
|
+
Segmented button group (radio-style). Labels can be strings or Snippets.
|
|
1426
|
+
|
|
1427
|
+
```svelte
|
|
1428
|
+
<script>
|
|
1429
|
+
import { SegmentGroup } from 'horizon-design';
|
|
1430
|
+
|
|
1431
|
+
let view = $state('week');
|
|
1432
|
+
</script>
|
|
1433
|
+
|
|
1434
|
+
<SegmentGroup
|
|
1435
|
+
items={[
|
|
1436
|
+
{ value: 'day', label: 'Day' },
|
|
1437
|
+
{ value: 'week', label: 'Week' },
|
|
1438
|
+
{ value: 'month', label: 'Month' }
|
|
1439
|
+
]}
|
|
1440
|
+
bind:value={view}
|
|
1441
|
+
/>
|
|
1442
|
+
```
|
|
1443
|
+
|
|
1444
|
+
The component uses `items-stretch` internally, so items always fill whatever height the root has. To control height, pass a height class: `class="h-9"` or `class="h-full"`.
|
|
1445
|
+
|
|
1446
|
+
| Prop | Type | Default |
|
|
1447
|
+
| -------------- | ---------------------------------------------------- | ------- |
|
|
1448
|
+
| `items` | `Array<{ value: string; label: string \| Snippet }>` | `[]` |
|
|
1449
|
+
| `value` | `string` | `''` |
|
|
1450
|
+
| `defaultValue` | `string` | — |
|
|
1451
|
+
|
|
1452
|
+
---
|
|
1453
|
+
|
|
1454
|
+
### Select
|
|
1455
|
+
|
|
1456
|
+
Styled accessible dropdown select.
|
|
1457
|
+
|
|
1458
|
+
```svelte
|
|
1459
|
+
<script>
|
|
1460
|
+
import { Select } from 'horizon-design';
|
|
1461
|
+
|
|
1462
|
+
const items = [
|
|
1463
|
+
{ label: 'Apple', value: 'apple' },
|
|
1464
|
+
{ label: 'Banana', value: 'banana' }
|
|
1465
|
+
];
|
|
1466
|
+
|
|
1467
|
+
let selected = $state([]);
|
|
1468
|
+
</script>
|
|
1469
|
+
|
|
1470
|
+
<Select {items} label="Fruit" bind:value={selected} placeholder="Pick a fruit…" />
|
|
1471
|
+
```
|
|
1472
|
+
|
|
1473
|
+
| Prop | Type | Default |
|
|
1474
|
+
| -------------- | ---------------------------------------------------------------------------- | -------------------- |
|
|
1475
|
+
| `items` | `Array<{ label: string; value: string; disabled?: boolean }>` **(required)** | `[]` |
|
|
1476
|
+
| `label` | `string` | — |
|
|
1477
|
+
| `placeholder` | `string` | `'Select an option'` |
|
|
1478
|
+
| `value` | `string[]` | `[]` |
|
|
1479
|
+
| `defaultValue` | `string[]` | — |
|
|
1480
|
+
| `multiple` | `boolean` | `false` |
|
|
1481
|
+
| `disabled` | `boolean` | — |
|
|
1482
|
+
|
|
1483
|
+
---
|
|
1484
|
+
|
|
1485
|
+
### Separator
|
|
1486
|
+
|
|
1487
|
+
Horizontal or vertical dividing line.
|
|
1488
|
+
|
|
1489
|
+
```svelte
|
|
1490
|
+
<script>
|
|
1491
|
+
import { Separator } from 'horizon-design';
|
|
1492
|
+
</script>
|
|
1493
|
+
|
|
1494
|
+
<Separator />
|
|
1495
|
+
<Separator orientation="vertical" class="h-6" />
|
|
1496
|
+
```
|
|
1497
|
+
|
|
1498
|
+
| Prop | Type | Default |
|
|
1499
|
+
| ------------- | ---------------------------- | -------------- |
|
|
1500
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
1501
|
+
| `decorative` | `boolean` | `true` |
|
|
1502
|
+
|
|
1503
|
+
---
|
|
1504
|
+
|
|
1505
|
+
### Sheet
|
|
1506
|
+
|
|
1507
|
+
Slide-in panel (alias of Drawer with configurable side).
|
|
1508
|
+
|
|
1509
|
+
```svelte
|
|
1510
|
+
<script>
|
|
1511
|
+
import { Sheet } from 'horizon-design';
|
|
1512
|
+
import { Button } from 'horizon-design';
|
|
1513
|
+
</script>
|
|
1514
|
+
|
|
1515
|
+
<Sheet title="Filters" side="right">
|
|
1516
|
+
{#snippet trigger()}
|
|
1517
|
+
<Button variant="outline">Open Filters</Button>
|
|
1518
|
+
{/snippet}
|
|
1519
|
+
<p>Filter content here.</p>
|
|
1520
|
+
</Sheet>
|
|
1521
|
+
```
|
|
1522
|
+
|
|
1523
|
+
| Prop | Type | Default |
|
|
1524
|
+
| -------------- | ---------------------------------------- | --------- |
|
|
1525
|
+
| `trigger` | `Snippet` | — |
|
|
1526
|
+
| `triggerClass` | `string` | `''` |
|
|
1527
|
+
| `title` | `string` | — |
|
|
1528
|
+
| `description` | `string` | — |
|
|
1529
|
+
| `footer` | `Snippet` | — |
|
|
1530
|
+
| `side` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'right'` |
|
|
1531
|
+
| `showClose` | `boolean` | `true` |
|
|
1532
|
+
| `open` | `boolean` | `false` |
|
|
1533
|
+
| `defaultOpen` | `boolean` | — |
|
|
1534
|
+
|
|
1535
|
+
---
|
|
1536
|
+
|
|
1537
|
+
### Sidebar
|
|
1538
|
+
|
|
1539
|
+
Vertical navigation layout with header, grouped content, items, and footer.
|
|
1540
|
+
|
|
1541
|
+
```svelte
|
|
1542
|
+
<script>
|
|
1543
|
+
import { Sidebar, SidebarSection, SidebarItem } from 'horizon-design';
|
|
1544
|
+
</script>
|
|
1545
|
+
|
|
1546
|
+
<Sidebar>
|
|
1547
|
+
{#snippet header()}Workspace{/snippet}
|
|
1548
|
+
{#snippet footer()}<p>Signed in as Rayan</p>{/snippet}
|
|
1549
|
+
<SidebarSection label="General">
|
|
1550
|
+
<SidebarItem href="/" active>Overview</SidebarItem>
|
|
1551
|
+
<SidebarItem href="/settings">Settings</SidebarItem>
|
|
1552
|
+
</SidebarSection>
|
|
1553
|
+
</Sidebar>
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
| `Sidebar` Prop | Type | Default |
|
|
1557
|
+
| -------------- | --------- | ------- |
|
|
1558
|
+
| `collapsed` | `boolean` | `false` |
|
|
1559
|
+
| `header` | `Snippet` | — |
|
|
1560
|
+
| `footer` | `Snippet` | — |
|
|
1561
|
+
|
|
1562
|
+
| `SidebarSection` Prop | Type | Default |
|
|
1563
|
+
| --------------------- | -------- | ------- |
|
|
1564
|
+
| `label` | `string` | `''` |
|
|
1565
|
+
|
|
1566
|
+
| `SidebarItem` Prop | Type | Default |
|
|
1567
|
+
| ------------------ | --------- | ------- |
|
|
1568
|
+
| `href` | `string` | `''` |
|
|
1569
|
+
| `active` | `boolean` | `false` |
|
|
1570
|
+
|
|
1571
|
+
---
|
|
1572
|
+
|
|
1573
|
+
### SignaturePad
|
|
1574
|
+
|
|
1575
|
+
Freehand drawing canvas for signatures.
|
|
1576
|
+
|
|
1577
|
+
```svelte
|
|
1578
|
+
<script>
|
|
1579
|
+
import { SignaturePad } from 'horizon-design';
|
|
1580
|
+
</script>
|
|
1581
|
+
|
|
1582
|
+
<SignaturePad label="Draw your signature" onDrawEnd={(d) => console.log(d.paths)} />
|
|
1583
|
+
```
|
|
1584
|
+
|
|
1585
|
+
| Prop | Type | Default |
|
|
1586
|
+
| ----------- | ------------------- | ------- |
|
|
1587
|
+
| `label` | `string` | — |
|
|
1588
|
+
| `onDrawEnd` | `(details) => void` | — |
|
|
1589
|
+
|
|
1590
|
+
---
|
|
1591
|
+
|
|
1592
|
+
### Skeleton
|
|
1593
|
+
|
|
1594
|
+
Animated loading placeholder.
|
|
1595
|
+
|
|
1596
|
+
```svelte
|
|
1597
|
+
<script>
|
|
1598
|
+
import { Skeleton } from 'horizon-design';
|
|
1599
|
+
</script>
|
|
1600
|
+
|
|
1601
|
+
<Skeleton class="h-4 w-48" />
|
|
1602
|
+
<Skeleton class="h-12 w-12 rounded-full" />
|
|
1603
|
+
```
|
|
1604
|
+
|
|
1605
|
+
---
|
|
1606
|
+
|
|
1607
|
+
### SkipNav
|
|
1608
|
+
|
|
1609
|
+
Keyboard-only skip link for jumping directly to main page content.
|
|
1610
|
+
|
|
1611
|
+
```svelte
|
|
1612
|
+
<script>
|
|
1613
|
+
import { SkipNav } from 'horizon-design';
|
|
1614
|
+
</script>
|
|
1615
|
+
|
|
1616
|
+
<SkipNav href="#main-content">Skip to content</SkipNav>
|
|
1617
|
+
```
|
|
1618
|
+
|
|
1619
|
+
| Prop | Type | Default |
|
|
1620
|
+
| ------ | -------- | ----------------- |
|
|
1621
|
+
| `href` | `string` | `'#main-content'` |
|
|
1622
|
+
|
|
1623
|
+
---
|
|
1624
|
+
|
|
1625
|
+
### Slider
|
|
1626
|
+
|
|
1627
|
+
Range input with draggable thumb.
|
|
1628
|
+
|
|
1629
|
+
```svelte
|
|
1630
|
+
<script>
|
|
1631
|
+
import { Slider } from 'horizon-design';
|
|
1632
|
+
|
|
1633
|
+
let volume = $state([50]);
|
|
1634
|
+
</script>
|
|
1635
|
+
|
|
1636
|
+
<Slider label="Volume" showValue min={0} max={100} bind:value={volume} />
|
|
1637
|
+
```
|
|
1638
|
+
|
|
1639
|
+
| Prop | Type | Default |
|
|
1640
|
+
| -------------- | ---------------------------- | -------------- |
|
|
1641
|
+
| `label` | `string` | — |
|
|
1642
|
+
| `showValue` | `boolean` | `false` |
|
|
1643
|
+
| `min` | `number` | `0` |
|
|
1644
|
+
| `max` | `number` | `100` |
|
|
1645
|
+
| `step` | `number` | `1` |
|
|
1646
|
+
| `value` | `number[]` | `[0]` |
|
|
1647
|
+
| `defaultValue` | `number[]` | — |
|
|
1648
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
1649
|
+
| `disabled` | `boolean` | — |
|
|
1650
|
+
|
|
1651
|
+
---
|
|
1652
|
+
|
|
1653
|
+
### Spinner
|
|
1654
|
+
|
|
1655
|
+
Animated loading indicator.
|
|
1656
|
+
|
|
1657
|
+
```svelte
|
|
1658
|
+
<script>
|
|
1659
|
+
import { Spinner } from 'horizon-design';
|
|
1660
|
+
</script>
|
|
1661
|
+
|
|
1662
|
+
<Spinner />
|
|
1663
|
+
<Spinner class="size-8" aria-label="Uploading" />
|
|
1664
|
+
```
|
|
1665
|
+
|
|
1666
|
+
---
|
|
1667
|
+
|
|
1668
|
+
### Splitter
|
|
1669
|
+
|
|
1670
|
+
Resizable split pane layout.
|
|
1671
|
+
|
|
1672
|
+
```svelte
|
|
1673
|
+
<script>
|
|
1674
|
+
import { Splitter, SplitterPanel, SplitterResizeTrigger } from 'horizon-design';
|
|
1675
|
+
|
|
1676
|
+
const panels = [{ id: 'a' }, { id: 'b' }];
|
|
1677
|
+
</script>
|
|
1678
|
+
|
|
1679
|
+
<Splitter {panels} class="h-40 rounded-lg border">
|
|
1680
|
+
<SplitterPanel id="a">Panel A</SplitterPanel>
|
|
1681
|
+
<SplitterResizeTrigger id="a:b" />
|
|
1682
|
+
<SplitterPanel id="b">Panel B</SplitterPanel>
|
|
1683
|
+
</Splitter>
|
|
1684
|
+
```
|
|
1685
|
+
|
|
1686
|
+
| `Splitter` Prop | Type | Default |
|
|
1687
|
+
| --------------- | -------------------------------------- | -------------- |
|
|
1688
|
+
| `panels` | `Array<{ id: string }>` **(required)** | — |
|
|
1689
|
+
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` |
|
|
1690
|
+
|
|
1691
|
+
---
|
|
1692
|
+
|
|
1693
|
+
### Status
|
|
1694
|
+
|
|
1695
|
+
Colour-coded presence dot.
|
|
1696
|
+
|
|
1697
|
+
```svelte
|
|
1698
|
+
<script>
|
|
1699
|
+
import { Status } from 'horizon-design';
|
|
1700
|
+
</script>
|
|
1701
|
+
|
|
1702
|
+
<Status variant="online" />
|
|
1703
|
+
<Status variant="away" />
|
|
1704
|
+
```
|
|
1705
|
+
|
|
1706
|
+
| Prop | Type | Default |
|
|
1707
|
+
| --------- | ------------------------------------------- | ---------- |
|
|
1708
|
+
| `variant` | `'online' \| 'offline' \| 'away' \| 'busy'` | `'online'` |
|
|
1709
|
+
|
|
1710
|
+
---
|
|
1711
|
+
|
|
1712
|
+
### Steps
|
|
1713
|
+
|
|
1714
|
+
Multi-step wizard with progress indicators.
|
|
1715
|
+
|
|
1716
|
+
```svelte
|
|
1717
|
+
<script>
|
|
1718
|
+
import { Steps } from 'horizon-design';
|
|
1719
|
+
</script>
|
|
1720
|
+
|
|
1721
|
+
{#snippet step1()}
|
|
1722
|
+
<p>Fill in your profile details.</p>
|
|
1723
|
+
{/snippet}
|
|
1724
|
+
{#snippet step2()}
|
|
1725
|
+
<p>Configure your preferences.</p>
|
|
1726
|
+
{/snippet}
|
|
1727
|
+
{#snippet done()}
|
|
1728
|
+
<p>All done! 🎉</p>
|
|
1729
|
+
{/snippet}
|
|
1730
|
+
|
|
1731
|
+
<Steps
|
|
1732
|
+
steps={[
|
|
1733
|
+
{ title: 'Profile', content: step1 },
|
|
1734
|
+
{ title: 'Preferences', content: step2 }
|
|
1735
|
+
]}
|
|
1736
|
+
completedContent={done}
|
|
1737
|
+
/>
|
|
1738
|
+
```
|
|
1739
|
+
|
|
1740
|
+
| Prop | Type | Default |
|
|
1741
|
+
| ------------------ | -------------------------------------------- | -------- |
|
|
1742
|
+
| `steps` | `Array<{ title: string; content: Snippet }>` | `[]` |
|
|
1743
|
+
| `step` | `number` (bindable) | — |
|
|
1744
|
+
| `completedContent` | `Snippet` | — |
|
|
1745
|
+
| `prevLabel` | `string` | `'Back'` |
|
|
1746
|
+
| `nextLabel` | `string` | `'Next'` |
|
|
1747
|
+
|
|
1748
|
+
---
|
|
1749
|
+
|
|
1750
|
+
### Swap
|
|
1751
|
+
|
|
1752
|
+
Toggle between two rendered states with an animated transition. Both `on` and `off` are Snippets.
|
|
1753
|
+
|
|
1754
|
+
```svelte
|
|
1755
|
+
<script>
|
|
1756
|
+
import { Swap } from 'horizon-design';
|
|
1757
|
+
import MingcuteSunLine from '~icons/mingcute/sun-line';
|
|
1758
|
+
import MingcuteMoonLine from '~icons/mingcute/moon-line';
|
|
1759
|
+
</script>
|
|
1760
|
+
|
|
1761
|
+
{#snippet sunIcon()}<MingcuteSunLine class="size-6" />{/snippet}
|
|
1762
|
+
{#snippet moonIcon()}<MingcuteMoonLine class="size-6" />{/snippet}
|
|
1763
|
+
|
|
1764
|
+
<button onclick={() => (dark = !dark)}>
|
|
1765
|
+
<Swap swap={dark} on={sunIcon} off={moonIcon} />
|
|
1766
|
+
</button>
|
|
1767
|
+
```
|
|
1768
|
+
|
|
1769
|
+
| Prop | Type | Default |
|
|
1770
|
+
| --------------- | --------- | ------- |
|
|
1771
|
+
| `swap` | `boolean` | `false` |
|
|
1772
|
+
| `on` | `Snippet` | — |
|
|
1773
|
+
| `off` | `Snippet` | — |
|
|
1774
|
+
| `lazyMount` | `boolean` | `true` |
|
|
1775
|
+
| `unmountOnExit` | `boolean` | `true` |
|
|
1776
|
+
|
|
1777
|
+
---
|
|
1778
|
+
|
|
1779
|
+
### Switch
|
|
1780
|
+
|
|
1781
|
+
Toggle switch.
|
|
1782
|
+
|
|
1783
|
+
```svelte
|
|
1784
|
+
<script>
|
|
1785
|
+
import { Switch } from 'horizon-design';
|
|
1786
|
+
|
|
1787
|
+
let notifications = $state(false);
|
|
1788
|
+
</script>
|
|
1789
|
+
|
|
1790
|
+
<Switch label="Dark mode" />
|
|
1791
|
+
<Switch label="Notifications" bind:checked={notifications} />
|
|
1792
|
+
<Switch label="With content">
|
|
1793
|
+
{#snippet checkedContent()}<MyCheckIcon />{/snippet}
|
|
1794
|
+
{#snippet uncheckedContent()}<MyCloseIcon />{/snippet}
|
|
1795
|
+
</Switch>
|
|
1796
|
+
```
|
|
1797
|
+
|
|
1798
|
+
| Prop | Type | Default |
|
|
1799
|
+
| ------------------ | ------------------------------ | ----------- |
|
|
1800
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` |
|
|
1801
|
+
| `variant` | `'default' \| 'secondary'` | `'default'` |
|
|
1802
|
+
| `label` | `string` | — |
|
|
1803
|
+
| `checked` | `boolean` | — |
|
|
1804
|
+
| `defaultChecked` | `boolean` | — |
|
|
1805
|
+
| `disabled` | `boolean` | — |
|
|
1806
|
+
| `checkedContent` | `Snippet` | — |
|
|
1807
|
+
| `uncheckedContent` | `Snippet` | — |
|
|
1808
|
+
|
|
1809
|
+
---
|
|
1810
|
+
|
|
1811
|
+
### Table
|
|
1812
|
+
|
|
1813
|
+
Data table from column config and row data. Row values can be strings or Snippets.
|
|
1814
|
+
|
|
1815
|
+
```svelte
|
|
1816
|
+
<script>
|
|
1817
|
+
import { Table } from 'horizon-design';
|
|
1818
|
+
</script>
|
|
1819
|
+
|
|
1820
|
+
<Table
|
|
1821
|
+
columns={[
|
|
1822
|
+
{ key: 'name', label: 'Name' },
|
|
1823
|
+
{ key: 'role', label: 'Role' },
|
|
1824
|
+
{ key: 'joined', label: 'Joined' }
|
|
1825
|
+
]}
|
|
1826
|
+
rows={[
|
|
1827
|
+
{ name: 'Alice', role: 'Admin', joined: 'Jan 2024' },
|
|
1828
|
+
{ name: 'Bob', role: 'Developer', joined: 'Mar 2024' }
|
|
1829
|
+
]}
|
|
1830
|
+
/>
|
|
1831
|
+
```
|
|
1832
|
+
|
|
1833
|
+
| Prop | Type | Default |
|
|
1834
|
+
| --------- | ------------------------------------------ | ------- |
|
|
1835
|
+
| `columns` | `Array<{ key: string; label: string }>` | `[]` |
|
|
1836
|
+
| `rows` | `Array<Record<string, string \| Snippet>>` | `[]` |
|
|
1837
|
+
|
|
1838
|
+
---
|
|
1839
|
+
|
|
1840
|
+
### Tabs
|
|
1841
|
+
|
|
1842
|
+
Tabbed content sections. Each tab has a label (string or Snippet) and a content Snippet.
|
|
1843
|
+
|
|
1844
|
+
```svelte
|
|
1845
|
+
<script>
|
|
1846
|
+
import { Tabs } from 'horizon-design';
|
|
1847
|
+
|
|
1848
|
+
let activeTab = $state('overview');
|
|
1849
|
+
</script>
|
|
1850
|
+
|
|
1851
|
+
{#snippet overview()}<p>Overview content.</p>{/snippet}
|
|
1852
|
+
{#snippet settings()}<p>Settings content.</p>{/snippet}
|
|
1853
|
+
|
|
1854
|
+
<Tabs
|
|
1855
|
+
tabs={[
|
|
1856
|
+
{ value: 'overview', label: 'Overview', content: overview },
|
|
1857
|
+
{ value: 'settings', label: 'Settings', content: settings }
|
|
1858
|
+
]}
|
|
1859
|
+
bind:value={activeTab}
|
|
1860
|
+
defaultValue="overview"
|
|
1861
|
+
/>
|
|
1862
|
+
```
|
|
1863
|
+
|
|
1864
|
+
For the underline style:
|
|
1865
|
+
|
|
1866
|
+
```svelte
|
|
1867
|
+
<Tabs {tabs} variant="underline" />
|
|
1868
|
+
```
|
|
1869
|
+
|
|
1870
|
+
| Prop | Type | Default |
|
|
1871
|
+
| -------------- | ---------------------------------------------------------------------- | ----------- |
|
|
1872
|
+
| `tabs` | `Array<{ value: string; label: string \| Snippet; content: Snippet }>` | `[]` |
|
|
1873
|
+
| `variant` | `'default' \| 'underline'` | `'default'` |
|
|
1874
|
+
| `value` | `string` | — |
|
|
1875
|
+
| `defaultValue` | `string` | — |
|
|
1876
|
+
|
|
1877
|
+
---
|
|
1878
|
+
|
|
1879
|
+
### Textarea
|
|
1880
|
+
|
|
1881
|
+
Multi-line text input.
|
|
1882
|
+
|
|
1883
|
+
```svelte
|
|
1884
|
+
<script>
|
|
1885
|
+
import { Textarea } from 'horizon-design';
|
|
1886
|
+
</script>
|
|
1887
|
+
|
|
1888
|
+
<Textarea placeholder="Write something…" rows={4} />
|
|
1889
|
+
```
|
|
1890
|
+
|
|
1891
|
+
Accepts all HTML `<textarea>` attributes.
|
|
1892
|
+
|
|
1893
|
+
---
|
|
1894
|
+
|
|
1895
|
+
### ThemeSwitch
|
|
1896
|
+
|
|
1897
|
+
A three-position toggle (System / Dark / Light) with animated sliding thumb.
|
|
1898
|
+
|
|
1899
|
+
```svelte
|
|
1900
|
+
<script>
|
|
1901
|
+
import { ThemeSwitch } from 'horizon-design';
|
|
1902
|
+
</script>
|
|
1903
|
+
|
|
1904
|
+
<ThemeSwitch />
|
|
1905
|
+
<ThemeSwitch size="lg" />
|
|
1906
|
+
```
|
|
1907
|
+
|
|
1908
|
+
To enable theme switching, add an inline script to `app.html` to apply the stored theme before first paint (prevents flash):
|
|
1909
|
+
|
|
1910
|
+
```html
|
|
1911
|
+
<!-- app.html, inside <head> -->
|
|
1912
|
+
<script>
|
|
1913
|
+
(function () {
|
|
1914
|
+
var m = localStorage.getItem('horizon-theme');
|
|
1915
|
+
var dark =
|
|
1916
|
+
m === 'dark' || (m !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
1917
|
+
if (!dark) document.documentElement.classList.add('light');
|
|
1918
|
+
})();
|
|
1919
|
+
</script>
|
|
1920
|
+
```
|
|
1921
|
+
|
|
1922
|
+
Then initialize the theme store once in your root layout:
|
|
1923
|
+
|
|
1924
|
+
```svelte
|
|
1925
|
+
<!-- src/routes/+layout.svelte -->
|
|
1926
|
+
<script>
|
|
1927
|
+
import { onMount } from 'svelte';
|
|
1928
|
+
import { theme } from 'horizon-design';
|
|
1929
|
+
onMount(() => theme.init());
|
|
1930
|
+
</script>
|
|
1931
|
+
```
|
|
1932
|
+
|
|
1933
|
+
| Prop | Type | Default |
|
|
1934
|
+
| ------ | ------------------------------ | ------- |
|
|
1935
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` |
|
|
1936
|
+
|
|
1937
|
+
---
|
|
1938
|
+
|
|
1939
|
+
### ThumbCard
|
|
1940
|
+
|
|
1941
|
+
Preview card with a thumbnail area and optional label link.
|
|
1942
|
+
|
|
1943
|
+
```svelte
|
|
1944
|
+
<script>
|
|
1945
|
+
import { ThumbCard } from 'horizon-design';
|
|
1946
|
+
</script>
|
|
1947
|
+
|
|
1948
|
+
<ThumbCard label="Component preview" href="/components">
|
|
1949
|
+
<img src="/preview.png" alt="" class="h-20 w-20 rounded-lg object-cover" />
|
|
1950
|
+
</ThumbCard>
|
|
1951
|
+
```
|
|
1952
|
+
|
|
1953
|
+
| Prop | Type | Default |
|
|
1954
|
+
| ------- | -------- | ------- |
|
|
1955
|
+
| `label` | `string` | `''` |
|
|
1956
|
+
| `href` | `string` | `''` |
|
|
1957
|
+
|
|
1958
|
+
---
|
|
1959
|
+
|
|
1960
|
+
### Timer
|
|
1961
|
+
|
|
1962
|
+
Countdown / stopwatch display with start, stop, and reset controls.
|
|
1963
|
+
|
|
1964
|
+
```svelte
|
|
1965
|
+
<script>
|
|
1966
|
+
import { Timer } from 'horizon-design';
|
|
1967
|
+
</script>
|
|
1968
|
+
|
|
1969
|
+
<Timer autoStart={true} />
|
|
1970
|
+
```
|
|
1971
|
+
|
|
1972
|
+
| Prop | Type | Default |
|
|
1973
|
+
| ----------- | --------- | ------- |
|
|
1974
|
+
| `autoStart` | `boolean` | `false` |
|
|
1975
|
+
|
|
1976
|
+
---
|
|
1977
|
+
|
|
1978
|
+
### Toast
|
|
1979
|
+
|
|
1980
|
+
Transient notification messages.
|
|
1981
|
+
|
|
1982
|
+
```svelte
|
|
1983
|
+
<script>
|
|
1984
|
+
import { Toaster, createToaster } from 'horizon-design';
|
|
1985
|
+
|
|
1986
|
+
const toaster = createToaster({ placement: 'bottom-end' });
|
|
1987
|
+
|
|
1988
|
+
function notify() {
|
|
1989
|
+
toaster.create({ title: 'Saved!', description: 'Changes were saved.', type: 'success' });
|
|
1990
|
+
}
|
|
1991
|
+
</script>
|
|
1992
|
+
|
|
1993
|
+
<button onclick={notify}>Save</button>
|
|
1994
|
+
<Toaster {toaster} />
|
|
1995
|
+
```
|
|
1996
|
+
|
|
1997
|
+
`createToaster` options: `placement`, `max`, `duration`, `removeDelay`.
|
|
1998
|
+
|
|
1999
|
+
---
|
|
2000
|
+
|
|
2001
|
+
### Toggle
|
|
2002
|
+
|
|
2003
|
+
A pressable on/off button.
|
|
2004
|
+
|
|
2005
|
+
```svelte
|
|
2006
|
+
<script>
|
|
2007
|
+
import { Toggle } from 'horizon-design';
|
|
2008
|
+
|
|
2009
|
+
let bold = $state(false);
|
|
2010
|
+
</script>
|
|
2011
|
+
|
|
2012
|
+
<Toggle bind:pressed={bold}>Bold</Toggle>
|
|
2013
|
+
<Toggle variant="outline" size="sm">Italic</Toggle>
|
|
2014
|
+
```
|
|
2015
|
+
|
|
2016
|
+
| Prop | Type | Default |
|
|
2017
|
+
| ---------------- | ------------------------ | ----------- |
|
|
2018
|
+
| `variant` | `'default' \| 'outline'` | `'default'` |
|
|
2019
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` |
|
|
2020
|
+
| `pressed` | `boolean` | `false` |
|
|
2021
|
+
| `defaultPressed` | `boolean` | — |
|
|
2022
|
+
|
|
2023
|
+
---
|
|
2024
|
+
|
|
2025
|
+
### ToggleGroup
|
|
2026
|
+
|
|
2027
|
+
A group of toggle buttons (multi-select or single-select). Each item content is a Snippet.
|
|
2028
|
+
|
|
2029
|
+
```svelte
|
|
2030
|
+
<script>
|
|
2031
|
+
import { ToggleGroup } from 'horizon-design';
|
|
2032
|
+
import MingcuteBoldLine from '~icons/mingcute/bold-line';
|
|
2033
|
+
import MingcuteItalicLine from '~icons/mingcute/italic-line';
|
|
2034
|
+
|
|
2035
|
+
let formatting = $state([]);
|
|
2036
|
+
</script>
|
|
2037
|
+
|
|
2038
|
+
{#snippet boldIcon()}<MingcuteBoldLine class="size-4" />{/snippet}
|
|
2039
|
+
{#snippet italicIcon()}<MingcuteItalicLine class="size-4" />{/snippet}
|
|
2040
|
+
|
|
2041
|
+
<ToggleGroup
|
|
2042
|
+
items={[
|
|
2043
|
+
{ value: 'bold', content: boldIcon },
|
|
2044
|
+
{ value: 'italic', content: italicIcon }
|
|
2045
|
+
]}
|
|
2046
|
+
bind:value={formatting}
|
|
2047
|
+
/>
|
|
2048
|
+
```
|
|
2049
|
+
|
|
2050
|
+
| Prop | Type | Default |
|
|
2051
|
+
| -------------- | -------------------------------------------- | ------------ |
|
|
2052
|
+
| `items` | `Array<{ value: string; content: Snippet }>` | `[]` |
|
|
2053
|
+
| `type` | `'single' \| 'multiple'` | `'multiple'` |
|
|
2054
|
+
| `value` | `string[]` | `[]` |
|
|
2055
|
+
| `defaultValue` | `string[]` | — |
|
|
2056
|
+
|
|
2057
|
+
---
|
|
2058
|
+
|
|
2059
|
+
### ToggleTooltip
|
|
2060
|
+
|
|
2061
|
+
A toggle button with an attached tooltip label.
|
|
2062
|
+
|
|
2063
|
+
```svelte
|
|
2064
|
+
<script>
|
|
2065
|
+
import { ToggleTooltip } from 'horizon-design';
|
|
2066
|
+
import MingcuteBoldLine from '~icons/mingcute/bold-line';
|
|
2067
|
+
</script>
|
|
2068
|
+
|
|
2069
|
+
<ToggleTooltip label="Bold">
|
|
2070
|
+
<MingcuteBoldLine class="size-4" />
|
|
2071
|
+
</ToggleTooltip>
|
|
2072
|
+
```
|
|
2073
|
+
|
|
2074
|
+
| Prop | Type | Default |
|
|
2075
|
+
| ------- | ----------------------- | ------- |
|
|
2076
|
+
| `label` | `string` **(required)** | — |
|
|
2077
|
+
|
|
2078
|
+
---
|
|
2079
|
+
|
|
2080
|
+
### Tooltip
|
|
2081
|
+
|
|
2082
|
+
Floating text hint on hover/focus.
|
|
2083
|
+
|
|
2084
|
+
```svelte
|
|
2085
|
+
<script>
|
|
2086
|
+
import { Tooltip } from 'horizon-design';
|
|
2087
|
+
import { Button } from 'horizon-design';
|
|
2088
|
+
</script>
|
|
2089
|
+
|
|
2090
|
+
<Tooltip content="Helpful text">
|
|
2091
|
+
<Button variant="ghost" size="icon-md">?</Button>
|
|
2092
|
+
</Tooltip>
|
|
2093
|
+
```
|
|
2094
|
+
|
|
2095
|
+
| Prop | Type | Default |
|
|
2096
|
+
| ------------- | ---------------------------------- | ---------------------- |
|
|
2097
|
+
| `content` | `string \| Snippet` **(required)** | — |
|
|
2098
|
+
| `openDelay` | `number` | `200` |
|
|
2099
|
+
| `closeDelay` | `number` | `100` |
|
|
2100
|
+
| `positioning` | `PositioningOptions` | `{ placement: 'top' }` |
|
|
2101
|
+
|
|
2102
|
+
---
|
|
2103
|
+
|
|
2104
|
+
### Tour
|
|
2105
|
+
|
|
2106
|
+
Guided multi-step product tour with spotlight and step navigation.
|
|
2107
|
+
|
|
2108
|
+
```svelte
|
|
2109
|
+
<script>
|
|
2110
|
+
import { Tour } from 'horizon-design';
|
|
2111
|
+
import { Button } from 'horizon-design';
|
|
2112
|
+
</script>
|
|
2113
|
+
|
|
2114
|
+
{#snippet tourTrigger(start)}
|
|
2115
|
+
<Button onclick={start}>Start Tour</Button>
|
|
2116
|
+
{/snippet}
|
|
2117
|
+
|
|
2118
|
+
<Tour
|
|
2119
|
+
trigger={tourTrigger}
|
|
2120
|
+
steps={[
|
|
2121
|
+
{
|
|
2122
|
+
id: 'step-1',
|
|
2123
|
+
type: 'dialog',
|
|
2124
|
+
title: 'Welcome',
|
|
2125
|
+
description: 'This is the first step.',
|
|
2126
|
+
actions: [{ label: 'Next', action: 'next' }]
|
|
2127
|
+
},
|
|
2128
|
+
{
|
|
2129
|
+
id: 'step-2',
|
|
2130
|
+
type: 'dialog',
|
|
2131
|
+
title: 'Done!',
|
|
2132
|
+
description: 'You finished the tour.',
|
|
2133
|
+
actions: [{ label: 'Finish', action: 'dismiss' }]
|
|
2134
|
+
}
|
|
2135
|
+
]}
|
|
2136
|
+
/>
|
|
2137
|
+
```
|
|
2138
|
+
|
|
2139
|
+
The `trigger` snippet receives a `start` function as its first argument — pass it to your button's `onclick` to avoid nested `<button>` elements.
|
|
2140
|
+
|
|
2141
|
+
| Prop | Type | Default |
|
|
2142
|
+
| -------------- | ----------------------- | ------- |
|
|
2143
|
+
| `steps` | `TourStepDetails[]` | `[]` |
|
|
2144
|
+
| `trigger` | `Snippet<[() => void]>` | — |
|
|
2145
|
+
| `showProgress` | `boolean` | `true` |
|
|
2146
|
+
| `showClose` | `boolean` | `true` |
|
|
2147
|
+
|
|
2148
|
+
---
|
|
2149
|
+
|
|
2150
|
+
### FileTree
|
|
2151
|
+
|
|
2152
|
+
File-explorer style tree. Folders (branches) are expand-only — clicking a folder row expands or collapses it but does not select it. Files (leaves) are selectable. Depth indentation is driven by a `--depth` CSS variable; no structural padding is added to containers.
|
|
2153
|
+
|
|
2154
|
+
```svelte
|
|
2155
|
+
<script>
|
|
2156
|
+
import { FileTree, createTreeCollection } from 'horizon-design';
|
|
2157
|
+
|
|
2158
|
+
const collection = createTreeCollection({
|
|
2159
|
+
nodeToValue: (n) => n.id,
|
|
2160
|
+
nodeToString: (n) => n.name,
|
|
2161
|
+
rootNode: {
|
|
2162
|
+
id: 'root',
|
|
2163
|
+
name: '',
|
|
2164
|
+
children: [
|
|
2165
|
+
{
|
|
2166
|
+
id: 'src',
|
|
2167
|
+
name: 'src',
|
|
2168
|
+
children: [
|
|
2169
|
+
{ id: 'app', name: 'app.ts' },
|
|
2170
|
+
{ id: 'index', name: 'index.ts' }
|
|
2171
|
+
]
|
|
2172
|
+
},
|
|
2173
|
+
{ id: 'package', name: 'package.json' }
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
});
|
|
2177
|
+
|
|
2178
|
+
let selectedValue = $state([]);
|
|
2179
|
+
let expandedValue = $state([]);
|
|
2180
|
+
</script>
|
|
2181
|
+
|
|
2182
|
+
<FileTree {collection} bind:selectedValue bind:expandedValue />
|
|
2183
|
+
```
|
|
2184
|
+
|
|
2185
|
+
| Prop | Type | Default |
|
|
2186
|
+
| ------------------- | ----------------------------------------- | -------------------------- |
|
|
2187
|
+
| `collection` | `TreeCollection<TreeNode>` **(required)** | — |
|
|
2188
|
+
| `icon` | `Snippet<[node]>` | folder/file mingcute icons |
|
|
2189
|
+
| `selectedValue` | `string[]` (bindable) | `[]` |
|
|
2190
|
+
| `expandedValue` | `string[]` (bindable) | `[]` |
|
|
2191
|
+
| `focusedValue` | `string` (bindable) | — |
|
|
2192
|
+
| `onSelectionChange` | `(details) => void` | — |
|
|
2193
|
+
| `onExpandedChange` | `(details) => void` | — |
|
|
2194
|
+
| `onFocusChange` | `(details) => void` | — |
|
|
2195
|
+
|
|
2196
|
+
**Custom icons**
|
|
2197
|
+
|
|
2198
|
+
The `icon` snippet receives the current node:
|
|
2199
|
+
|
|
2200
|
+
```svelte
|
|
2201
|
+
{#snippet icon(node)}
|
|
2202
|
+
{#if node.children}
|
|
2203
|
+
<FolderIcon class="size-4" />
|
|
2204
|
+
{:else}
|
|
2205
|
+
<FileIcon class="size-4" />
|
|
2206
|
+
{/if}
|
|
2207
|
+
{/snippet}
|
|
2208
|
+
|
|
2209
|
+
<FileTree {collection} {icon} />
|
|
2210
|
+
```
|
|
2211
|
+
|
|
2212
|
+
Folder branches default to `mingcute:folder-2-line` / `mingcute:folder-open-line` (open/closed) and files to `mingcute:file-line`.
|
|
2213
|
+
|
|
2214
|
+
The following are re-exported from `horizon-design` for convenience: `createTreeCollection`, `createFileTreeCollection`, `TreeCollection`, `TreeNode`, `TreeCollectionOptions`, `FilePathTreeNode`.
|
|
2215
|
+
|
|
2216
|
+
---
|
|
2217
|
+
|
|
2218
|
+
### HierarchyView
|
|
2219
|
+
|
|
2220
|
+
Unity-style hierarchy panel. Accepts a plain nested object tree — no collection wrapper needed. Both branches and leaves are fully selectable. Clicking a row selects it; only the chevron button toggles expand/collapse. Supports multi-select (Shift-click), inline rename (double-click or F2), long-press drag-and-drop reordering, and keyboard-driven node movement. `onDataChange` fires whenever the tree is mutated by any interaction.
|
|
2221
|
+
|
|
2222
|
+
```svelte
|
|
2223
|
+
<script>
|
|
2224
|
+
import { HierarchyView } from 'horizon-design';
|
|
2225
|
+
|
|
2226
|
+
const data = [
|
|
2227
|
+
{
|
|
2228
|
+
id: 'scene',
|
|
2229
|
+
name: 'Scene',
|
|
2230
|
+
children: [
|
|
2231
|
+
{
|
|
2232
|
+
id: 'player',
|
|
2233
|
+
name: 'Player',
|
|
2234
|
+
children: [
|
|
2235
|
+
{ id: 'camera', name: 'Camera' },
|
|
2236
|
+
{ id: 'mesh', name: 'Mesh' }
|
|
2237
|
+
]
|
|
2238
|
+
},
|
|
2239
|
+
{ id: 'light', name: 'Directional Light' },
|
|
2240
|
+
{
|
|
2241
|
+
id: 'ui',
|
|
2242
|
+
name: 'UI Canvas',
|
|
2243
|
+
children: [{ id: 'hud', name: 'HUD' }]
|
|
2244
|
+
}
|
|
2245
|
+
]
|
|
2246
|
+
}
|
|
2247
|
+
];
|
|
2248
|
+
|
|
2249
|
+
let selectedValue = $state([]);
|
|
2250
|
+
let expandedValue = $state([]);
|
|
2251
|
+
</script>
|
|
2252
|
+
|
|
2253
|
+
<HierarchyView {data} bind:selectedValue bind:expandedValue />
|
|
2254
|
+
```
|
|
2255
|
+
|
|
2256
|
+
| Prop | Type | Default |
|
|
2257
|
+
| ------------------- | ------------------------------------------------ | ---------------------------------- |
|
|
2258
|
+
| `data` | `AnyNode[]` **(required)** | — |
|
|
2259
|
+
| `nodeToValue` | `(node: AnyNode) => string` | uses `node.id` then `node.name` |
|
|
2260
|
+
| `nodeToString` | `(node: AnyNode) => string` | uses `node.name` then `node.label` |
|
|
2261
|
+
| `icon` | `Snippet<[node]>` | `mingcute:file-line` |
|
|
2262
|
+
| `selectedValue` | `string[]` (bindable) | `[]` |
|
|
2263
|
+
| `expandedValue` | `string[]` (bindable) | `[]` |
|
|
2264
|
+
| `onSelectionChange` | `(details: { selectedValue: string[] }) => void` | — |
|
|
2265
|
+
| `onExpandedChange` | `(details: { expandedValue: string[] }) => void` | — |
|
|
2266
|
+
| `onDataChange` | `(data: AnyNode[]) => void` | — |
|
|
2267
|
+
|
|
2268
|
+
`AnyNode` is a flexible shape: `{ id?, name?, label?, children?, [key: string]: unknown }`. Pass the top-level nodes directly — no root wrapper needed.
|
|
2269
|
+
|
|
2270
|
+
**Keyboard shortcuts**
|
|
2271
|
+
|
|
2272
|
+
| Key | Action |
|
|
2273
|
+
| ---------------------- | ----------------------------------------------- |
|
|
2274
|
+
| `↑` / `↓` | Move cursor |
|
|
2275
|
+
| `→` | Expand branch / move cursor into first child |
|
|
2276
|
+
| `←` | Collapse branch / move cursor to parent |
|
|
2277
|
+
| `Shift+↑` / `Shift+↓` | Move focused node up / down within its siblings |
|
|
2278
|
+
| `Shift+→` / `Shift+←` | Indent / outdent focused node |
|
|
2279
|
+
| `Enter` / `Space` | Toggle selection |
|
|
2280
|
+
| `F2` | Rename focused node |
|
|
2281
|
+
| `Delete` / `Backspace` | Delete focused node and its subtree |
|
|
2282
|
+
| `Home` / `End` | Jump to first / last visible node |
|
|
2283
|
+
| `Escape` | Clear selection |
|
|
2284
|
+
|
|
2285
|
+
All nodes default to `mingcute:file-line`. Supply an `icon` snippet to differentiate node types by shape.
|
|
2286
|
+
|
|
2287
|
+
---
|
|
2288
|
+
|
|
2289
|
+
### HorizonLayout
|
|
2290
|
+
|
|
2291
|
+
A resizable, drag-to-reorder tabbed layout engine. Wrapper around [horizon-layout](https://github.com/horizon-engine/horizon-layout).
|
|
2292
|
+
|
|
2293
|
+
```svelte
|
|
2294
|
+
<script>
|
|
2295
|
+
import HorizonLayout from '$lib/components/horizon-layout/HorizonLayout.svelte';
|
|
2296
|
+
import type { LayoutConfig, Id, View } from 'horizon-layout';
|
|
2297
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
2298
|
+
|
|
2299
|
+
let config: LayoutConfig = $state({
|
|
2300
|
+
root: {
|
|
2301
|
+
/* ... */
|
|
2302
|
+
}
|
|
2303
|
+
});
|
|
2304
|
+
|
|
2305
|
+
const views = new SvelteMap<Id, View>([['panel-a', { title: 'Panel A', snippet: mySnippetA }]]);
|
|
2306
|
+
</script>
|
|
2307
|
+
|
|
2308
|
+
<HorizonLayout bind:config {views} />
|
|
2309
|
+
```
|
|
2310
|
+
|
|
2311
|
+
| Prop | Type | Default |
|
|
2312
|
+
| ------------------ | ---------------------------------------- | ------- |
|
|
2313
|
+
| `config` | `LayoutConfig` (bindable) **(required)** | — |
|
|
2314
|
+
| `views` | `SvelteMap<Id, View>` **(required)** | — |
|
|
2315
|
+
| `tabgroupControls` | `View[]` | — |
|
|
2316
|
+
| `showSplitRatio` | `boolean` | `false` |
|
|
2317
|
+
|
|
2318
|
+
---
|
|
2319
|
+
|
|
2320
|
+
## Utilities
|
|
2321
|
+
|
|
2322
|
+
### `theme`
|
|
2323
|
+
|
|
2324
|
+
The global theme store. Import it to read or change the active theme:
|
|
2325
|
+
|
|
2326
|
+
```ts
|
|
2327
|
+
import { theme } from 'horizon-design';
|
|
2328
|
+
|
|
2329
|
+
theme.mode; // 'system' | 'dark' | 'light' — the stored preference
|
|
2330
|
+
theme.resolved; // 'dark' | 'light' — the effective theme (resolves 'system' against OS preference)
|
|
2331
|
+
theme.set('dark');
|
|
2332
|
+
```
|
|
2333
|
+
|
|
2334
|
+
`theme.onChange(callback)` fires whenever the effective theme changes — either because `theme.set()` was called or because the OS preference changed while mode is `'system'`. Returns an unsubscribe function.
|
|
2335
|
+
|
|
2336
|
+
```ts
|
|
2337
|
+
const off = theme.onChange((resolved, mode) => {
|
|
2338
|
+
console.log(resolved); // 'dark' | 'light'
|
|
2339
|
+
console.log(mode); // 'system' | 'dark' | 'light'
|
|
2340
|
+
});
|
|
2341
|
+
|
|
2342
|
+
// later:
|
|
2343
|
+
off();
|
|
2344
|
+
```
|
|
2345
|
+
|
|
2346
|
+
| Member | Type | Description |
|
|
2347
|
+
| -------------- | ---------------------------------------------- | ------------------------------------------------- |
|
|
2348
|
+
| `mode` | `'system' \| 'dark' \| 'light'` | Stored preference (`$state` — reactive in Svelte) |
|
|
2349
|
+
| `resolved` | `'dark' \| 'light'` | Effective theme (resolves `'system'`) |
|
|
2350
|
+
| `set(mode)` | `(mode: ThemeMode) => void` | Change and persist the theme |
|
|
2351
|
+
| `onChange(cb)` | `(cb: (resolved, mode) => void) => () => void` | Subscribe to theme changes; returns unsubscribe |
|
|
2352
|
+
| `init()` | `() => void` | Apply stored theme and listen for OS changes |
|
|
2353
|
+
|
|
2354
|
+
---
|
|
2355
|
+
|
|
2356
|
+
### `cn(...inputs)`
|
|
2357
|
+
|
|
2358
|
+
Merges Tailwind class names (clsx + tailwind-merge).
|
|
2359
|
+
|
|
2360
|
+
```ts
|
|
2361
|
+
import { cn } from 'horizon-design';
|
|
2362
|
+
|
|
2363
|
+
const cls = cn('px-4 py-2', { 'bg-primary': isActive });
|
|
2364
|
+
```
|
|
2365
|
+
|
|
2366
|
+
---
|
|
2367
|
+
|
|
2368
|
+
### `createMonacoTheme()`
|
|
2369
|
+
|
|
2370
|
+
Returns a Monaco `IStandaloneThemeData` object built from the active Horizon CSS tokens. Call it after the DOM is ready (so CSS variables are resolved) and re-call when the theme switches.
|
|
2371
|
+
|
|
2372
|
+
```ts
|
|
2373
|
+
import { createMonacoTheme } from 'horizon-design';
|
|
2374
|
+
import * as monaco from 'monaco-editor';
|
|
2375
|
+
|
|
2376
|
+
monaco.editor.defineTheme('horizon', createMonacoTheme());
|
|
2377
|
+
monaco.editor.setTheme('horizon');
|
|
2378
|
+
```
|
|
2379
|
+
|
|
2380
|
+
To keep it in sync with the Horizon theme store:
|
|
2381
|
+
|
|
2382
|
+
```ts
|
|
2383
|
+
import { theme, createMonacoTheme } from 'horizon-design';
|
|
2384
|
+
import * as monaco from 'monaco-editor';
|
|
2385
|
+
|
|
2386
|
+
$effect(() => {
|
|
2387
|
+
void theme.mode;
|
|
2388
|
+
monaco.editor.defineTheme('horizon', createMonacoTheme());
|
|
2389
|
+
monaco.editor.setTheme('horizon');
|
|
2390
|
+
});
|
|
2391
|
+
```
|
|
2392
|
+
|
|
2393
|
+
---
|
|
2394
|
+
|
|
2395
|
+
## Theme Tokens
|
|
2396
|
+
|
|
2397
|
+
Override any token in your CSS:
|
|
2398
|
+
|
|
2399
|
+
```css
|
|
2400
|
+
:root {
|
|
2401
|
+
--primary: oklch(0.7 0.2 300);
|
|
2402
|
+
--radius: 0.75rem;
|
|
2403
|
+
}
|
|
2404
|
+
```
|
|
2405
|
+
|
|
2406
|
+
| Token | Dark (default) | Light (`.light`) |
|
|
2407
|
+
| ---------------------- | ----------------------------- | ----------------------------- |
|
|
2408
|
+
| `--background` | `oklch(0.09 0.02 264)` | `oklch(0.96 0.01 264)` |
|
|
2409
|
+
| `--foreground` | `oklch(0.89 0.02 255)` | `oklch(0.13 0.02 264)` |
|
|
2410
|
+
| `--primary` | `oklch(0.65 0.18 277)` | `oklch(0.55 0.18 277)` |
|
|
2411
|
+
| `--primary-foreground` | `white` | `white` |
|
|
2412
|
+
| `--secondary` | `oklch(0.16 0.03 265)` | `oklch(0.9 0.02 264)` |
|
|
2413
|
+
| `--muted` | `oklch(0.16 0.03 265)` | `oklch(0.92 0.015 264)` |
|
|
2414
|
+
| `--muted-foreground` | `oklch(0.59 0.03 255)` | `oklch(0.42 0.04 255)` |
|
|
2415
|
+
| `--accent` | `oklch(0.22 0.05 266)` | `oklch(0.88 0.025 264)` |
|
|
2416
|
+
| `--card` | `oklch(0.13 0.02 264)` | `white` |
|
|
2417
|
+
| `--popover` | `oklch(0.12 0.02 264 / 0.92)` | `oklch(0.98 0.01 264 / 0.95)` |
|
|
2418
|
+
| `--border` | `oklch(0.22 0.05 266)` | `oklch(0.82 0.02 264)` |
|
|
2419
|
+
| `--input` | `oklch(0.19 0.02 264)` | `oklch(0.88 0.02 264)` |
|
|
2420
|
+
| `--ring` | `oklch(0.65 0.18 277 / 0.55)` | `oklch(0.55 0.18 277 / 0.55)` |
|
|
2421
|
+
| `--destructive` | `oklch(0.6 0.22 25)` | same |
|
|
2422
|
+
| `--success` | `oklch(0.65 0.18 142)` | same |
|
|
2423
|
+
| `--warning` | `oklch(0.75 0.18 85)` | same |
|
|
2424
|
+
| `--info` | `oklch(0.65 0.18 220)` | same |
|
|
2425
|
+
| `--radius` | `0.5rem` | same |
|
|
2426
|
+
|
|
2427
|
+
---
|
|
2428
|
+
|
|
2429
|
+
## Fonts
|
|
2430
|
+
|
|
2431
|
+
Both fonts are self-hosted and bundled with the library CSS.
|
|
2432
|
+
|
|
2433
|
+
| Token | Family | Usage |
|
|
2434
|
+
| ------------- | ----------------------------------------------------------------------- | ----------------------------- |
|
|
2435
|
+
| `--font-sans` | [Encode Sans](https://fonts.google.com/specimen/Encode+Sans) (variable) | All UI text |
|
|
2436
|
+
| `--font-mono` | [Lilex](https://github.com/mishamyrt/Lilex) (variable) | Code, `Kbd`, numeric displays |
|
|
2437
|
+
|
|
2438
|
+
`Encode Sans` is applied at `semi-expanded` stretch by default. Override either token in your CSS to swap in a different font:
|
|
2439
|
+
|
|
2440
|
+
```css
|
|
2441
|
+
:root {
|
|
2442
|
+
--font-mono: 'Fira Code', monospace;
|
|
2443
|
+
}
|
|
2444
|
+
```
|