flowbite-svelte 0.44.7 → 0.44.9
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/.env +2 -0
- package/.eslintrc.cjs +20 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +33 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- package/.github/pull_request_template.md +71 -0
- package/.github/workflows/playwright-and-lint.yaml +47 -0
- package/.prettierignore +16 -0
- package/.prettierrc +9 -0
- package/CHANGELOG.md +3858 -0
- package/CONTRIBUTING.md +66 -0
- package/dist/bottom-nav/BottomNavItem.svelte +3 -1
- package/dist/bottom-nav/BottomNavItem.svelte.d.ts +2 -0
- package/dist/bottom-nav/BottomNavItem.svelte.d.ts.map +1 -1
- package/dist/carousels/Carousel.svelte +52 -153
- package/dist/carousels/Carousel.svelte.d.ts +22 -37
- package/dist/carousels/Carousel.svelte.d.ts.map +1 -1
- package/dist/carousels/ControlButton.svelte +31 -0
- package/dist/carousels/ControlButton.svelte.d.ts +29 -0
- package/dist/carousels/ControlButton.svelte.d.ts.map +1 -0
- package/dist/carousels/Controls.svelte +17 -0
- package/dist/carousels/Controls.svelte.d.ts +23 -0
- package/dist/carousels/Controls.svelte.d.ts.map +1 -0
- package/dist/carousels/Indicators.svelte +26 -0
- package/dist/carousels/Indicators.svelte.d.ts +32 -0
- package/dist/carousels/Indicators.svelte.d.ts.map +1 -0
- package/dist/carousels/Thumbnail.svelte +6 -23
- package/dist/carousels/Thumbnail.svelte.d.ts +5 -16
- package/dist/carousels/Thumbnail.svelte.d.ts.map +1 -1
- package/dist/carousels/Thumbnails.svelte +26 -0
- package/dist/carousels/Thumbnails.svelte.d.ts +33 -0
- package/dist/carousels/Thumbnails.svelte.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/tables/TableSearch.svelte +2 -2
- package/dist/tables/TableSearch.svelte.d.ts +1 -1
- package/mdsvex.config.js +18 -0
- package/package.json +18 -80
- package/playwright.config.ts +12 -0
- package/postcss.config.cjs +12 -0
- package/src/app.css +45 -0
- package/src/app.d.ts +9 -0
- package/src/app.html +28 -0
- package/src/app.postcss +55 -0
- package/src/hooks.server.js +27 -0
- package/src/lib/accordion/Accordion.svelte +61 -0
- package/src/lib/accordion/AccordionItem.svelte +120 -0
- package/src/lib/alerts/Alert.svelte +60 -0
- package/src/lib/avatar/Avatar.svelte +56 -0
- package/src/lib/avatar/Placeholder.svelte +16 -0
- package/src/lib/badges/Badge.svelte +108 -0
- package/src/lib/banner/Banner.svelte +64 -0
- package/src/lib/bottom-nav/BottomNav.svelte +76 -0
- package/src/lib/bottom-nav/BottomNavHeader.svelte +19 -0
- package/src/lib/bottom-nav/BottomNavHeaderItem.svelte +23 -0
- package/src/lib/bottom-nav/BottomNavItem.svelte +76 -0
- package/src/lib/breadcrumbs/Breadcrumb.svelte +25 -0
- package/src/lib/breadcrumbs/BreadcrumbItem.svelte +51 -0
- package/src/lib/buttongroups/ButtonGroup.svelte +22 -0
- package/src/lib/buttons/Button.svelte +100 -0
- package/src/lib/buttons/GradientButton.svelte +79 -0
- package/src/lib/cards/Card.svelte +70 -0
- package/src/lib/carousels/Carousel.svelte +166 -0
- package/src/lib/carousels/ControlButton.svelte +34 -0
- package/src/lib/carousels/Controls.svelte +21 -0
- package/src/lib/carousels/Indicators.svelte +31 -0
- package/src/lib/carousels/Thumbnail.svelte +20 -0
- package/src/lib/carousels/Thumbnails.svelte +30 -0
- package/src/lib/charts/Chart.svelte +35 -0
- package/src/lib/darkmode/DarkMode.svelte +58 -0
- package/src/lib/datepicker/Calender.svelte +3 -0
- package/src/lib/datepicker/Datepicker.svelte +66 -0
- package/src/lib/device-mockup/Android.svelte +24 -0
- package/src/lib/device-mockup/DefaultMockup.svelte +21 -0
- package/src/lib/device-mockup/DeviceMockup.svelte +235 -0
- package/src/lib/device-mockup/Ios.svelte +21 -0
- package/src/lib/device-mockup/Smartwatch.svelte +15 -0
- package/src/lib/device-mockup/Tablet.svelte +21 -0
- package/src/lib/drawer/Drawer.svelte +87 -0
- package/src/lib/dropdowns/Dropdown.svelte +81 -0
- package/src/lib/dropdowns/DropdownDivider.svelte +13 -0
- package/src/lib/dropdowns/DropdownHeader.svelte +21 -0
- package/src/lib/dropdowns/DropdownItem.svelte +47 -0
- package/src/lib/footer/Footer.svelte +18 -0
- package/src/lib/footer/FooterBrand.svelte +39 -0
- package/src/lib/footer/FooterCopyright.svelte +38 -0
- package/src/lib/footer/FooterIcon.svelte +25 -0
- package/src/lib/footer/FooterLink.svelte +26 -0
- package/src/lib/footer/FooterLinkGroup.svelte +15 -0
- package/src/lib/forms/Checkbox.svelte +70 -0
- package/src/lib/forms/Dropzone.svelte +32 -0
- package/src/lib/forms/Fileupload.svelte +21 -0
- package/src/lib/forms/FloatingLabelInput.svelte +94 -0
- package/src/lib/forms/Helper.svelte +23 -0
- package/src/lib/forms/Input.svelte +83 -0
- package/src/lib/forms/InputAddon.svelte +47 -0
- package/src/lib/forms/Label.svelte +40 -0
- package/src/lib/forms/MultiSelect.svelte +126 -0
- package/src/lib/forms/NumberInput.svelte +16 -0
- package/src/lib/forms/Radio.svelte +53 -0
- package/src/lib/forms/RadioInline.svelte +9 -0
- package/src/lib/forms/Range.svelte +24 -0
- package/src/lib/forms/Search.svelte +44 -0
- package/src/lib/forms/Select.svelte +49 -0
- package/src/lib/forms/Textarea.svelte +51 -0
- package/src/lib/forms/Toggle.svelte +56 -0
- package/src/lib/forms/VoiceSearch.svelte +57 -0
- package/src/lib/gallery/Gallery.svelte +31 -0
- package/src/lib/index.ts +228 -0
- package/src/lib/indicators/Indicator.svelte +86 -0
- package/src/lib/kbd/ArrowKeyDown.svelte +15 -0
- package/src/lib/kbd/ArrowKeyLeft.svelte +15 -0
- package/src/lib/kbd/ArrowKeyRight.svelte +15 -0
- package/src/lib/kbd/ArrowKeyUp.svelte +15 -0
- package/src/lib/kbd/Kbd.svelte +15 -0
- package/src/lib/list-group/Listgroup.svelte +45 -0
- package/src/lib/list-group/ListgroupItem.svelte +57 -0
- package/src/lib/megamenu/MegaMenu.svelte +52 -0
- package/src/lib/modals/Modal.svelte +162 -0
- package/src/lib/navbar/Menu.svelte +38 -0
- package/src/lib/navbar/NavBrand.svelte +15 -0
- package/src/lib/navbar/NavHamburger.svelte +20 -0
- package/src/lib/navbar/NavLi.svelte +37 -0
- package/src/lib/navbar/NavSidebarHamburger.svelte +20 -0
- package/src/lib/navbar/NavUl.svelte +68 -0
- package/src/lib/navbar/Navbar.svelte +42 -0
- package/src/lib/navbar/SidebarMenu.svelte +37 -0
- package/src/lib/paginations/Pagination.svelte +59 -0
- package/src/lib/paginations/PaginationItem.svelte +40 -0
- package/src/lib/popover/Popover.svelte +34 -0
- package/src/lib/progressbars/Progressbar.svelte +52 -0
- package/src/lib/ratings/AdvancedRating.svelte +45 -0
- package/src/lib/ratings/Heart.svelte +39 -0
- package/src/lib/ratings/Rating.svelte +57 -0
- package/src/lib/ratings/RatingComment.svelte +85 -0
- package/src/lib/ratings/Review.svelte +78 -0
- package/src/lib/ratings/ScoreRating.svelte +76 -0
- package/src/lib/ratings/Star.svelte +47 -0
- package/src/lib/ratings/Thumbup.svelte +39 -0
- package/src/lib/sidebars/Sidebar.svelte +40 -0
- package/src/lib/sidebars/SidebarBrand.svelte +24 -0
- package/src/lib/sidebars/SidebarCta.svelte +28 -0
- package/src/lib/sidebars/SidebarDropdownItem.svelte +26 -0
- package/src/lib/sidebars/SidebarDropdownWrapper.svelte +71 -0
- package/src/lib/sidebars/SidebarGroup.svelte +24 -0
- package/src/lib/sidebars/SidebarItem.svelte +49 -0
- package/src/lib/sidebars/SidebarWrapper.svelte +16 -0
- package/src/lib/skeleton/CardPlaceholder.svelte +48 -0
- package/src/lib/skeleton/ImagePlaceholder.svelte +31 -0
- package/src/lib/skeleton/ListPlaceholder.svelte +50 -0
- package/src/lib/skeleton/Skeleton.svelte +38 -0
- package/src/lib/skeleton/TestimonialPlaceholder.svelte +24 -0
- package/src/lib/skeleton/TextPlaceholder.svelte +60 -0
- package/src/lib/skeleton/VideoPlaceholder.svelte +33 -0
- package/src/lib/skeleton/WidgetPlaceholder.svelte +26 -0
- package/src/lib/speed-dial/SpeedDial.svelte +80 -0
- package/src/lib/speed-dial/SpeedDialButton.svelte +49 -0
- package/src/lib/spinners/Spinner.svelte +49 -0
- package/src/lib/steps/StepIndicator.svelte +75 -0
- package/src/lib/tables/Table.svelte +49 -0
- package/src/lib/tables/TableBody.svelte +14 -0
- package/src/lib/tables/TableBodyCell.svelte +22 -0
- package/src/lib/tables/TableBodyRow.svelte +50 -0
- package/src/lib/tables/TableHead.svelte +45 -0
- package/src/lib/tables/TableHeadCell.svelte +15 -0
- package/src/lib/tables/TableSearch.svelte +73 -0
- package/src/lib/tabs/TabItem.svelte +61 -0
- package/src/lib/tabs/Tabs.svelte +78 -0
- package/src/lib/timeline/Activity.svelte +16 -0
- package/src/lib/timeline/ActivityItem.svelte +59 -0
- package/src/lib/timeline/Group.svelte +27 -0
- package/src/lib/timeline/GroupItem.svelte +59 -0
- package/src/lib/timeline/Timeline.svelte +25 -0
- package/src/lib/timeline/TimelineHorizontal.svelte +17 -0
- package/src/lib/timeline/TimelineItem.svelte +116 -0
- package/src/lib/timeline/TimelineItemHorizontal.svelte +72 -0
- package/src/lib/timeline/TimelineItemVertical.svelte +44 -0
- package/src/lib/toasts/Toast.svelte +99 -0
- package/src/lib/toolbar/Toolbar.svelte +52 -0
- package/src/lib/toolbar/ToolbarButton.svelte +67 -0
- package/src/lib/toolbar/ToolbarGroup.svelte +20 -0
- package/src/lib/tooltips/Tooltip.svelte +42 -0
- package/src/lib/types.ts +163 -0
- package/src/lib/typography/A.svelte +20 -0
- package/src/lib/typography/Blockquote.svelte +51 -0
- package/src/lib/typography/DescriptionList.svelte +22 -0
- package/src/lib/typography/Heading.svelte +28 -0
- package/src/lib/typography/Hr.svelte +37 -0
- package/src/lib/typography/Img.svelte +39 -0
- package/src/lib/typography/Layout.svelte +21 -0
- package/src/lib/typography/Li.svelte +19 -0
- package/src/lib/typography/List.svelte +33 -0
- package/src/lib/typography/Mark.svelte +20 -0
- package/src/lib/typography/P.svelte +102 -0
- package/src/lib/typography/Secondary.svelte +18 -0
- package/src/lib/typography/Span.svelte +35 -0
- package/src/lib/utils/CloseButton.svelte +19 -0
- package/src/lib/utils/Frame.svelte +142 -0
- package/src/lib/utils/Popper.svelte +206 -0
- package/src/lib/utils/Wrapper.svelte +22 -0
- package/src/lib/utils/backdrop.ts +101 -0
- package/src/lib/utils/clickOutside.ts +16 -0
- package/src/lib/utils/createEventDispatcher.ts +24 -0
- package/src/lib/utils/focusTrap.js +42 -0
- package/src/lib/utils/generateId.js +5 -0
- package/src/lib/video/Video.svelte +29 -0
- package/src/routes/+error.svelte +5 -0
- package/src/routes/+layout.svelte +98 -0
- package/src/routes/+page.server.ts +18 -0
- package/src/routes/+page.svelte +55 -0
- package/src/routes/api/posts/+server.js +7 -0
- package/src/routes/component-data/A.json +10 -0
- package/src/routes/component-data/Accordion.json +12 -0
- package/src/routes/component-data/AccordionItem.json +23 -0
- package/src/routes/component-data/Activity.json +1 -0
- package/src/routes/component-data/ActivityItem.json +16 -0
- package/src/routes/component-data/AdvancedRating.json +13 -0
- package/src/routes/component-data/Alert.json +9 -0
- package/src/routes/component-data/Android.json +12 -0
- package/src/routes/component-data/ArrowKeyDown.json +1 -0
- package/src/routes/component-data/ArrowKeyLeft.json +1 -0
- package/src/routes/component-data/ArrowKeyRight.json +1 -0
- package/src/routes/component-data/ArrowKeyUp.json +1 -0
- package/src/routes/component-data/Avatar.json +15 -0
- package/src/routes/component-data/Badge.json +10 -0
- package/src/routes/component-data/Banner.json +12 -0
- package/src/routes/component-data/Blockquote.json +15 -0
- package/src/routes/component-data/BottomNav.json +13 -0
- package/src/routes/component-data/BottomNavHeader.json +9 -0
- package/src/routes/component-data/BottomNavHeaderItem.json +11 -0
- package/src/routes/component-data/BottomNavItem.json +12 -0
- package/src/routes/component-data/Breadcrumb.json +11 -0
- package/src/routes/component-data/BreadcrumbItem.json +12 -0
- package/src/routes/component-data/Button.json +14 -0
- package/src/routes/component-data/ButtonGroup.json +9 -0
- package/src/routes/component-data/Calender.json +1 -0
- package/src/routes/component-data/Card.json +13 -0
- package/src/routes/component-data/CardPlaceholder.json +9 -0
- package/src/routes/component-data/Carousel.json +11 -0
- package/src/routes/component-data/Chart.json +1 -0
- package/src/routes/component-data/Checkbox.json +14 -0
- package/src/routes/component-data/CloseButton.json +1 -0
- package/src/routes/component-data/ControlButton.json +9 -0
- package/src/routes/component-data/Controls.json +1 -0
- package/src/routes/component-data/DarkMode.json +9 -0
- package/src/routes/component-data/Datepicker.json +14 -0
- package/src/routes/component-data/DefaultMockup.json +11 -0
- package/src/routes/component-data/DescriptionList.json +10 -0
- package/src/routes/component-data/DeviceMockup.json +50 -0
- package/src/routes/component-data/Drawer.json +23 -0
- package/src/routes/component-data/Dropdown.json +13 -0
- package/src/routes/component-data/DropdownDivider.json +1 -0
- package/src/routes/component-data/DropdownHeader.json +9 -0
- package/src/routes/component-data/DropdownItem.json +10 -0
- package/src/routes/component-data/Dropzone.json +10 -0
- package/src/routes/component-data/Fileupload.json +10 -0
- package/src/routes/component-data/FloatingLabelInput.json +14 -0
- package/src/routes/component-data/Footer.json +1 -0
- package/src/routes/component-data/FooterBrand.json +15 -0
- package/src/routes/component-data/FooterCopyright.json +14 -0
- package/src/routes/component-data/FooterIcon.json +11 -0
- package/src/routes/component-data/FooterLink.json +11 -0
- package/src/routes/component-data/FooterLinkGroup.json +1 -0
- package/src/routes/component-data/Frame.json +18 -0
- package/src/routes/component-data/Gallery.json +9 -0
- package/src/routes/component-data/GradientButton.json +9 -0
- package/src/routes/component-data/Group.json +11 -0
- package/src/routes/component-data/GroupItem.json +13 -0
- package/src/routes/component-data/Heading.json +10 -0
- package/src/routes/component-data/Heart.json +14 -0
- package/src/routes/component-data/Helper.json +9 -0
- package/src/routes/component-data/Hr.json +13 -0
- package/src/routes/component-data/ImagePlaceholder.json +9 -0
- package/src/routes/component-data/Img.json +17 -0
- package/src/routes/component-data/Indicator.json +13 -0
- package/src/routes/component-data/Indicators.json +9 -0
- package/src/routes/component-data/Input.json +13 -0
- package/src/routes/component-data/InputAddon.json +1 -0
- package/src/routes/component-data/Ios.json +11 -0
- package/src/routes/component-data/Kbd.json +1 -0
- package/src/routes/component-data/Label.json +10 -0
- package/src/routes/component-data/Layout.json +10 -0
- package/src/routes/component-data/Li.json +9 -0
- package/src/routes/component-data/List.json +10 -0
- package/src/routes/component-data/ListPlaceholder.json +1 -0
- package/src/routes/component-data/Listgroup.json +10 -0
- package/src/routes/component-data/ListgroupItem.json +17 -0
- package/src/routes/component-data/Mark.json +10 -0
- package/src/routes/component-data/MegaMenu.json +11 -0
- package/src/routes/component-data/Menu.json +11 -0
- package/src/routes/component-data/Modal.json +17 -0
- package/src/routes/component-data/MultiSelect.json +11 -0
- package/src/routes/component-data/NavBrand.json +1 -0
- package/src/routes/component-data/NavHamburger.json +9 -0
- package/src/routes/component-data/NavLi.json +10 -0
- package/src/routes/component-data/NavSidebarHamburger.json +9 -0
- package/src/routes/component-data/NavUl.json +14 -0
- package/src/routes/component-data/Navbar.json +10 -0
- package/src/routes/component-data/NumberInput.json +1 -0
- package/src/routes/component-data/P.json +19 -0
- package/src/routes/component-data/Pagination.json +13 -0
- package/src/routes/component-data/PaginationItem.json +12 -0
- package/src/routes/component-data/Placeholder.json +1 -0
- package/src/routes/component-data/Popover.json +9 -0
- package/src/routes/component-data/Popper.json +17 -0
- package/src/routes/component-data/Progressbar.json +14 -0
- package/src/routes/component-data/Radio.json +13 -0
- package/src/routes/component-data/RadioInline.json +1 -0
- package/src/routes/component-data/Range.json +9 -0
- package/src/routes/component-data/Rating.json +14 -0
- package/src/routes/component-data/RatingComment.json +10 -0
- package/src/routes/component-data/Review.json +13 -0
- package/src/routes/component-data/ScoreRating.json +13 -0
- package/src/routes/component-data/Search.json +10 -0
- package/src/routes/component-data/Secondary.json +9 -0
- package/src/routes/component-data/Select.json +14 -0
- package/src/routes/component-data/Sidebar.json +11 -0
- package/src/routes/component-data/SidebarBrand.json +11 -0
- package/src/routes/component-data/SidebarCta.json +11 -0
- package/src/routes/component-data/SidebarDropdownItem.json +12 -0
- package/src/routes/component-data/SidebarDropdownWrapper.json +14 -0
- package/src/routes/component-data/SidebarGroup.json +10 -0
- package/src/routes/component-data/SidebarItem.json +12 -0
- package/src/routes/component-data/SidebarMenu.json +11 -0
- package/src/routes/component-data/SidebarWrapper.json +1 -0
- package/src/routes/component-data/Skeleton.json +9 -0
- package/src/routes/component-data/Smartwatch.json +9 -0
- package/src/routes/component-data/Span.json +16 -0
- package/src/routes/component-data/SpeedDial.json +18 -0
- package/src/routes/component-data/SpeedDialButton.json +14 -0
- package/src/routes/component-data/Spinner.json +13 -0
- package/src/routes/component-data/Star.json +14 -0
- package/src/routes/component-data/StepIndicator.json +15 -0
- package/src/routes/component-data/TabItem.json +12 -0
- package/src/routes/component-data/Table.json +14 -0
- package/src/routes/component-data/TableBody.json +1 -0
- package/src/routes/component-data/TableBodyCell.json +1 -0
- package/src/routes/component-data/TableBodyRow.json +1 -0
- package/src/routes/component-data/TableHead.json +9 -0
- package/src/routes/component-data/TableHeadCell.json +1 -0
- package/src/routes/component-data/TableSearch.json +19 -0
- package/src/routes/component-data/Tablet.json +11 -0
- package/src/routes/component-data/Tabs.json +13 -0
- package/src/routes/component-data/TestimonialPlaceholder.json +1 -0
- package/src/routes/component-data/TextPlaceholder.json +9 -0
- package/src/routes/component-data/Textarea.json +11 -0
- package/src/routes/component-data/Thumbnail.json +10 -0
- package/src/routes/component-data/Thumbnails.json +9 -0
- package/src/routes/component-data/Thumbup.json +14 -0
- package/src/routes/component-data/Timeline.json +1 -0
- package/src/routes/component-data/TimelineHorizontal.json +1 -0
- package/src/routes/component-data/TimelineItem.json +10 -0
- package/src/routes/component-data/TimelineItemHorizontal.json +19 -0
- package/src/routes/component-data/TimelineItemVertical.json +13 -0
- package/src/routes/component-data/Toast.json +15 -0
- package/src/routes/component-data/Toggle.json +12 -0
- package/src/routes/component-data/Toolbar.json +9 -0
- package/src/routes/component-data/ToolbarButton.json +12 -0
- package/src/routes/component-data/ToolbarGroup.json +1 -0
- package/src/routes/component-data/Tooltip.json +9 -0
- package/src/routes/component-data/Video.json +12 -0
- package/src/routes/component-data/VideoPlaceholder.json +9 -0
- package/src/routes/component-data/VoiceSearch.json +16 -0
- package/src/routes/component-data/WidgetPlaceholder.json +1 -0
- package/src/routes/component-data/Wrapper.json +10 -0
- package/src/routes/component-data/backdrop.json +9 -0
- package/src/routes/component-data/clickOutside.json +1 -0
- package/src/routes/component-data/createEventDispatcher.json +1 -0
- package/src/routes/component-data/focusTrap.json +1 -0
- package/src/routes/component-data/generateId.json +1 -0
- package/src/routes/component-data/index.json +1 -0
- package/src/routes/component-data/types.json +1 -0
- package/src/routes/docs/+layout.js +10 -0
- package/src/routes/docs/+layout.svelte +74 -0
- package/src/routes/docs/components/[slug]/+page.js +13 -0
- package/src/routes/docs/components/[slug]/+page.svelte +6 -0
- package/src/routes/docs/components/accordion.md +315 -0
- package/src/routes/docs/components/alert.md +342 -0
- package/src/routes/docs/components/avatar.md +215 -0
- package/src/routes/docs/components/badge.md +269 -0
- package/src/routes/docs/components/banner.md +166 -0
- package/src/routes/docs/components/bottom-navigation.md +397 -0
- package/src/routes/docs/components/breadcrumb.md +112 -0
- package/src/routes/docs/components/button-group.md +198 -0
- package/src/routes/docs/components/button.md +314 -0
- package/src/routes/docs/components/card.md +423 -0
- package/src/routes/docs/components/carousel.md +242 -0
- package/src/routes/docs/components/darkmode.md +111 -0
- package/src/routes/docs/components/device-mockups.md +212 -0
- package/src/routes/docs/components/drawer.md +638 -0
- package/src/routes/docs/components/dropdown.md +748 -0
- package/src/routes/docs/components/footer.md +268 -0
- package/src/routes/docs/components/forms.md +254 -0
- package/src/routes/docs/components/gallery.md +230 -0
- package/src/routes/docs/components/imageData/+server.js +43 -0
- package/src/routes/docs/components/indicators.md +273 -0
- package/src/routes/docs/components/kbd.md +248 -0
- package/src/routes/docs/components/list-group.md +157 -0
- package/src/routes/docs/components/mega-menu.md +298 -0
- package/src/routes/docs/components/modal.md +413 -0
- package/src/routes/docs/components/navbar.md +342 -0
- package/src/routes/docs/components/pagination.md +350 -0
- package/src/routes/docs/components/popover.md +388 -0
- package/src/routes/docs/components/progress.md +170 -0
- package/src/routes/docs/components/rating.md +326 -0
- package/src/routes/docs/components/sidebar.md +568 -0
- package/src/routes/docs/components/skeleton.md +165 -0
- package/src/routes/docs/components/speed-dial.md +523 -0
- package/src/routes/docs/components/spinner.md +117 -0
- package/src/routes/docs/components/tab.md +341 -0
- package/src/routes/docs/components/table.md +871 -0
- package/src/routes/docs/components/timeline.md +267 -0
- package/src/routes/docs/components/toast.md +362 -0
- package/src/routes/docs/components/tooltip.md +156 -0
- package/src/routes/docs/components/typography.md +158 -0
- package/src/routes/docs/components/video.md +125 -0
- package/src/routes/docs/examples/[slug]/+page.js +13 -0
- package/src/routes/docs/examples/[slug]/+page.svelte +6 -0
- package/src/routes/docs/examples/sidebar-layout.md +20 -0
- package/src/routes/docs/examples/snapshot.md +59 -0
- package/src/routes/docs/examples/testsnap.svelte +49 -0
- package/src/routes/docs/experimental/[slug]/+page.js +13 -0
- package/src/routes/docs/experimental/[slug]/+page.svelte +6 -0
- package/src/routes/docs/experimental/datepicker.md +131 -0
- package/src/routes/docs/extend/CheckCircle.svelte +3 -0
- package/src/routes/docs/extend/[slug]/+page.js +13 -0
- package/src/routes/docs/extend/[slug]/+page.svelte +6 -0
- package/src/routes/docs/extend/flowbite-svelte-blocks.md +28 -0
- package/src/routes/docs/extend/flowbite-svelte-starter.md +34 -0
- package/src/routes/docs/extend/icons.md +204 -0
- package/src/routes/docs/extend/step-indicator.md +162 -0
- package/src/routes/docs/forms/[slug]/+page.js +13 -0
- package/src/routes/docs/forms/[slug]/+page.svelte +6 -0
- package/src/routes/docs/forms/checkbox.md +329 -0
- package/src/routes/docs/forms/file-input.md +171 -0
- package/src/routes/docs/forms/floating-label.md +176 -0
- package/src/routes/docs/forms/input-field.md +398 -0
- package/src/routes/docs/forms/radio.md +303 -0
- package/src/routes/docs/forms/range.md +110 -0
- package/src/routes/docs/forms/search-input.md +133 -0
- package/src/routes/docs/forms/select.md +280 -0
- package/src/routes/docs/forms/textarea.md +142 -0
- package/src/routes/docs/forms/toggle.md +86 -0
- package/src/routes/docs/pages/[slug]/+page.js +13 -0
- package/src/routes/docs/pages/[slug]/+page.svelte +6 -0
- package/src/routes/docs/pages/colors.md +152 -0
- package/src/routes/docs/pages/compiler-speed.md +116 -0
- package/src/routes/docs/pages/customization.md +103 -0
- package/src/routes/docs/pages/how-to-contribute.md +138 -0
- package/src/routes/docs/pages/ide-support.md +19 -0
- package/src/routes/docs/pages/introduction.md +131 -0
- package/src/routes/docs/pages/license.md +22 -0
- package/src/routes/docs/pages/quickstart.md +128 -0
- package/src/routes/docs/pages/typescript.md +25 -0
- package/src/routes/docs/plugins/[slug]/+page.js +13 -0
- package/src/routes/docs/plugins/[slug]/+page.svelte +6 -0
- package/src/routes/docs/plugins/charts.md +990 -0
- package/src/routes/docs/typography/[slug]/+page.js +13 -0
- package/src/routes/docs/typography/[slug]/+page.svelte +6 -0
- package/src/routes/docs/typography/blockquote.md +214 -0
- package/src/routes/docs/typography/heading.md +270 -0
- package/src/routes/docs/typography/hr.md +115 -0
- package/src/routes/docs/typography/image.md +244 -0
- package/src/routes/docs/typography/link.md +147 -0
- package/src/routes/docs/typography/list.md +358 -0
- package/src/routes/docs/typography/paragraph.md +265 -0
- package/src/routes/docs/typography/text.md +340 -0
- package/src/routes/docs/utilities/[slug]/+page.js +13 -0
- package/src/routes/docs/utilities/[slug]/+page.svelte +6 -0
- package/src/routes/docs/utilities/close-button.md +42 -0
- package/src/routes/docs/utilities/label.md +41 -0
- package/src/routes/docs/utilities/toolbar.md +157 -0
- package/src/routes/landing/CTA.svelte +98 -0
- package/src/routes/landing/Components.svelte +42 -0
- package/src/routes/landing/Contributors.svelte +55 -0
- package/src/routes/landing/DesignFigma.svelte +39 -0
- package/src/routes/landing/Featured.svelte +33 -0
- package/src/routes/landing/GetStarted.svelte +23 -0
- package/src/routes/landing/Hero.svelte +38 -0
- package/src/routes/landing/SocialProof.svelte +80 -0
- package/src/routes/landing/utils/A.svelte +5 -0
- package/src/routes/landing/utils/H2.svelte +1 -0
- package/src/routes/landing/utils/Row.svelte +16 -0
- package/src/routes/landing/utils/Section.svelte +9 -0
- package/src/routes/layouts/component/+page.svelte +44 -0
- package/src/routes/layouts/component/Anchor.svelte +29 -0
- package/src/routes/layouts/component/code.svelte +1 -0
- package/src/routes/layouts/component/h1.svelte +0 -0
- package/src/routes/layouts/component/h2.svelte +5 -0
- package/src/routes/layouts/component/h3.svelte +5 -0
- package/src/routes/layouts/testLayout/+page.svelte +5 -0
- package/src/routes/utils/AlgoliaSearch.svelte +22 -0
- package/src/routes/utils/CompoAttributesViewer.svelte +78 -0
- package/src/routes/utils/CompoCard.svelte +36 -0
- package/src/routes/utils/CompoDescription.svelte +7 -0
- package/src/routes/utils/CopyCliboardInput.svelte +45 -0
- package/src/routes/utils/DocBadge.svelte +7 -0
- package/src/routes/utils/DocBadgeList.svelte +10 -0
- package/src/routes/utils/ExampleDarkMode.svelte +16 -0
- package/src/routes/utils/ExampleWrapper.svelte +143 -0
- package/src/routes/utils/Footer.svelte +64 -0
- package/src/routes/utils/GitHubSource.svelte +13 -0
- package/src/routes/utils/GitHubSourceList.svelte +21 -0
- package/src/routes/utils/MetaTag.svelte +42 -0
- package/src/routes/utils/Newsletter.svelte +52 -0
- package/src/routes/utils/PageHeadSection.svelte +20 -0
- package/src/routes/utils/Paging.svelte +60 -0
- package/src/routes/utils/TableDefaultRow.svelte +81 -0
- package/src/routes/utils/TableProp.svelte +41 -0
- package/src/routes/utils/Toc.svelte +55 -0
- package/src/routes/utils/ToolbarLink.svelte +12 -0
- package/src/routes/utils/data.json +48 -0
- package/src/routes/utils/icons/Angular.svelte +3 -0
- package/src/routes/utils/icons/ArrowLeft.svelte +3 -0
- package/src/routes/utils/icons/ArrowRight.svelte +3 -0
- package/src/routes/utils/icons/Check.svelte +3 -0
- package/src/routes/utils/icons/China.svelte +9 -0
- package/src/routes/utils/icons/Clipboard.svelte +3 -0
- package/src/routes/utils/icons/CoinbaseWallet.svelte +4 -0
- package/src/routes/utils/icons/Combinator.svelte +35 -0
- package/src/routes/utils/icons/Community.svelte +5 -0
- package/src/routes/utils/icons/Dev.svelte +9 -0
- package/src/routes/utils/icons/Discord.svelte +5 -0
- package/src/routes/utils/icons/Dribble.svelte +3 -0
- package/src/routes/utils/icons/Figma.svelte +14 -0
- package/src/routes/utils/icons/FlowbiteLogo.svelte +49 -0
- package/src/routes/utils/icons/Fortmatic.svelte +4 -0
- package/src/routes/utils/icons/Germany.svelte +5 -0
- package/src/routes/utils/icons/GitHub.svelte +13 -0
- package/src/routes/utils/icons/Hunt.svelte +17 -0
- package/src/routes/utils/icons/Italy.svelte +7 -0
- package/src/routes/utils/icons/Mail.svelte +4 -0
- package/src/routes/utils/icons/MetaMask.svelte +31 -0
- package/src/routes/utils/icons/Moon.svelte +3 -0
- package/src/routes/utils/icons/Npm.svelte +3 -0
- package/src/routes/utils/icons/OperaWallet.svelte +17 -0
- package/src/routes/utils/icons/Quote.svelte +3 -0
- package/src/routes/utils/icons/React.svelte +4 -0
- package/src/routes/utils/icons/Reddit.svelte +23 -0
- package/src/routes/utils/icons/Sun.svelte +7 -0
- package/src/routes/utils/icons/Usa.svelte +31 -0
- package/src/routes/utils/icons/Vue.svelte +3 -0
- package/src/routes/utils/icons/WalletConnect.svelte +18 -0
- package/src/routes/utils/icons/YouTube.svelte +3 -0
- package/src/routes/utils/icons/YouTubeFull.svelte +17 -0
- package/src/routes/utils/index.ts +146 -0
- package/src/routes/utils/mdsvex.d.ts +8 -0
- package/static/images/alert-prop.png +0 -0
- package/static/images/carousel/cosmic-timetraveler-pYyOZ8q7AII-unsplash.webp +0 -0
- package/static/images/carousel/cristina-gottardi-CSpjU6hYo_0-unsplash.webp +0 -0
- package/static/images/carousel/johannes-plenio-RwHv7LgeC7s-unsplash.webp +0 -0
- package/static/images/carousel/jonatan-pie-3l3RwQdHRHg-unsplash.webp +0 -0
- package/static/images/carousel/mark-harpur-K2s_YE031CA-unsplash.webp +0 -0
- package/static/images/carousel/pietro-de-grandi-T7K4aEPoGGk-unsplash.webp +0 -0
- package/static/images/carousel/sergey-pesterev-tMvuB9se2uQ-unsplash.webp +0 -0
- package/static/images/carousel/solotravelgoals-7kLufxYoqWk-unsplash.webp +0 -0
- package/static/images/carousel-1.svg +4 -0
- package/static/images/carousel-2.svg +4 -0
- package/static/images/carousel-3.svg +4 -0
- package/static/images/carousel-4.svg +4 -0
- package/static/images/carousel-5.svg +4 -0
- package/static/images/code-example-dark.png +0 -0
- package/static/images/code-example.png +0 -0
- package/static/images/colors.webp +0 -0
- package/static/images/components/accordion-dark.svg +40 -0
- package/static/images/components/accordion.svg +40 -0
- package/static/images/components/alert-dark.svg +11 -0
- package/static/images/components/alert.svg +11 -0
- package/static/images/components/avatar-dark.svg +117 -0
- package/static/images/components/avatar.svg +117 -0
- package/static/images/components/badge-dark.svg +5 -0
- package/static/images/components/badge.svg +5 -0
- package/static/images/components/banner-dark.svg +34 -0
- package/static/images/components/banner.svg +33 -0
- package/static/images/components/bottom-navigation-dark.svg +44 -0
- package/static/images/components/bottom-navigation.svg +43 -0
- package/static/images/components/breadcrumb-dark.svg +7 -0
- package/static/images/components/breadcrumb.svg +7 -0
- package/static/images/components/button-dark.svg +10 -0
- package/static/images/components/button-group-dark.svg +10 -0
- package/static/images/components/button-group.svg +10 -0
- package/static/images/components/button.svg +10 -0
- package/static/images/components/card-dark.svg +31 -0
- package/static/images/components/card.svg +32 -0
- package/static/images/components/carousel-dark.svg +13 -0
- package/static/images/components/carousel.svg +13 -0
- package/static/images/components/charts-dark.svg +29 -0
- package/static/images/components/charts.svg +29 -0
- package/static/images/components/darkmode-dark.svg +7 -0
- package/static/images/components/darkmode.svg +3 -0
- package/static/images/components/device-mockups-dark.svg +17 -0
- package/static/images/components/device-mockups.svg +17 -0
- package/static/images/components/drawer-dark.svg +32 -0
- package/static/images/components/drawer.svg +32 -0
- package/static/images/components/dropdown-dark.svg +35 -0
- package/static/images/components/dropdown.svg +35 -0
- package/static/images/components/footer-dark.svg +52 -0
- package/static/images/components/footer.svg +50 -0
- package/static/images/components/forms-dark.svg +64 -0
- package/static/images/components/forms.svg +64 -0
- package/static/images/components/gallery-dark.svg +14 -0
- package/static/images/components/gallery.svg +14 -0
- package/static/images/components/indicators-dark.svg +38 -0
- package/static/images/components/indicators.svg +38 -0
- package/static/images/components/jumbotron-dark.svg +13 -0
- package/static/images/components/jumbotron.svg +13 -0
- package/static/images/components/kbd-dark.svg +460 -0
- package/static/images/components/kbd.svg +462 -0
- package/static/images/components/list-group-dark.svg +58 -0
- package/static/images/components/list-group.svg +58 -0
- package/static/images/components/mega-menu-dark.svg +71 -0
- package/static/images/components/mega-menu.svg +71 -0
- package/static/images/components/modal-dark.svg +32 -0
- package/static/images/components/modal.svg +33 -0
- package/static/images/components/navbar-dark.svg +78 -0
- package/static/images/components/navbar.svg +78 -0
- package/static/images/components/pagination-dark.svg +50 -0
- package/static/images/components/pagination.svg +50 -0
- package/static/images/components/popover-dark.svg +18 -0
- package/static/images/components/popover.svg +17 -0
- package/static/images/components/progress-dark.svg +10 -0
- package/static/images/components/progress.svg +10 -0
- package/static/images/components/rating-dark.svg +29 -0
- package/static/images/components/rating.svg +29 -0
- package/static/images/components/sidebar-dark.svg +17 -0
- package/static/images/components/sidebar.svg +18 -0
- package/static/images/components/skeleton-dark.svg +10 -0
- package/static/images/components/skeleton.svg +10 -0
- package/static/images/components/speed-dial-dark.svg +69 -0
- package/static/images/components/speed-dial.svg +69 -0
- package/static/images/components/spinner-dark.svg +6 -0
- package/static/images/components/spinner.svg +6 -0
- package/static/images/components/stepper-dark.svg +11 -0
- package/static/images/components/stepper.svg +10 -0
- package/static/images/components/tab-dark.svg +10 -0
- package/static/images/components/tab.svg +10 -0
- package/static/images/components/table-dark.svg +47 -0
- package/static/images/components/table.svg +47 -0
- package/static/images/components/timeline-dark.svg +20 -0
- package/static/images/components/timeline.svg +20 -0
- package/static/images/components/toast-dark.svg +49 -0
- package/static/images/components/toast.svg +49 -0
- package/static/images/components/tooltip-dark.svg +7 -0
- package/static/images/components/tooltip.svg +7 -0
- package/static/images/components/typography-dark.svg +13 -0
- package/static/images/components/typography.svg +13 -0
- package/static/images/components/video-dark.svg +4 -0
- package/static/images/components/video.svg +4 -0
- package/static/images/eugene.jpg +0 -0
- package/static/images/examples/content-gallery-3.png +0 -0
- package/static/images/examples/image-1.jpg +0 -0
- package/static/images/examples/image-1@2x.jpg +0 -0
- package/static/images/examples/image-2@2x.jpg +0 -0
- package/static/images/examples/image-3@2x.jpg +0 -0
- package/static/images/examples/image-4@2x.jpg +0 -0
- package/static/images/experimental/datepicker-dark.svg +67 -0
- package/static/images/experimental/datepicker.svg +67 -0
- package/static/images/favicon.png +0 -0
- package/static/images/favicon.svg +49 -0
- package/static/images/figma-dark.png +0 -0
- package/static/images/figma.png +0 -0
- package/static/images/flowbite-svelte-blocks-optimized.png +0 -0
- package/static/images/flowbite-svelte-icon-logo.svg +49 -0
- package/static/images/flowbite-svelte-icon.svg +49 -0
- package/static/images/flowbite-svelte-og-image.png +0 -0
- package/static/images/flowbite-svelte.png +0 -0
- package/static/images/forms/checkbox-dark.svg +14 -0
- package/static/images/forms/checkbox.svg +14 -0
- package/static/images/forms/file-input-dark.svg +59 -0
- package/static/images/forms/file-input.svg +46 -0
- package/static/images/forms/floating-label-dark.svg +11 -0
- package/static/images/forms/floating-label.svg +11 -0
- package/static/images/forms/input-field-dark.svg +65 -0
- package/static/images/forms/input-field.svg +66 -0
- package/static/images/forms/radio-dark.svg +14 -0
- package/static/images/forms/radio.svg +12 -0
- package/static/images/forms/range-dark.svg +38 -0
- package/static/images/forms/range.svg +38 -0
- package/static/images/forms/search-input-dark.svg +82 -0
- package/static/images/forms/search-input.svg +82 -0
- package/static/images/forms/select-dark.svg +64 -0
- package/static/images/forms/select.svg +64 -0
- package/static/images/forms/textarea-dark.svg +16 -0
- package/static/images/forms/textarea.svg +16 -0
- package/static/images/forms/toggle-dark.svg +12 -0
- package/static/images/forms/toggle.svg +12 -0
- package/static/images/gallery-dark.png +0 -0
- package/static/images/gallery.png +0 -0
- package/static/images/graphs-dark.png +0 -0
- package/static/images/graphs.png +0 -0
- package/static/images/image-1.jpeg +0 -0
- package/static/images/image-1.png +0 -0
- package/static/images/image-1.webp +0 -0
- package/static/images/image-2.jpeg +0 -0
- package/static/images/image-2.png +0 -0
- package/static/images/image-2.webp +0 -0
- package/static/images/image-4.jpeg +0 -0
- package/static/images/image-4.png +0 -0
- package/static/images/image-4.webp +0 -0
- package/static/images/italy.png +0 -0
- package/static/images/nature-1.jpeg +0 -0
- package/static/images/office1.webp +0 -0
- package/static/images/product-1.webp +0 -0
- package/static/images/profile-picture-1.webp +0 -0
- package/static/images/profile-picture-2.webp +0 -0
- package/static/images/profile-picture-3.webp +0 -0
- package/static/images/profile-picture-4.webp +0 -0
- package/static/images/profile-picture-5.webp +0 -0
- package/static/images/sveltekit-sidebar-layout-optimized.png +0 -0
- package/static/images/tailwind-code-dark.png +0 -0
- package/static/images/tailwind-code.png +0 -0
- package/static/images/typography/blockquote-dark.svg +8 -0
- package/static/images/typography/blockquote.svg +8 -0
- package/static/images/typography/heading-dark.svg +5 -0
- package/static/images/typography/heading.svg +5 -0
- package/static/images/typography/hr-dark.svg +7 -0
- package/static/images/typography/hr.svg +7 -0
- package/static/images/typography/image-dark.svg +6 -0
- package/static/images/typography/image.svg +6 -0
- package/static/images/typography/link-dark.svg +4 -0
- package/static/images/typography/link.svg +4 -0
- package/static/images/typography/list-dark.svg +26 -0
- package/static/images/typography/list.svg +26 -0
- package/static/images/typography/paragraph-dark.svg +13 -0
- package/static/images/typography/paragraph.svg +13 -0
- package/static/images/typography/text-dark.svg +11 -0
- package/static/images/typography/text.svg +11 -0
- package/static/site.webmanifest +12 -0
- package/static/styles/docs.css +537 -0
- package/static/videos/compo-doc.gif +0 -0
- package/static/videos/flowbite.mp4 +0 -0
- package/svelte.config.js +28 -0
- package/tailwind.config.cjs +89 -0
- package/tests/components.spec.ts +199 -0
- package/tests/examples.spec.ts +11 -0
- package/tests/extend.spec.ts +19 -0
- package/tests/forms.spec.ts +62 -0
- package/tests/page.spec.ts +46 -0
- package/tests/plugins.spec.ts +7 -0
- package/tests/redirect.spec.ts +175 -0
- package/tests/typography.spec.ts +52 -0
- package/tests/utilities.spec.ts +22 -0
- package/tsconfig.json +21 -0
- package/vite.config.ts +22 -0
- package/vite.config.ts.timestamp-1692816833518-844de2c3e2008.mjs +22 -0
- package/dist/carousels/Caption.svelte +0 -17
- package/dist/carousels/Caption.svelte.d.ts +0 -26
- package/dist/carousels/Caption.svelte.d.ts.map +0 -1
- package/dist/carousels/CarouselTransition.svelte +0 -174
- package/dist/carousels/CarouselTransition.svelte.d.ts +0 -68
- package/dist/carousels/CarouselTransition.svelte.d.ts.map +0 -1
- package/dist/carousels/Indicator.svelte +0 -20
- package/dist/carousels/Indicator.svelte.d.ts +0 -28
- package/dist/carousels/Indicator.svelte.d.ts.map +0 -1
- package/dist/carousels/Slide.svelte +0 -23
- package/dist/carousels/Slide.svelte.d.ts +0 -30
- package/dist/carousels/Slide.svelte.d.ts.map +0 -1
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: componentLayout
|
|
3
|
+
title: Svelte Checkbox - Flowbite
|
|
4
|
+
breadcrumb_title: Svelte Checkbox
|
|
5
|
+
component_title: Checkbox
|
|
6
|
+
dir: Forms
|
|
7
|
+
description: Get started with the checkbox component to allow the user to select one or more options in the form of a square box available in multiple sizes and colors
|
|
8
|
+
thumnailSize: w-72
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { TableProp, TableDefaultRow, CompoAttributesViewer, DocBadgeList } from '../../utils'
|
|
13
|
+
import { Badge, A } from '$lib'
|
|
14
|
+
|
|
15
|
+
const components = 'Checkbox, Label, Helper'
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
The checkbox component can be used to receive one or more selected options from the user in the form of a square box available in multiple styles, sizes, colors, and variants.
|
|
19
|
+
|
|
20
|
+
## Setup
|
|
21
|
+
|
|
22
|
+
```svelte example hideOutput
|
|
23
|
+
<script>
|
|
24
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Checkbox examples
|
|
29
|
+
|
|
30
|
+
Use this default example of a checbkox element in a checked and unchecked state.
|
|
31
|
+
|
|
32
|
+
```svelte example class="flex flex-col gap-4" hideScript
|
|
33
|
+
<script>
|
|
34
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<Checkbox>Default checkbox</Checkbox>
|
|
38
|
+
<Checkbox checked>Checked state</Checkbox>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Disabled state
|
|
42
|
+
|
|
43
|
+
This example can be used for the disabled state of the checkbox component by applying the disabled attribute to the input element.
|
|
44
|
+
|
|
45
|
+
```svelte example class="flex flex-col gap-4" hideScript
|
|
46
|
+
<script>
|
|
47
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<Checkbox disabled>Disabled checkbox</Checkbox>
|
|
51
|
+
<Checkbox disabled checked>Disabled checked</Checkbox>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Alternative syntax
|
|
55
|
+
|
|
56
|
+
If you need separate control over the label and the checkbox you can use the verbose syntax, but then you need to take care about aligning manually.
|
|
57
|
+
|
|
58
|
+
```svelte example class="flex flex-col gap-4"
|
|
59
|
+
<script>
|
|
60
|
+
import { Checkbox, Table, TableHead, TableHeadCell, TableBody, TableBodyCell, Label, TableBodyRow } from 'flowbite-svelte';
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<Table>
|
|
64
|
+
<TableHead>
|
|
65
|
+
<TableHeadCell>Left column</TableHeadCell>
|
|
66
|
+
<TableHeadCell>Right column</TableHeadCell>
|
|
67
|
+
</TableHead>
|
|
68
|
+
<TableBody class="divide-y dark:divide-gray-700">
|
|
69
|
+
<TableBodyRow class="divide-x dark:divide-gray-700">
|
|
70
|
+
<TableBodyCell><Label for="checkbox1">Default checkbox</Label></TableBodyCell>
|
|
71
|
+
<TableBodyCell><Label for="checkbox2">Disabled checkbox</Label></TableBodyCell>
|
|
72
|
+
</TableBodyRow>
|
|
73
|
+
<TableBodyRow class="divide-x dark:divide-gray-700">
|
|
74
|
+
<TableBodyCell><Checkbox id="checkbox1" checked /></TableBodyCell>
|
|
75
|
+
<TableBodyCell><Checkbox id="checkbox2" disabled /></TableBodyCell>
|
|
76
|
+
</TableBodyRow>
|
|
77
|
+
</TableBody>
|
|
78
|
+
</Table>
|
|
79
|
+
|
|
80
|
+
<Label color="red" class="mt-4 flex items-center font-bold italic">
|
|
81
|
+
Label on the other side <Checkbox class="ml-2" />
|
|
82
|
+
</Label>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Checkbox with a link
|
|
86
|
+
|
|
87
|
+
Use this example if you want to add an anchor link inside the label of the checkbox component.
|
|
88
|
+
|
|
89
|
+
```svelte example hideScript
|
|
90
|
+
<script>
|
|
91
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<Checkbox>
|
|
95
|
+
I agree with the
|
|
96
|
+
<a href="/" class="text-primary-600 dark:text-primary-500 hover:underline ml-1">terms and conditions</a>
|
|
97
|
+
.
|
|
98
|
+
</Checkbox>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Helper text
|
|
102
|
+
|
|
103
|
+
Get started with this example if you want to add a secondary helper text for the checkbox component.
|
|
104
|
+
|
|
105
|
+
```svelte example
|
|
106
|
+
<script>
|
|
107
|
+
import { Checkbox, Helper } from 'flowbite-svelte';
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<Checkbox aria-describedby="helper-checkbox-text">Free shipping via Flowbite</Checkbox>
|
|
111
|
+
<Helper id="helper-checkbox-text" class="pl-6">For orders shipped from $25 in books or $29 in other categories</Helper>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Bordered
|
|
115
|
+
|
|
116
|
+
Use this example of a checkbox inside a card element to enable a larger area of clicking activation.
|
|
117
|
+
|
|
118
|
+
```svelte example hideScript
|
|
119
|
+
<script>
|
|
120
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<div class="rounded border border-gray-200 dark:border-gray-700">
|
|
124
|
+
<Checkbox class="w-full p-4">Default radio</Checkbox>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="rounded border border-gray-200 dark:border-gray-700">
|
|
127
|
+
<Checkbox checked class="w-full p-4">Checked state</Checkbox>
|
|
128
|
+
</div>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Checkbox list group
|
|
132
|
+
|
|
133
|
+
Use this example to show a list of checkbox items grouped inside a card.
|
|
134
|
+
|
|
135
|
+
```svelte example hideScript
|
|
136
|
+
<script>
|
|
137
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<p class="mb-4 font-semibold text-gray-900 dark:text-white">Technology</p>
|
|
141
|
+
<ul class="w-48 bg-white rounded-lg border border-gray-200 dark:bg-gray-800 dark:border-gray-600 divide-y divide-gray-200 dark:divide-gray-600">
|
|
142
|
+
<li><Checkbox class="p-3">svelte</Checkbox></li>
|
|
143
|
+
<li><Checkbox class="p-3">Vue JS</Checkbox></li>
|
|
144
|
+
<li><Checkbox class="p-3">React</Checkbox></li>
|
|
145
|
+
<li><Checkbox class="p-3">Angular</Checkbox></li>
|
|
146
|
+
</ul>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Horizontal list group
|
|
150
|
+
|
|
151
|
+
Use this example to show a list of checkbox items inside a card horizontally.
|
|
152
|
+
|
|
153
|
+
```svelte example hideScript
|
|
154
|
+
<script>
|
|
155
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<p class="mb-4 font-semibold text-gray-900 dark:text-white">Identification</p>
|
|
159
|
+
<ul class="items-center w-full rounded-lg border border-gray-200 sm:flex dark:bg-gray-800 dark:border-gray-600 divide-x divide-gray-200 dark:divide-gray-600">
|
|
160
|
+
<li class="w-full"><Checkbox class="p-3">Svelte</Checkbox></li>
|
|
161
|
+
<li class="w-full"><Checkbox class="p-3">Vue JS</Checkbox></li>
|
|
162
|
+
<li class="w-full"><Checkbox class="p-3">React</Checkbox></li>
|
|
163
|
+
<li class="w-full"><Checkbox class="p-3">Angular</Checkbox></li>
|
|
164
|
+
</ul>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Checkbox dropdown
|
|
168
|
+
|
|
169
|
+
Use this example to show a list of checkbox items inside a dropdown menu.
|
|
170
|
+
|
|
171
|
+
```svelte example class="flex justify-center items-start h-96"
|
|
172
|
+
<script>
|
|
173
|
+
import { Dropdown, DropdownItem, Checkbox, Button, Search } from 'flowbite-svelte';
|
|
174
|
+
import { ChevronDownSolid, UserRemoveSolid } from 'flowbite-svelte-icons';
|
|
175
|
+
</script>
|
|
176
|
+
|
|
177
|
+
<Button>Project users<ChevronDownSolid class="w-3 h-3 ml-2 text-white dark:text-white" /></Button>
|
|
178
|
+
<Dropdown class="overflow-y-auto px-3 pb-3 text-sm h-44">
|
|
179
|
+
<div slot="header" class="p-3">
|
|
180
|
+
<Search size="md" />
|
|
181
|
+
</div>
|
|
182
|
+
<li class="rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-600">
|
|
183
|
+
<Checkbox>Robert Gouth</Checkbox>
|
|
184
|
+
</li>
|
|
185
|
+
<li class="rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-600">
|
|
186
|
+
<Checkbox>Jese Leos</Checkbox>
|
|
187
|
+
</li>
|
|
188
|
+
<li class="rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-600">
|
|
189
|
+
<Checkbox checked>Bonnie Green</Checkbox>
|
|
190
|
+
</li>
|
|
191
|
+
<li class="rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-600">
|
|
192
|
+
<Checkbox>Jese Leos</Checkbox>
|
|
193
|
+
</li>
|
|
194
|
+
<li class="rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-600">
|
|
195
|
+
<Checkbox>Robert Gouth</Checkbox>
|
|
196
|
+
</li>
|
|
197
|
+
<li class="rounded p-2 hover:bg-gray-100 dark:hover:bg-gray-600">
|
|
198
|
+
<Checkbox>Bonnie Green</Checkbox>
|
|
199
|
+
</li>
|
|
200
|
+
<a slot="footer" href="/" class="flex items-center p-3 -mb-1 text-sm font-medium text-red-600 bg-gray-50 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600 dark:text-red-500 hover:underline">
|
|
201
|
+
<UserRemoveSolid class="w-5 h-5 mr-1" />Delete user
|
|
202
|
+
</a>
|
|
203
|
+
</Dropdown>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Inline layout
|
|
207
|
+
|
|
208
|
+
You can align the checkbox elements horizontally by using a wrapper tag and applying the flex class.
|
|
209
|
+
|
|
210
|
+
```svelte example hideScript
|
|
211
|
+
<script>
|
|
212
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
213
|
+
</script>
|
|
214
|
+
|
|
215
|
+
<div class="flex gap-3">
|
|
216
|
+
<Checkbox>Inline 1</Checkbox>
|
|
217
|
+
<Checkbox>Inline 2</Checkbox>
|
|
218
|
+
<Checkbox checked>Inline checked</Checkbox>
|
|
219
|
+
<Checkbox disabled>Inline disabled</Checkbox>
|
|
220
|
+
</div>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
You can use the property `inline` as the alternative.
|
|
224
|
+
|
|
225
|
+
```svelte example hideScript
|
|
226
|
+
<script>
|
|
227
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
228
|
+
</script>
|
|
229
|
+
|
|
230
|
+
<Checkbox inline class="mr-2">Inline 1</Checkbox>
|
|
231
|
+
<Checkbox inline class="mr-2">Inline 2</Checkbox>
|
|
232
|
+
<Checkbox inline class="mr-2" checked>Inline checked</Checkbox>
|
|
233
|
+
<Checkbox inline class="mr-2" disabled>Inline disabled</Checkbox>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Colors
|
|
237
|
+
|
|
238
|
+
```svelte example hideScript
|
|
239
|
+
<script>
|
|
240
|
+
import { Label, Checkbox } from 'flowbite-svelte';
|
|
241
|
+
</script>
|
|
242
|
+
|
|
243
|
+
<div class="flex gap-4">
|
|
244
|
+
<Checkbox checked color="red">Red</Checkbox>
|
|
245
|
+
<Checkbox checked color="green">Green</Checkbox>
|
|
246
|
+
<Checkbox checked color="purple">Purple</Checkbox>
|
|
247
|
+
<Checkbox checked color="teal">Teal</Checkbox>
|
|
248
|
+
<Checkbox checked color="yellow">Yellow</Checkbox>
|
|
249
|
+
<Checkbox checked color="orange">Orange</Checkbox>
|
|
250
|
+
<Label class="flex items-center">
|
|
251
|
+
<Checkbox checked inline class="text-sky-400 focus:ring-pink-500" />
|
|
252
|
+
Your custom color
|
|
253
|
+
</Label>
|
|
254
|
+
</div>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Advanced layout
|
|
258
|
+
|
|
259
|
+
Use this example of an advanced layout of checkbox elements where the label parent element can be styled when the checkbox is checked.
|
|
260
|
+
|
|
261
|
+
```svelte example
|
|
262
|
+
<script>
|
|
263
|
+
import { Checkbox } from 'flowbite-svelte';
|
|
264
|
+
import React from '../../utils/icons/React.svelte';
|
|
265
|
+
import Vue from '../../utils/icons/Vue.svelte';
|
|
266
|
+
import Angular from '../../utils/icons/Angular.svelte';
|
|
267
|
+
</script>
|
|
268
|
+
|
|
269
|
+
<p class="mb-5 text-lg font-medium text-gray-900 dark:text-white">Choose technology:</p>
|
|
270
|
+
<div class="grid gap-6 w-full md:grid-cols-3">
|
|
271
|
+
<Checkbox custom>
|
|
272
|
+
<div class="font-normal p-5 w-full text-gray-500 bg-white rounded-lg border-2 border-gray-200 cursor-pointer dark:hover:text-gray-300 dark:border-gray-700 peer-checked:border-primary-600 hover:text-gray-600 dark:peer-checked:text-gray-300 peer-checked:text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700">
|
|
273
|
+
<React />
|
|
274
|
+
<div class="w-full text-lg font-semibold">React Js</div>
|
|
275
|
+
<div class="w-full text-sm">A JavaScript library for building user interfaces.</div>
|
|
276
|
+
</div>
|
|
277
|
+
</Checkbox>
|
|
278
|
+
<Checkbox custom>
|
|
279
|
+
<div class="font-normal p-5 w-full text-gray-500 bg-white rounded-lg border-2 border-gray-200 cursor-pointer dark:hover:text-gray-300 dark:border-gray-700 peer-checked:border-primary-600 hover:text-gray-600 dark:peer-checked:text-gray-300 peer-checked:text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700">
|
|
280
|
+
<Vue />
|
|
281
|
+
<div class="w-full text-lg font-semibold">Vue Js</div>
|
|
282
|
+
<div class="w-full text-sm">Vue.js is an model–view front end JavaScript framework.</div>
|
|
283
|
+
</div>
|
|
284
|
+
</Checkbox>
|
|
285
|
+
<Checkbox custom>
|
|
286
|
+
<div class="font-normal p-5 w-full text-gray-500 bg-white rounded-lg border-2 border-gray-200 cursor-pointer dark:hover:text-gray-300 dark:border-gray-700 peer-checked:border-primary-600 hover:text-gray-600 dark:peer-checked:text-gray-300 peer-checked:text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700">
|
|
287
|
+
<Angular />
|
|
288
|
+
<div class="w-full text-lg font-semibold">Angular</div>
|
|
289
|
+
<div class="w-full text-sm">A TypeScript-based web application framework.</div>
|
|
290
|
+
</div>
|
|
291
|
+
</Checkbox>
|
|
292
|
+
</div>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Group variable
|
|
296
|
+
|
|
297
|
+
```svelte example
|
|
298
|
+
<script>
|
|
299
|
+
import { Button, Checkbox } from 'flowbite-svelte';
|
|
300
|
+
|
|
301
|
+
let group = [2, 3];
|
|
302
|
+
</script>
|
|
303
|
+
|
|
304
|
+
<div class="flex gap-2">
|
|
305
|
+
<Checkbox bind:group value={1}>One</Checkbox>
|
|
306
|
+
<Checkbox bind:group value={2}>Two</Checkbox>
|
|
307
|
+
<Checkbox bind:group value={3}>Three</Checkbox>
|
|
308
|
+
</div>
|
|
309
|
+
<div class="my-2 border border-gray-200 dark:border-gray-700 rounded-lg p-2 w-44">Group: {group}</div>
|
|
310
|
+
<Button on:click={() => (group.length = 0)}>Clear</Button>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Component data
|
|
314
|
+
|
|
315
|
+
The component has the following props, type, and default values. See [types page](/docs/pages/typescript) for type information.
|
|
316
|
+
|
|
317
|
+
### Checkbox styling
|
|
318
|
+
|
|
319
|
+
- Use the `class` prop to overwrite the `label` and `input` tag class.
|
|
320
|
+
|
|
321
|
+
### Helper styling
|
|
322
|
+
|
|
323
|
+
- Use the `class` prop to overwrite the `p` tag class.
|
|
324
|
+
|
|
325
|
+
<CompoAttributesViewer {components}/>
|
|
326
|
+
|
|
327
|
+
## References
|
|
328
|
+
|
|
329
|
+
- [Flowbite Checkbox](https://flowbite.com/docs/forms/checkbox/)
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: componentLayout
|
|
3
|
+
title: Svelte File Input - Flowbite
|
|
4
|
+
breadcrumb_title: Svelte File Input
|
|
5
|
+
component_title: File input
|
|
6
|
+
dir: Forms
|
|
7
|
+
description: Get started with the file input component to let the user to upload one or more files from their device storage based on multiple styles and sizes
|
|
8
|
+
thumnailSize: w-48
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { TableProp, TableDefaultRow, CompoAttributesViewer, DocBadgeList } from '../../utils'
|
|
13
|
+
import { Badge, A } from '$lib'
|
|
14
|
+
const components = 'Fileupload, Dropzone'
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
The file input component can be used to upload one or more files from the device storage of the user available in multiple sizes, styles, variants and support for dark mode.
|
|
18
|
+
|
|
19
|
+
## Setup
|
|
20
|
+
|
|
21
|
+
```svelte example hideOutput
|
|
22
|
+
<script>
|
|
23
|
+
import { Fileupload } from 'flowbite-svelte';
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## File upload example
|
|
28
|
+
|
|
29
|
+
```svelte example
|
|
30
|
+
<script>
|
|
31
|
+
import { Fileupload, Label } from 'flowbite-svelte';
|
|
32
|
+
let value;
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<Label class="space-y-2 mb-2">
|
|
36
|
+
<span>Upload file</span>
|
|
37
|
+
<Fileupload bind:value />
|
|
38
|
+
</Label>
|
|
39
|
+
<Label>File: {value}</Label>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Helper text
|
|
43
|
+
|
|
44
|
+
```svelte example
|
|
45
|
+
<script>
|
|
46
|
+
import { Fileupload, Label, Helper } from 'flowbite-svelte';
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<Label for="with_helper" class="pb-2">Upload file</Label>
|
|
50
|
+
<Fileupload id="with_helper" class="mb-2" />
|
|
51
|
+
<Helper>SVG, PNG, JPG or GIF (MAX. 800x400px).</Helper>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Multiple files
|
|
55
|
+
|
|
56
|
+
When the user selected multiple files, the `value` represents the first file in the list of files they selected. The other files can be identified using the `files` property.
|
|
57
|
+
|
|
58
|
+
```svelte example
|
|
59
|
+
<script>
|
|
60
|
+
import { Fileupload, Label, Listgroup, ListgroupItem } from 'flowbite-svelte';
|
|
61
|
+
let files; // FileList type
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<Label class="pb-2" for="multiple_files">Upload multiple files</Label>
|
|
65
|
+
<Fileupload id="multiple_files" multiple bind:files />
|
|
66
|
+
<Listgroup items={files} let:item class="mt-2">
|
|
67
|
+
{#if item}
|
|
68
|
+
{item.name}
|
|
69
|
+
{:else}
|
|
70
|
+
<ListgroupItem>No files</ListgroupItem>
|
|
71
|
+
{/if}
|
|
72
|
+
</Listgroup>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Sizes
|
|
76
|
+
|
|
77
|
+
```svelte example
|
|
78
|
+
<script>
|
|
79
|
+
import { Fileupload, Label } from 'flowbite-svelte';
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<Label class="pb-2" for="small_size">Small file input</Label>
|
|
83
|
+
<Fileupload id="small_size" size="sm" />
|
|
84
|
+
<Label class="py-2" for="default_size">Default size</Label>
|
|
85
|
+
<Fileupload id="default_size" />
|
|
86
|
+
<Label class="py-2" for="larg_size">Large file input</Label>
|
|
87
|
+
<Fileupload id="larg_size" size="lg" />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Dropzone
|
|
91
|
+
|
|
92
|
+
```svelte example
|
|
93
|
+
<script>
|
|
94
|
+
import { Dropzone } from 'flowbite-svelte';
|
|
95
|
+
|
|
96
|
+
let value = [];
|
|
97
|
+
const dropHandle = (event) => {
|
|
98
|
+
value = [];
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
if (event.dataTransfer.items) {
|
|
101
|
+
[...event.dataTransfer.items].forEach((item, i) => {
|
|
102
|
+
if (item.kind === 'file') {
|
|
103
|
+
const file = item.getAsFile();
|
|
104
|
+
value.push(file.name);
|
|
105
|
+
value = value;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
} else {
|
|
109
|
+
[...event.dataTransfer.files].forEach((file, i) => {
|
|
110
|
+
value = file.name;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const handleChange = (event) => {
|
|
116
|
+
const files = event.target.files;
|
|
117
|
+
if (files.length > 0) {
|
|
118
|
+
value.push(files[0].name);
|
|
119
|
+
value = value;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const showFiles = (files) => {
|
|
124
|
+
if (files.length === 1) return files[0];
|
|
125
|
+
let concat = '';
|
|
126
|
+
files.map((file) => {
|
|
127
|
+
concat += file;
|
|
128
|
+
concat += ',';
|
|
129
|
+
concat += ' ';
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
if (concat.length > 40) concat = concat.slice(0, 40);
|
|
133
|
+
concat += '...';
|
|
134
|
+
return concat;
|
|
135
|
+
};
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<Dropzone
|
|
139
|
+
id="dropzone"
|
|
140
|
+
on:drop={dropHandle}
|
|
141
|
+
on:dragover={(event) => {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
}}
|
|
144
|
+
on:change={handleChange}>
|
|
145
|
+
<svg aria-hidden="true" class="mb-3 w-10 h-10 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" /></svg>
|
|
146
|
+
{#if value.length === 0}
|
|
147
|
+
<p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">Click to upload</span> or drag and drop</p>
|
|
148
|
+
<p class="text-xs text-gray-500 dark:text-gray-400">SVG, PNG, JPG or GIF (MAX. 800x400px)</p>
|
|
149
|
+
{:else}
|
|
150
|
+
<p>{showFiles(value)}</p>
|
|
151
|
+
{/if}
|
|
152
|
+
</Dropzone>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Component data
|
|
156
|
+
|
|
157
|
+
The component has the following props, type, and default values. See [types page](/docs/pages/typescript) for type information.
|
|
158
|
+
|
|
159
|
+
### Fileupload styling
|
|
160
|
+
|
|
161
|
+
- Use the `class` prop to overwrite `inputClass`.
|
|
162
|
+
|
|
163
|
+
### Dropzone styling
|
|
164
|
+
|
|
165
|
+
- Use the `class` prop to overwrite `defaultClass`.
|
|
166
|
+
|
|
167
|
+
<CompoAttributesViewer {components}/>
|
|
168
|
+
|
|
169
|
+
## References
|
|
170
|
+
|
|
171
|
+
- [Flowbite File Input](https://flowbite.com/docs/forms/file-input/)
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: componentLayout
|
|
3
|
+
title: Svelte Floating Label - Flowbite
|
|
4
|
+
breadcrumb_title: Svelte Floating Label
|
|
5
|
+
component_title: Floating Label
|
|
6
|
+
dir: Forms
|
|
7
|
+
description: Use the floating label style for the input field elements to replicate the Material UI design system from Google and choose from multiple styles and sizes
|
|
8
|
+
thumnailSize: w-40
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { TableProp, TableDefaultRow, CompoAttributesViewer, DocBadgeList } from '../../utils'
|
|
13
|
+
import { Badge, A } from '$lib'
|
|
14
|
+
|
|
15
|
+
const components = 'FloatingLabelInput, Helper'
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
The floating label style was first pioneered by Google in its infamous Material UI design system and it’s basically a label tag which floats just above the input field when it is being focused or already has content inside.
|
|
19
|
+
|
|
20
|
+
On this page you will find a three different input field styles including a standard, outlined, and filled style including validation styles and sizes coded with Tailwind CSS and supported for dark mode.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
```svelte example hideOutput
|
|
25
|
+
<script>
|
|
26
|
+
import { FloatingLabelInput, Helper } from 'flowbite-svelte';
|
|
27
|
+
</script>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Floating label examples
|
|
31
|
+
|
|
32
|
+
Get started with the following three styles for the floating label component and use the label tag as a visual placeholder using the peer-placeholder-shown and peer-focus utility classes from Tailwind CSS.
|
|
33
|
+
|
|
34
|
+
```svelte example hideScript
|
|
35
|
+
<script>
|
|
36
|
+
import { FloatingLabelInput } from 'flowbite-svelte';
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<div id="exampleWrapper" class="grid gap-6 items-end w-full md:grid-cols-3">
|
|
40
|
+
<FloatingLabelInput style="filled" id="floating_filled" name="floating_filled" type="text" label="Floating filled" />
|
|
41
|
+
<FloatingLabelInput style="outlined" id="floating_outlined" name="floating_outlined" type="text" label="Floating outlined" />
|
|
42
|
+
<FloatingLabelInput id="floating_standard" name="floating_standard" type="text" label="Floating standard" />
|
|
43
|
+
</div>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Disabled state
|
|
47
|
+
|
|
48
|
+
Apply the disabled attribute to the input fields to disallow the user from changing the content.
|
|
49
|
+
|
|
50
|
+
```svelte example hideScript
|
|
51
|
+
<script>
|
|
52
|
+
import { FloatingLabelInput } from 'flowbite-svelte';
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<div id="exampleWrapper" class="grid gap-6 items-end w-full md:grid-cols-3">
|
|
56
|
+
<FloatingLabelInput style="filled" id="disabled_filled" name="disabled_filled" type="text" label="Disabled filled" disabled />
|
|
57
|
+
<FloatingLabelInput style="outlined" id="disabled_outlined" name="disabled_outlined" type="text" label="Disabled outlined" disabled />
|
|
58
|
+
<FloatingLabelInput id="disabled_standard" name="disabled_standard" type="text" label="Disabled standard" disabled />
|
|
59
|
+
</div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Validation
|
|
63
|
+
|
|
64
|
+
Use the following examples of input validation for the success and error messages by applying the validation text below the input field and using the green or red color classes from Tailwind CSS.
|
|
65
|
+
|
|
66
|
+
```svelte example
|
|
67
|
+
<script>
|
|
68
|
+
import { FloatingLabelInput, Helper } from 'flowbite-svelte';
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<!-- Success messages -->
|
|
72
|
+
<div class="grid gap-6 items-end mb-6 md:grid-cols-3">
|
|
73
|
+
<div>
|
|
74
|
+
<FloatingLabelInput color="green" style="filled" id="filled_success" aria-describedby="filled_success_help" name="filled_success" type="text" label="Filled success" />
|
|
75
|
+
<Helper color="green">
|
|
76
|
+
<span class="font-medium">Well done!</span>
|
|
77
|
+
Some success message.
|
|
78
|
+
</Helper>
|
|
79
|
+
</div>
|
|
80
|
+
<div>
|
|
81
|
+
<FloatingLabelInput color="green" style="outlined" id="outlined_success" aria-describedby="outlined_success_help" name="outlined_success" type="text" label="Outlined success" />
|
|
82
|
+
<Helper color="green">
|
|
83
|
+
<span class="font-medium">Well done!</span>
|
|
84
|
+
Some success message.
|
|
85
|
+
</Helper>
|
|
86
|
+
</div>
|
|
87
|
+
<div>
|
|
88
|
+
<FloatingLabelInput color="green" style="standard" id="standard_success" aria-describedby="standard_success_help" name="standard_success" type="text" label="Standard success" />
|
|
89
|
+
<Helper color="green">
|
|
90
|
+
<span class="font-medium">Well done!</span>
|
|
91
|
+
Some success message.
|
|
92
|
+
</Helper>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<!-- Error messages -->
|
|
96
|
+
<div class="grid gap-6 items-end mb-6 md:grid-cols-3">
|
|
97
|
+
<div>
|
|
98
|
+
<FloatingLabelInput color="red" style="filled" id="filled_error" aria-describedby="filled_error_help" name="filled_error" type="text" label="Filled error" />
|
|
99
|
+
<Helper color="red">
|
|
100
|
+
<span class="font-medium">Oh, snapp!</span>
|
|
101
|
+
Some error message.
|
|
102
|
+
</Helper>
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<FloatingLabelInput color="red" style="outlined" id="outlined_error" aria-describedby="outlined_error_help" name="outlined_success" type="text" label="Outlined error" />
|
|
106
|
+
<Helper color="red">
|
|
107
|
+
<span class="font-medium">Oh, snapp!</span>
|
|
108
|
+
Some error message.
|
|
109
|
+
</Helper>
|
|
110
|
+
</div>
|
|
111
|
+
<div>
|
|
112
|
+
<FloatingLabelInput color="red" style="standard" id="standard_error" aria-describedby="standard_error_help" name="standard_success" type="text" label="Standard error" />
|
|
113
|
+
<Helper color="red">
|
|
114
|
+
<span class="font-medium">Oh, snapp!</span>
|
|
115
|
+
Some error message.
|
|
116
|
+
</Helper>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Sizes
|
|
122
|
+
|
|
123
|
+
Use the small and default sizes of the floating label input fields from the following example.
|
|
124
|
+
|
|
125
|
+
```svelte example hideScript
|
|
126
|
+
<script>
|
|
127
|
+
import { FloatingLabelInput } from 'flowbite-svelte';
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<div class="grid gap-6 items-end mb-6 md:grid-cols-3">
|
|
131
|
+
<FloatingLabelInput size="small" style="filled" id="small_filled" name="small_filled" type="text" label="Small filled" />
|
|
132
|
+
<FloatingLabelInput size="small" style="outlined" id="small_outlined" name="small_outlined" type="text" label="Small outlined" />
|
|
133
|
+
<FloatingLabelInput size="small" id="small_standard" name="small_standard" type="text" label="Small standard" />
|
|
134
|
+
</div>
|
|
135
|
+
<div class="grid gap-6 items-end md:grid-cols-3">
|
|
136
|
+
<FloatingLabelInput style="filled" id="default_filled" name="default_filled" type="text" label="Default filled" />
|
|
137
|
+
<FloatingLabelInput style="outlined" id="default_outlined" name="default_outlined" type="text" label="Default outlined" />
|
|
138
|
+
<FloatingLabelInput id="default_standard" name="default_standard" type="text" label="Default standard" />
|
|
139
|
+
</div>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Helper text
|
|
143
|
+
|
|
144
|
+
Add a helper text in addition to the label if you want to show more information below the input field.
|
|
145
|
+
|
|
146
|
+
```svelte example
|
|
147
|
+
<script>
|
|
148
|
+
import { FloatingLabelInput, Helper } from 'flowbite-svelte';
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<FloatingLabelInput style="filled" id="floating_helper" aria-describedby="floating_helper_text" name="floating_helper" type="text" label="Floating helper" />
|
|
152
|
+
<Helper class="pt-2">
|
|
153
|
+
Remember, contributions to this topic should follow our <a href="/" class="text-primary-600 dark:text-primary-500 hover:underline"> Community Guidelines </a>
|
|
154
|
+
.
|
|
155
|
+
</Helper>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Component data
|
|
159
|
+
|
|
160
|
+
The component has the following props, type, and default values. See [types page](/docs/pages/typescript) for type information.
|
|
161
|
+
|
|
162
|
+
### FloatingLabelInput styling
|
|
163
|
+
|
|
164
|
+
- Use the `classDiv` prop to overwrite the div class.
|
|
165
|
+
- Use the `classInput` prop to overwrite the input class.
|
|
166
|
+
- Use the `classLabel` prop to overwrite the label class.
|
|
167
|
+
|
|
168
|
+
### Helper styling
|
|
169
|
+
|
|
170
|
+
- Use the `class` prop to overwrite the `p` tag class.
|
|
171
|
+
|
|
172
|
+
<CompoAttributesViewer {components}/>
|
|
173
|
+
|
|
174
|
+
## References
|
|
175
|
+
|
|
176
|
+
- [Flowbite Floating Label](https://flowbite.com/docs/forms/floating-label/)
|