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,342 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: componentLayout
|
|
3
|
+
title: Svelte Navbar - Flowbite
|
|
4
|
+
breadcrumb_title: Svelte Navbar
|
|
5
|
+
component_title: Navbar
|
|
6
|
+
dir: Components
|
|
7
|
+
description: The navbar component can be used to show a list of navigation links positioned on the top side of your page based on multiple layouts, sizes, and dropdowns
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { TableProp, TableDefaultRow, CompoAttributesViewer, DocBadgeList } from '../../utils'
|
|
12
|
+
import { Badge, Heading, P, A } from '$lib';
|
|
13
|
+
|
|
14
|
+
const components = 'Navbar, NavBrand, NavLi, NavUl, NavHamburger, Menu, SidebarMenu'
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
Get started with the responsive navbar component from Flowbite to quickly set up a navigation menu for your website and set up the logo, list of pages, CTA button, search input, user profile options with a dropdown, and more.
|
|
18
|
+
|
|
19
|
+
## Setup
|
|
20
|
+
|
|
21
|
+
```svelte example hideOutput
|
|
22
|
+
<script>
|
|
23
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger } from 'flowbite-svelte';
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Default navbar
|
|
28
|
+
|
|
29
|
+
Use this example of a navigation bar built with the utility classes from Tailwind CSS to enable users to navigate across the pages of your website.
|
|
30
|
+
|
|
31
|
+
```svelte example hideScript
|
|
32
|
+
<script>
|
|
33
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger } from 'flowbite-svelte';
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<Navbar let:hidden let:toggle>
|
|
37
|
+
<NavBrand href="/">
|
|
38
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
39
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
40
|
+
</NavBrand>
|
|
41
|
+
<NavHamburger on:click={toggle} />
|
|
42
|
+
<NavUl {hidden}>
|
|
43
|
+
<NavLi href="/">Home</NavLi>
|
|
44
|
+
<NavLi href="/about">About</NavLi>
|
|
45
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
46
|
+
<NavLi href="/pricing">Pricing</NavLi>
|
|
47
|
+
<NavLi href="/contact">Contact</NavLi>
|
|
48
|
+
</NavUl>
|
|
49
|
+
</Navbar>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Active class
|
|
53
|
+
|
|
54
|
+
Utilize the `href` prop within the `NavLi` component to incorporate a hyperlink. To initiate the application of the active class, include the `activeUrl` prop within the `NavUl` component:
|
|
55
|
+
|
|
56
|
+
```svelte example
|
|
57
|
+
<script>
|
|
58
|
+
import { page } from '$app/stores';
|
|
59
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger } from 'flowbite-svelte';
|
|
60
|
+
$: activeUrl = $page.url.pathname;
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<Navbar let:hidden let:toggle>
|
|
64
|
+
<NavBrand href="/">
|
|
65
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
66
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
67
|
+
</NavBrand>
|
|
68
|
+
<NavHamburger on:click={toggle} />
|
|
69
|
+
<NavUl {activeUrl} {hidden}>
|
|
70
|
+
<NavLi href="/">Home</NavLi>
|
|
71
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
72
|
+
<NavLi href="/docs/components/accordion">Accordion</NavLi>
|
|
73
|
+
<NavLi href="/docs/components/alert">Alert</NavLi>
|
|
74
|
+
<NavLi href="/docs/components/avatar">Avatar</NavLi>
|
|
75
|
+
</NavUl>
|
|
76
|
+
</Navbar>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Control the `active` and `nonactive` class by using `activeClass` and `nonActiveClass`:
|
|
80
|
+
|
|
81
|
+
```svelte example
|
|
82
|
+
<script>
|
|
83
|
+
import { page } from '$app/stores';
|
|
84
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger } from 'flowbite-svelte';
|
|
85
|
+
$: activeUrl = $page.url.pathname;
|
|
86
|
+
let activeClass = 'text-white bg-green-700 md:bg-transparent md:text-green-700 md:dark:text-white dark:bg-green-600 md:dark:bg-transparent';
|
|
87
|
+
let nonActiveClass = 'text-gray-700 hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-green-700 dark:text-gray-400 md:dark:hover:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent';
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<Navbar let:hidden let:toggle>
|
|
91
|
+
<NavBrand href="/">
|
|
92
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
93
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
94
|
+
</NavBrand>
|
|
95
|
+
<NavHamburger on:click={toggle} />
|
|
96
|
+
<NavUl {activeUrl} {hidden} {activeClass} {nonActiveClass}>
|
|
97
|
+
<NavLi href="/">Home</NavLi>
|
|
98
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
99
|
+
<NavLi href="/docs/components/accordion">Accordion</NavLi>
|
|
100
|
+
<NavLi href="/docs/components/alert">Alert</NavLi>
|
|
101
|
+
<NavLi href="/docs/components/avatar">Avatar</NavLi>
|
|
102
|
+
</NavUl>
|
|
103
|
+
</Navbar>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Navbar with dropdown
|
|
107
|
+
|
|
108
|
+
This example can be used to show a secondary dropdown menu when clicking on one of the navigation links.
|
|
109
|
+
|
|
110
|
+
```svelte example class="h-80"
|
|
111
|
+
<script>
|
|
112
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger, Dropdown, DropdownItem, DropdownDivider } from 'flowbite-svelte';
|
|
113
|
+
import { ChevronDownOutline } from 'flowbite-svelte-icons';
|
|
114
|
+
import { page } from '$app/stores';
|
|
115
|
+
$: activeUrl = $page.url.pathname;
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<Navbar let:hidden let:toggle>
|
|
119
|
+
<NavBrand href="/">
|
|
120
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
121
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
122
|
+
</NavBrand>
|
|
123
|
+
<NavHamburger on:click={toggle} />
|
|
124
|
+
<NavUl {hidden} {activeUrl}>
|
|
125
|
+
<NavLi href="/">Home</NavLi>
|
|
126
|
+
<NavLi id="nav-menu1" class="cursor-pointer">
|
|
127
|
+
Dropdown<ChevronDownOutline class="w-3 h-3 ml-2 text-primary-800 dark:text-white inline" />
|
|
128
|
+
</NavLi>
|
|
129
|
+
<NavLi href="/settings">Setting</NavLi>
|
|
130
|
+
<NavLi href="/pricing">Pricing</NavLi>
|
|
131
|
+
<NavLi href="/contact">Contact</NavLi>
|
|
132
|
+
<Dropdown triggeredBy="#nav-menu1" class="w-44 z-20">
|
|
133
|
+
<DropdownItem href="/">Dashboard</DropdownItem>
|
|
134
|
+
<DropdownItem href="/docs/components/navbar">Settings</DropdownItem>
|
|
135
|
+
<DropdownItem href="/">Earnings</DropdownItem>
|
|
136
|
+
<DropdownDivider />
|
|
137
|
+
<DropdownItem href="/">Sign out</DropdownItem>
|
|
138
|
+
</Dropdown>
|
|
139
|
+
</NavUl>
|
|
140
|
+
</Navbar>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Navbar with search
|
|
144
|
+
|
|
145
|
+
Use this example of a navbar element to also show a search input element that you can integrate for a site-wide search.
|
|
146
|
+
|
|
147
|
+
```svelte example class="h-80"
|
|
148
|
+
<script>
|
|
149
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger, Button, Input } from 'flowbite-svelte';
|
|
150
|
+
import { SearchOutline } from 'flowbite-svelte-icons';
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<Navbar let:hidden let:toggle>
|
|
154
|
+
<NavBrand href="/">
|
|
155
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
156
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
157
|
+
</NavBrand>
|
|
158
|
+
<div class="flex md:order-2">
|
|
159
|
+
<Button color="none" data-collapse-toggle="mobile-menu-3" aria-controls="mobile-menu-3" aria-expanded="false" class="md:hidden text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 mr-1">
|
|
160
|
+
<SearchOutline class="w-5 h-5" />
|
|
161
|
+
</Button>
|
|
162
|
+
<div class="hidden relative md:block">
|
|
163
|
+
<div class="flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none">
|
|
164
|
+
<SearchOutline class="w-4 h-4" />
|
|
165
|
+
</div>
|
|
166
|
+
<Input id="search-navbar" class="pl-10" placeholder="Search..." />
|
|
167
|
+
</div>
|
|
168
|
+
<NavHamburger on:click={toggle} />
|
|
169
|
+
</div>
|
|
170
|
+
<NavUl {hidden}>
|
|
171
|
+
<NavLi href="/" active={true}>Home</NavLi>
|
|
172
|
+
<NavLi href="/about">About</NavLi>
|
|
173
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
174
|
+
</NavUl>
|
|
175
|
+
</Navbar>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Navbar with CTA button
|
|
179
|
+
|
|
180
|
+
Use the following navbar element to show a call to action button alongside the logo and page links.
|
|
181
|
+
|
|
182
|
+
```svelte example class="h-80 md:h-64"
|
|
183
|
+
<script>
|
|
184
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger, Button, Input } from 'flowbite-svelte';
|
|
185
|
+
</script>
|
|
186
|
+
|
|
187
|
+
<Navbar let:hidden let:toggle>
|
|
188
|
+
<NavBrand href="/">
|
|
189
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
190
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
191
|
+
</NavBrand>
|
|
192
|
+
<div class="flex md:order-2">
|
|
193
|
+
<Button size="sm">Get started</Button>
|
|
194
|
+
<NavHamburger on:click={toggle} />
|
|
195
|
+
</div>
|
|
196
|
+
<NavUl {hidden} class="order-1">
|
|
197
|
+
<NavLi href="/" active={true}>Home</NavLi>
|
|
198
|
+
<NavLi href="/about">About</NavLi>
|
|
199
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
200
|
+
<NavLi href="/pricing">Pricing</NavLi>
|
|
201
|
+
<NavLi href="/contact">Contact</NavLi>
|
|
202
|
+
</NavUl>
|
|
203
|
+
</Navbar>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Sticky navbar
|
|
207
|
+
|
|
208
|
+
Use this example to keep the navbar positioned fixed to the top side as you scroll down the document page.
|
|
209
|
+
|
|
210
|
+
```svelte example class="h-80"
|
|
211
|
+
<script>
|
|
212
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger, ImagePlaceholder, Skeleton, TextPlaceholder } from 'flowbite-svelte';
|
|
213
|
+
</script>
|
|
214
|
+
|
|
215
|
+
<div class="relative px-8">
|
|
216
|
+
<Navbar navClass="px-2 sm:px-4 py-2.5 absolute w-full z-20 top-0 left-0 border-b" let:hidden let:toggle>
|
|
217
|
+
<NavBrand href="/">
|
|
218
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
219
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
220
|
+
</NavBrand>
|
|
221
|
+
<NavHamburger on:click={toggle} />
|
|
222
|
+
<NavUl {hidden}>
|
|
223
|
+
<NavLi href="/" active={true}>Home</NavLi>
|
|
224
|
+
<NavLi href="/about">About</NavLi>
|
|
225
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
226
|
+
<NavLi href="/pricing">Pricing</NavLi>
|
|
227
|
+
<NavLi href="/contact">Contact</NavLi>
|
|
228
|
+
</NavUl>
|
|
229
|
+
</Navbar>
|
|
230
|
+
<div style="height:300px;" class="overflow-scroll pb-16">
|
|
231
|
+
<Skeleton class="mt-16 mb-8" />
|
|
232
|
+
<ImagePlaceholder class="my-8" />
|
|
233
|
+
<TextPlaceholder class="my-8" />
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## User menu dropdown
|
|
239
|
+
|
|
240
|
+
Use this example to create a navigation bar with a user profile or button to toggle a dropdown menu.
|
|
241
|
+
|
|
242
|
+
```svelte example class="h-80"
|
|
243
|
+
<script>
|
|
244
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger, Avatar, Dropdown, DropdownItem, DropdownHeader, DropdownDivider } from 'flowbite-svelte';
|
|
245
|
+
</script>
|
|
246
|
+
|
|
247
|
+
<Navbar let:hidden let:toggle>
|
|
248
|
+
<NavBrand href="/">
|
|
249
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
250
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
251
|
+
</NavBrand>
|
|
252
|
+
<div class="flex items-center md:order-2">
|
|
253
|
+
<Avatar id="avatar-menu" src="/images/profile-picture-3.webp" />
|
|
254
|
+
<NavHamburger on:click={toggle} class1="w-full md:flex md:w-auto md:order-1" />
|
|
255
|
+
</div>
|
|
256
|
+
<Dropdown placement="bottom" triggeredBy="#avatar-menu">
|
|
257
|
+
<DropdownHeader>
|
|
258
|
+
<span class="block text-sm">Bonnie Green</span>
|
|
259
|
+
<span class="block truncate text-sm font-medium">name@flowbite.com</span>
|
|
260
|
+
</DropdownHeader>
|
|
261
|
+
<DropdownItem>Dashboard</DropdownItem>
|
|
262
|
+
<DropdownItem>Settings</DropdownItem>
|
|
263
|
+
<DropdownItem>Earnings</DropdownItem>
|
|
264
|
+
<DropdownDivider />
|
|
265
|
+
<DropdownItem>Sign out</DropdownItem>
|
|
266
|
+
</Dropdown>
|
|
267
|
+
<NavUl {hidden}>
|
|
268
|
+
<NavLi href="/" active={true}>Home</NavLi>
|
|
269
|
+
<NavLi href="/about">About</NavLi>
|
|
270
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
271
|
+
<NavLi href="/pricing">Pricing</NavLi>
|
|
272
|
+
<NavLi href="/contact">Contact</NavLi>
|
|
273
|
+
</NavUl>
|
|
274
|
+
</Navbar>
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Solid background
|
|
278
|
+
|
|
279
|
+
Use this example to show a solid background for the navbar component instead of being transparent.
|
|
280
|
+
|
|
281
|
+
```svelte example
|
|
282
|
+
<script>
|
|
283
|
+
import { Navbar, NavBrand, NavLi, NavUl, NavHamburger } from 'flowbite-svelte';
|
|
284
|
+
</script>
|
|
285
|
+
|
|
286
|
+
<Navbar let:hidden let:toggle rounded color="form">
|
|
287
|
+
<NavBrand href="/">
|
|
288
|
+
<img src="/images/flowbite-svelte-icon-logo.svg" class="mr-3 h-6 sm:h-9" alt="Flowbite Logo" />
|
|
289
|
+
<span class="self-center whitespace-nowrap text-xl font-semibold dark:text-white">Flowbite</span>
|
|
290
|
+
</NavBrand>
|
|
291
|
+
<NavHamburger on:click={toggle} />
|
|
292
|
+
<NavUl {hidden}>
|
|
293
|
+
<NavLi href="/" active={true}>Home</NavLi>
|
|
294
|
+
<NavLi href="/about">About</NavLi>
|
|
295
|
+
<NavLi href="/docs/components/navbar">Navbar</NavLi>
|
|
296
|
+
<NavLi href="/pricing">Pricing</NavLi>
|
|
297
|
+
<NavLi href="/contact">Contact</NavLi>
|
|
298
|
+
</NavUl>
|
|
299
|
+
</Navbar>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Component data
|
|
303
|
+
|
|
304
|
+
The component has the following props, type, and default values. See [types page](/docs/pages/typescript) for type information.
|
|
305
|
+
|
|
306
|
+
### Navbar styling
|
|
307
|
+
|
|
308
|
+
- Use the `class` prop to overwrite `navClass`.
|
|
309
|
+
- Use the `classNavDiv` prop to overwrite `navDivClass`.
|
|
310
|
+
|
|
311
|
+
### NavBrand styling
|
|
312
|
+
|
|
313
|
+
- Use the `class` prop to overwrite the `a` tag class.
|
|
314
|
+
|
|
315
|
+
### NavHamburger styling
|
|
316
|
+
|
|
317
|
+
- Use the `class` prop to overwrite `btnClass`.
|
|
318
|
+
- Use the `classMenu` prop to overwrite `menuClass`.
|
|
319
|
+
|
|
320
|
+
### NavLi styling
|
|
321
|
+
|
|
322
|
+
- Use the `class` prop to overwrite the `li` tag.
|
|
323
|
+
|
|
324
|
+
### NavUl styling
|
|
325
|
+
|
|
326
|
+
- Use the `class` prop to overwrite the `div` tag.
|
|
327
|
+
- Use the `classUl` prop to overwrite the `ul` tag.
|
|
328
|
+
|
|
329
|
+
### Menu styling
|
|
330
|
+
|
|
331
|
+
- Use the `class` prop to overwrite the `svg` tag class.
|
|
332
|
+
|
|
333
|
+
### SidebarMenu styling
|
|
334
|
+
|
|
335
|
+
- Use the `class` prop to overwrite the outer class.
|
|
336
|
+
- Use the `classSideMenu` prop to overwrite the inner class.
|
|
337
|
+
|
|
338
|
+
<CompoAttributesViewer {components}/>
|
|
339
|
+
|
|
340
|
+
## References
|
|
341
|
+
|
|
342
|
+
- [Flowbite Navbar](https://flowbite.com/docs/components/navbar/)
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: componentLayout
|
|
3
|
+
title: Svelte Pagination - Flowbite
|
|
4
|
+
breadcrumb_title: Svelte Pagination
|
|
5
|
+
component_title: Pagination
|
|
6
|
+
dir: Components
|
|
7
|
+
description: Use the Tailwind CSS pagination element to indicate a series of content across various pages
|
|
8
|
+
thumnailSize: w-48
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { TableProp, TableDefaultRow, CompoAttributesViewer, DocBadgeList } from '../../utils'
|
|
13
|
+
import { Badge, Heading, P, A } from '$lib'
|
|
14
|
+
|
|
15
|
+
const components = 'Pagination, PaginationItem'
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
The pagination component can be used to navigate across a series of content and data sets for various pages such as blog posts, products, and more. You can use multiple variants of this component with or without icons and even for paginating table data entries.
|
|
19
|
+
|
|
20
|
+
## Setup
|
|
21
|
+
|
|
22
|
+
```svelte example hideOutput
|
|
23
|
+
<script>
|
|
24
|
+
import { Pagination, PaginationItem } from 'flowbite-svelte';
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Default pagination
|
|
29
|
+
|
|
30
|
+
Use the following list of pagination items to indicate a series of content for your website.
|
|
31
|
+
|
|
32
|
+
```svelte example class="flex flex-col justify-center items-center gap-3"
|
|
33
|
+
<script>
|
|
34
|
+
import { page } from '$app/stores';
|
|
35
|
+
import { Pagination } from 'flowbite-svelte';
|
|
36
|
+
|
|
37
|
+
$: activeUrl = $page.url.searchParams.get('page');
|
|
38
|
+
let pages = [
|
|
39
|
+
{ name: 1, href: '/components/pagination?page=1' },
|
|
40
|
+
{ name: 2, href: '/components/pagination?page=2' },
|
|
41
|
+
{ name: 3, href: '/components/pagination?page=3' },
|
|
42
|
+
{ name: 4, href: '/components/pagination?page=4' },
|
|
43
|
+
{ name: 5, href: '/components/pagination?page=5' }
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
$: {
|
|
47
|
+
pages.forEach((page) => {
|
|
48
|
+
let splitUrl = page.href.split('?');
|
|
49
|
+
let queryString = splitUrl.slice(1).join('?');
|
|
50
|
+
const hrefParams = new URLSearchParams(queryString);
|
|
51
|
+
let hrefValue = hrefParams.get('page');
|
|
52
|
+
if (hrefValue === activeUrl) {
|
|
53
|
+
page.active = true;
|
|
54
|
+
} else {
|
|
55
|
+
page.active = false;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
pages = pages;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const previous = () => {
|
|
62
|
+
alert('Previous btn clicked. Make a call to your server to fetch data.');
|
|
63
|
+
};
|
|
64
|
+
const next = () => {
|
|
65
|
+
alert('Next btn clicked. Make a call to your server to fetch data.');
|
|
66
|
+
};
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<Pagination {pages} on:previous={previous} on:next={next} />
|
|
70
|
+
<Pagination {pages} large on:previous={previous} on:next={next} />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Pagination with icons
|
|
74
|
+
|
|
75
|
+
The following pagination component example shows how you can use SVG icons instead of text to show the previous and next pages.
|
|
76
|
+
|
|
77
|
+
```svelte example class="flex flex-col justify-center items-center gap-3"
|
|
78
|
+
<script>
|
|
79
|
+
import { page } from '$app/stores';
|
|
80
|
+
import { Pagination } from 'flowbite-svelte';
|
|
81
|
+
import { ChevronLeftOutline, ChevronRightOutline } from 'flowbite-svelte-icons';
|
|
82
|
+
|
|
83
|
+
$: activeUrl = $page.url.searchParams.get('page');
|
|
84
|
+
let pages = [
|
|
85
|
+
{ name: 6, href: '/components/pagination?page=6' },
|
|
86
|
+
{ name: 7, href: '/components/pagination?page=7' },
|
|
87
|
+
{ name: 8, href: '/components/pagination?page=8' },
|
|
88
|
+
{ name: 9, href: '/components/pagination?page=9' },
|
|
89
|
+
{ name: 10, href: '/components/pagination?page=10' }
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
$: {
|
|
93
|
+
pages.forEach((page) => {
|
|
94
|
+
let splitUrl = page.href.split('?');
|
|
95
|
+
let queryString = splitUrl.slice(1).join('?');
|
|
96
|
+
const hrefParams = new URLSearchParams(queryString);
|
|
97
|
+
let hrefValue = hrefParams.get('page');
|
|
98
|
+
if (hrefValue === activeUrl) {
|
|
99
|
+
page.active = true;
|
|
100
|
+
} else {
|
|
101
|
+
page.active = false;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
pages = pages;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const previous = () => {
|
|
108
|
+
alert('Previous btn clicked. Make a call to your server to fetch data.');
|
|
109
|
+
};
|
|
110
|
+
const next = () => {
|
|
111
|
+
alert('Next btn clicked. Make a call to your server to fetch data.');
|
|
112
|
+
};
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<Pagination {pages} on:previous={previous} on:next={next} icon>
|
|
116
|
+
<svelte:fragment slot="prev">
|
|
117
|
+
<span class="sr-only">Previous</span>
|
|
118
|
+
<ChevronLeftOutline class="w-2.5 h-2.5" />
|
|
119
|
+
</svelte:fragment>
|
|
120
|
+
<svelte:fragment slot="next">
|
|
121
|
+
<span class="sr-only">Next</span>
|
|
122
|
+
<ChevronRightOutline class="w-2.5 h-2.5" />
|
|
123
|
+
</svelte:fragment>
|
|
124
|
+
</Pagination>
|
|
125
|
+
|
|
126
|
+
<Pagination {pages} large on:previous={previous} on:next={next} icon>
|
|
127
|
+
<svelte:fragment slot="prev">
|
|
128
|
+
<span class="sr-only">Previous</span>
|
|
129
|
+
<ChevronLeftOutline class="w-3 h-3" />
|
|
130
|
+
</svelte:fragment>
|
|
131
|
+
<svelte:fragment slot="next">
|
|
132
|
+
<span class="sr-only">Next</span>
|
|
133
|
+
<ChevronRightOutline class="w-3 h-3" />
|
|
134
|
+
</svelte:fragment>
|
|
135
|
+
</Pagination>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Previous and next
|
|
139
|
+
|
|
140
|
+
Use the following markup to show simple previous and next elements.
|
|
141
|
+
|
|
142
|
+
```svelte example class="flex flex-col justify-center items-center gap-3"
|
|
143
|
+
<script>
|
|
144
|
+
import { Pagination, PaginationItem } from 'flowbite-svelte';
|
|
145
|
+
const previous = () => {
|
|
146
|
+
alert('Previous btn clicked. Make a call to your server to fetch data.');
|
|
147
|
+
};
|
|
148
|
+
const next = () => {
|
|
149
|
+
alert('Next btn clicked. Make a call to your server to fetch data.');
|
|
150
|
+
};
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<div class="flex space-x-3">
|
|
154
|
+
<PaginationItem on:click={previous}>Previous</PaginationItem>
|
|
155
|
+
<PaginationItem on:click={next}>Next</PaginationItem>
|
|
156
|
+
</div>
|
|
157
|
+
<div class="flex space-x-3">
|
|
158
|
+
<PaginationItem large on:click={previous}>Previous</PaginationItem>
|
|
159
|
+
<PaginationItem large on:click={next}>Next</PaginationItem>
|
|
160
|
+
</div>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Previous and next with icons
|
|
164
|
+
|
|
165
|
+
Use the following code to show simple previous and next elements with icons.
|
|
166
|
+
|
|
167
|
+
```svelte example class="flex flex-col justify-center items-center gap-3"
|
|
168
|
+
<script>
|
|
169
|
+
import { Pagination, PaginationItem } from 'flowbite-svelte';
|
|
170
|
+
import { ArrowLeftSolid, ArrowRightSolid } from 'flowbite-svelte-icons';
|
|
171
|
+
const previous = () => {
|
|
172
|
+
alert('Previous btn clicked. Make a call to your server to fetch data.');
|
|
173
|
+
};
|
|
174
|
+
const next = () => {
|
|
175
|
+
alert('Next btn clicked. Make a call to your server to fetch data.');
|
|
176
|
+
};
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<div class="flex space-x-3">
|
|
180
|
+
<PaginationItem class="flex items-center" on:click={previous}>
|
|
181
|
+
<ArrowLeftSolid class="mr-2 w-3.5 h-3.5" />
|
|
182
|
+
Previous
|
|
183
|
+
</PaginationItem>
|
|
184
|
+
<PaginationItem class="flex items-center" on:click={next}>
|
|
185
|
+
Next
|
|
186
|
+
<ArrowRightSolid class="ml-2 w-3.5 h-3.5" />
|
|
187
|
+
</PaginationItem>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="flex space-x-3">
|
|
190
|
+
<PaginationItem large class="flex items-center" on:click={previous}>
|
|
191
|
+
<ArrowLeftSolid class="mr-2 w-5 h-5" />
|
|
192
|
+
Previous
|
|
193
|
+
</PaginationItem>
|
|
194
|
+
<PaginationItem large class="flex items-center" on:click={next}>
|
|
195
|
+
Next
|
|
196
|
+
<ArrowRightSolid class="ml-2 w-5 h-5" />
|
|
197
|
+
</PaginationItem>
|
|
198
|
+
</div>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Table data pagination
|
|
202
|
+
|
|
203
|
+
You can use the following markup to show the number of data shown inside a table element and also the previous and next action buttons.
|
|
204
|
+
|
|
205
|
+
```svelte example class="flex flex-col justify-center items-center gap-3"
|
|
206
|
+
<script>
|
|
207
|
+
import { Pagination, PaginationItem } from 'flowbite-svelte';
|
|
208
|
+
|
|
209
|
+
let helper = { start: 1, end: 10, total: 100 };
|
|
210
|
+
|
|
211
|
+
const previous = () => {
|
|
212
|
+
alert('Previous btn clicked. Make a call to your server to fetch data.');
|
|
213
|
+
};
|
|
214
|
+
const next = () => {
|
|
215
|
+
alert('Next btn clicked. Make a call to your server to fetch data.');
|
|
216
|
+
};
|
|
217
|
+
</script>
|
|
218
|
+
|
|
219
|
+
<div class="flex flex-col items-center justify-center gap-2">
|
|
220
|
+
<div class="text-sm text-gray-700 dark:text-gray-400">
|
|
221
|
+
Showing <span class="font-semibold text-gray-900 dark:text-white">{helper.start}</span>
|
|
222
|
+
to
|
|
223
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.end}</span>
|
|
224
|
+
of
|
|
225
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.total}</span>
|
|
226
|
+
Entries
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<Pagination table>
|
|
230
|
+
<span slot="prev">Prev</span>
|
|
231
|
+
</Pagination>
|
|
232
|
+
</div>
|
|
233
|
+
<div class="flex flex-col items-center justify-center gap-2">
|
|
234
|
+
<div class="text-sm text-gray-700 dark:text-gray-400">
|
|
235
|
+
Showing <span class="font-semibold text-gray-900 dark:text-white">{helper.start}</span>
|
|
236
|
+
to
|
|
237
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.end}</span>
|
|
238
|
+
of
|
|
239
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.total}</span>
|
|
240
|
+
Entries
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
<Pagination table large>
|
|
244
|
+
<span slot="prev">Prev</span>
|
|
245
|
+
</Pagination>
|
|
246
|
+
</div>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Table data pagination with icons
|
|
250
|
+
|
|
251
|
+
You can use the following code to show the number of data shown inside a table element and also the previous and next action buttons coupled with icons.
|
|
252
|
+
|
|
253
|
+
```svelte example class="flex flex-col justify-center items-center gap-3"
|
|
254
|
+
<script>
|
|
255
|
+
import { Pagination } from 'flowbite-svelte';
|
|
256
|
+
import { ArrowLeftOutline, ArrowRightOutline } from 'flowbite-svelte-icons';
|
|
257
|
+
let helper = { start: 1, end: 10, total: 100 };
|
|
258
|
+
|
|
259
|
+
const previous = () => {
|
|
260
|
+
alert('Previous btn clicked. Make a call to your server to fetch data.');
|
|
261
|
+
};
|
|
262
|
+
const next = () => {
|
|
263
|
+
alert('Next btn clicked. Make a call to your server to fetch data.');
|
|
264
|
+
};
|
|
265
|
+
</script>
|
|
266
|
+
|
|
267
|
+
<div class="flex flex-col items-center justify-center gap-2">
|
|
268
|
+
<div class="text-sm text-gray-700 dark:text-gray-400">
|
|
269
|
+
Showing <span class="font-semibold text-gray-900 dark:text-white">{helper.start}</span>
|
|
270
|
+
to
|
|
271
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.end}</span>
|
|
272
|
+
of
|
|
273
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.total}</span>
|
|
274
|
+
Entries
|
|
275
|
+
</div>
|
|
276
|
+
|
|
277
|
+
<Pagination table>
|
|
278
|
+
<div slot="prev" class="flex items-center gap-2 text-white bg-gray-800">
|
|
279
|
+
<ArrowLeftOutline class="w-3.5 h-3.5 mr-2" />
|
|
280
|
+
Prev
|
|
281
|
+
</div>
|
|
282
|
+
<div slot="next" class="flex items-center gap-2 text-white bg-gray-800">
|
|
283
|
+
Next
|
|
284
|
+
<ArrowRightOutline class="w-3.5 h-3.5 ml-2" />
|
|
285
|
+
</div>
|
|
286
|
+
</Pagination>
|
|
287
|
+
</div>
|
|
288
|
+
<div class="flex flex-col items-center justify-center gap-2">
|
|
289
|
+
<div class="text-sm text-gray-700 dark:text-gray-400">
|
|
290
|
+
Showing <span class="font-semibold text-gray-900 dark:text-white">{helper.start}</span>
|
|
291
|
+
to
|
|
292
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.end}</span>
|
|
293
|
+
of
|
|
294
|
+
<span class="font-semibold text-gray-900 dark:text-white">{helper.total}</span>
|
|
295
|
+
Entries
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
<Pagination table large>
|
|
299
|
+
<div slot="prev" class="flex items-center gap-2 text-white bg-gray-800">
|
|
300
|
+
<ArrowLeftOutline class="w-3.5 h-3.5 mr-2" />
|
|
301
|
+
Prev
|
|
302
|
+
</div>
|
|
303
|
+
<div slot="next" class="flex items-center gap-2 text-white bg-gray-800">
|
|
304
|
+
Next
|
|
305
|
+
<ArrowRightOutline class="w-3.5 h-3.5 mr-2" />
|
|
306
|
+
</div>
|
|
307
|
+
</Pagination>
|
|
308
|
+
</div>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Event example
|
|
312
|
+
|
|
313
|
+
```svelte example class="flex justify-center"
|
|
314
|
+
<script lang="ts">
|
|
315
|
+
import { Pagination } from 'flowbite-svelte';
|
|
316
|
+
|
|
317
|
+
let pages = [{ name: "1"}, { name: "2" }, { name: "3" }, { name: "4" }, { name: "5" }];
|
|
318
|
+
const previous = () => {
|
|
319
|
+
alert('Previous btn clicked. Make a call to your server to fetch data.');
|
|
320
|
+
};
|
|
321
|
+
const next = () => {
|
|
322
|
+
alert('Next btn clicked. Make a call to your server to fetch data.');
|
|
323
|
+
};
|
|
324
|
+
const handleClick = () => {
|
|
325
|
+
alert('Page clicked');
|
|
326
|
+
};
|
|
327
|
+
</script>
|
|
328
|
+
|
|
329
|
+
<Pagination {pages} on:previous={previous} on:next={next} on:click={handleClick} />
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
## Component data
|
|
333
|
+
|
|
334
|
+
The component has the following props, type, and default values. See [types page](/docs/pages/typescript) for type information.
|
|
335
|
+
|
|
336
|
+
### Pagination styling
|
|
337
|
+
|
|
338
|
+
- Use the `class` prop to overwrite the `ul` tag class.
|
|
339
|
+
- Use the `classNormal` prop to overwrite `normalClass`.
|
|
340
|
+
- Use the `classActive` prop to overwrite `activeClass`.
|
|
341
|
+
|
|
342
|
+
### PaginationItem styling
|
|
343
|
+
|
|
344
|
+
- Use the `class` prop to overwrite the default class.
|
|
345
|
+
|
|
346
|
+
<CompoAttributesViewer {components}/>
|
|
347
|
+
|
|
348
|
+
## References
|
|
349
|
+
|
|
350
|
+
- [Flowbite Pagination](https://flowbite.com/docs/components/pagination/)
|