diff --git a/src/routes/docs/components/avatar.md b/src/routes/docs/components/avatar.md index 21fc905dc..2fa4b3292 100644 --- a/src/routes/docs/components/avatar.md +++ b/src/routes/docs/components/avatar.md @@ -185,7 +185,7 @@ Use this example if you want to show a dropdown menu when clicking on the avatar Select size from xs | sm | md | lg | xl. -```svelte example class="flex flex-col gap-4" hideScript +```svelte example class="flex flex-col gap-4" hideScript hideResponsiveButtons diff --git a/src/routes/docs/components/banner.md b/src/routes/docs/components/banner.md index cb1bba763..059440483 100644 --- a/src/routes/docs/components/banner.md +++ b/src/routes/docs/components/banner.md @@ -105,7 +105,7 @@ Use this free example to show a text message for announcement with a CTA link. This example can be used to encourage your website visitors to sign up to your email newsletter by showing an inline form inside the sticky banner on the top side of your page. -```svelte example class="flex flex-col relative" +```svelte example class="flex flex-col relative" hideResponsiveButtons @@ -126,7 +126,7 @@ This example can be used to encourage your website visitors to sign up to your e This example can be used to share important information with your website visitors by showing a heading and a paragraph inside the sticky banner and two CTA buttons with links. -```svelte example class="flex flex-col relative" +```svelte example class="flex flex-col relative" hideResponsiveButtons diff --git a/src/routes/docs/components/carousel.md b/src/routes/docs/components/carousel.md index 54b048dac..a82847b48 100644 --- a/src/routes/docs/components/carousel.md +++ b/src/routes/docs/components/carousel.md @@ -73,7 +73,7 @@ Set the `duration` prop to define the time interval for chaning images. Time is The default value for `duration` is set to zero that means no autochange of images. In that case you can control which image is displayed by the `index` prop. -```svelte example +```svelte example hideResponsiveButtons @@ -93,7 +93,7 @@ This component can be used to show an application preview inside of a responsive This example can be used to show a screenshot of your application inside a laptop mockup. -```svelte example +```svelte example hideResponsiveButtons @@ -108,7 +108,7 @@ This example can be used to show a screenshot of your application inside a lapto Use this example to show a preview of your applicaiton inside a desktop device such as an iMac. -```svelte example +```svelte example hideResponsiveButtons diff --git a/src/routes/docs/components/dropdown.md b/src/routes/docs/components/dropdown.md index 004549a0d..72e328fc5 100644 --- a/src/routes/docs/components/dropdown.md +++ b/src/routes/docs/components/dropdown.md @@ -365,7 +365,7 @@ Show a list of toggle switch elements inside the dropdown menu to enable a yes o

You can also use the dropdown element inside a navigation bar and add a second level of navigation hierarchy, but make sure to use Navbar components.

-```svelte example class="flex justify-center items-start h-96" +```svelte example class="flex justify-center items-start h-96" hideResponsiveButtons @@ -48,7 +48,7 @@ The footer is one of the most underestimated sections of a website being located

Use this component to show your brand’s logo, a few website links and the copyright notice on a second row.

-```svelte example +```svelte example hideResponsiveButtons @@ -72,7 +72,7 @@ The footer is one of the most underestimated sections of a website being located

This footer component can be used to show your brand’s logo, multiple rows of website links, a copyright notice and social media profile icons including Twitter, Facebook, Instagram, and more.

-```svelte example +```svelte example hideResponsiveButtons diff --git a/src/routes/docs/components/kbd.md b/src/routes/docs/components/kbd.md index ed2e3d611..1ddb53c95 100644 --- a/src/routes/docs/components/kbd.md +++ b/src/routes/docs/components/kbd.md @@ -29,7 +29,7 @@ The KBD (Keyboard) component can be used to indicate a textual user input from t Here’s a list of KBD components that you can use inside any other element. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -47,7 +47,7 @@ Here’s a list of KBD components that you can use inside any other element. Use this example by nesting an inline KBD component inside a paragraph. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -61,7 +61,7 @@ Use this example by nesting an inline KBD component inside a paragraph. The KBD component can also be used inside table components to denote what type of key can be pressed for certain descriptions. -```svelte example +```svelte example hideResponsiveButtons @@ -113,7 +113,7 @@ The KBD component can also be used inside table components to denote what type o Use this example to show arrow keys inside the KBD styled element. -```svelte example +```svelte example hideResponsiveButtons @@ -140,7 +140,7 @@ Use this example to show arrow keys inside the KBD styled element. Use this example if you need to show a key from the latin alphabet -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -177,7 +177,7 @@ Use this example if you need to show a key from the latin alphabet Use this example to show a key inside a KBD component from the english numeral system. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -198,7 +198,7 @@ Use this example to show a key inside a KBD component from the english numeral s This example can be used to denote function keys inside the KBD component. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons diff --git a/src/routes/docs/components/mega-menu.md b/src/routes/docs/components/mega-menu.md index 24fb05990..c1e1a1a5c 100644 --- a/src/routes/docs/components/mega-menu.md +++ b/src/routes/docs/components/mega-menu.md @@ -27,7 +27,7 @@ The mega menu component is a full-width dropdown that can be triggered by clicki Use this example to show a list of links aligned on three columns inside the mega menu dropdown. -```svelte example class="h-80" +```svelte example class="h-80" hideResponsiveButtons @@ -53,7 +53,7 @@ Use this example of a navigation bar built with the utility classes from Tailwin 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: -```svelte example +```svelte example hideResponsiveButtons @@ -207,7 +207,7 @@ Use the following navbar element to show a call to action button alongside the l Use this example to keep the navbar positioned fixed to the top side as you scroll down the document page. -```svelte example class="h-80" +```svelte example class="h-80" hideResponsiveButtons @@ -239,7 +239,7 @@ Use this example to keep the navbar positioned fixed to the top side as you scro Use this example to create a navigation bar with a user profile or button to toggle a dropdown menu. -```svelte example class="h-80" +```svelte example class="h-80" hideResponsiveButtons @@ -278,7 +278,7 @@ Use this example to create a navigation bar with a user profile or button to tog Use this example to show a solid background for the navbar component instead of being transparent. -```svelte example +```svelte example hideResponsiveButtons diff --git a/src/routes/docs/components/popover.md b/src/routes/docs/components/popover.md index 04bcf0496..77f492625 100644 --- a/src/routes/docs/components/popover.md +++ b/src/routes/docs/components/popover.md @@ -327,7 +327,7 @@ Increase or decrease the default offset by adding the `offset` attribute where t Customize the animation of the popover component by using the transition functions from Svelte. -```svelte example class="flex h-44 items-end justify-center gap-8" +```svelte example class="flex h-44 items-end justify-center gap-8" hideResponsiveButtons diff --git a/src/routes/docs/components/speed-dial.md b/src/routes/docs/components/speed-dial.md index 2d769a2f0..08b97f318 100644 --- a/src/routes/docs/components/speed-dial.md +++ b/src/routes/docs/components/speed-dial.md @@ -53,7 +53,7 @@ To initialize a speed dial component you need to wrap the trigger element and th The Speed Dial components accommodate a variety of Button component properties, including color options (blue, dark, alternative, light, green, red, yellow, primary, and purple), gradient, shadow, and outline styles. For further information, please refer to **[the Button component](https://flowbite-svelte.com/components/button)** documentation. -```svelte example class="relative h-96" +```svelte example class="relative h-96" hideResponsiveButtons diff --git a/src/routes/docs/components/timeline.md b/src/routes/docs/components/timeline.md index af1ab9072..971cf9f11 100644 --- a/src/routes/docs/components/timeline.md +++ b/src/routes/docs/components/timeline.md @@ -88,7 +88,7 @@ Use this vertical timeline component with icons and badges to show a more advanc Use this horizontally aligned timeline component to show a series of data in a chronological order. -```svelte example +```svelte example hideResponsiveButtons diff --git a/src/routes/docs/components/tooltip.md b/src/routes/docs/components/tooltip.md index 7ba607438..ce544266d 100644 --- a/src/routes/docs/components/tooltip.md +++ b/src/routes/docs/components/tooltip.md @@ -42,7 +42,7 @@ To get started with using tooltips all you need to do is set `triggeredBy` attri You can use choose between dark and light version styles for the tooltip component by changing the utility classes from Tailwind CSS and by applying the `type={light|dark}` data attribute. -```svelte example class="flex items-end gap-2 h-32" +```svelte example class="flex items-end gap-2 h-32" hideResponsiveButtons diff --git a/src/routes/docs/components/typography.md b/src/routes/docs/components/typography.md index b13b2e5e0..55b56b40e 100644 --- a/src/routes/docs/components/typography.md +++ b/src/routes/docs/components/typography.md @@ -21,7 +21,7 @@ We have listed some of the commonly used typography classes that we use througho Use the following text-size utility classes from Tailwind to set the font size for any text element. -```svelte example +```svelte example hideResponsiveButtons

Flowbite

FlowBite

@@ -53,7 +53,7 @@ Use the following text-size utility classes from Tailwind to set the font size f Use the following font-weight utility classes to set the font weight for any text element. -```svelte example +```svelte example hideResponsiveButtons

FlowBite

FlowBite

@@ -77,7 +77,7 @@ Use the following font-weight utility classes to set the font weight for any tex Use the following leading-type utility classes to set the line height for any text element. -```svelte example +```svelte example hideResponsiveButtons

Themesberg was created to bring quality ...

Themesberg was created to bring quality ...

@@ -95,7 +95,7 @@ Use the following leading-type utility classes to set the line height for any te Use the following code to create list items with ordered and unordered lists. -```svelte example +```svelte example hideResponsiveButtons @@ -124,7 +124,7 @@ Use the following code to create list items with ordered and unordered lists. Use the list-inside and list-outside classes to set the list item position inside a list component. -```svelte example +```svelte example hideResponsiveButtons @@ -147,7 +147,7 @@ Use the list-inside and list-outside classes to set the list item position insid You can use the following classes to set the text decoration for any inline text element. -```svelte example +```svelte example hideResponsiveButtons

please read our terms and services

please read our terms and services

diff --git a/src/routes/docs/forms/checkbox.md b/src/routes/docs/forms/checkbox.md index a6a795328..c79733c02 100644 --- a/src/routes/docs/forms/checkbox.md +++ b/src/routes/docs/forms/checkbox.md @@ -150,7 +150,7 @@ Use this example to show a list of checkbox items grouped inside a card. Use this example to show a list of checkbox items inside a card horizontally. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -207,7 +207,7 @@ Use this example to show a list of checkbox items inside a dropdown menu. You can align the checkbox elements horizontally by using a wrapper tag and applying the flex class. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -222,7 +222,7 @@ You can align the checkbox elements horizontally by using a wrapper tag and appl You can use the property `inline` as the alternative. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -235,7 +235,7 @@ You can use the property `inline` as the alternative. ## Colors -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -258,7 +258,7 @@ You can use the property `inline` as the alternative. Use this example of an advanced layout of checkbox elements where the label parent element can be styled when the checkbox is checked. -```svelte example +```svelte example hideResponsiveButtons @@ -47,7 +47,7 @@ Get started with the following three styles for the floating label component and Apply the disabled attribute to the input fields to disallow the user from changing the content. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -63,7 +63,7 @@ Apply the disabled attribute to the input fields to disallow the user from chang 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. -```svelte example +```svelte example hideResponsiveButtons @@ -122,7 +122,7 @@ Use the following examples of input validation for the success and error message Use the small and default sizes of the floating label input fields from the following example. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons diff --git a/src/routes/docs/forms/input-field.md b/src/routes/docs/forms/input-field.md index 772c37cbd..a3b854533 100644 --- a/src/routes/docs/forms/input-field.md +++ b/src/routes/docs/forms/input-field.md @@ -31,7 +31,7 @@ On this page you will find all of the input types based on multiple variants, st Use this example as a generic form element which includes multiple input fields types such as text, email, password, number, URL, and phone number and use the grid layout to add multiple columns and rows. -```svelte example +```svelte example hideResponsiveButtons @@ -184,7 +184,7 @@ Use the following example to apply validation styles for success and error messa This example can be used to add a descriptive icon or additional text inside the input field. -```svelte example class="space-y-6" +```svelte example class="space-y-6" hideResponsiveButtons diff --git a/src/routes/docs/forms/radio.md b/src/routes/docs/forms/radio.md index d6767fa4e..a972bfa77 100644 --- a/src/routes/docs/forms/radio.md +++ b/src/routes/docs/forms/radio.md @@ -156,7 +156,7 @@ Use this example to show a list of radio items grouped inside a card. Use this example to show a list of radio items inside a card horizontally. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -204,7 +204,7 @@ Here’s an example of a list group that you can use right away. You can align the radio elements horizontally by using a wrapper tag and applying the flex class. -```svelte example +```svelte example hideResponsiveButtons diff --git a/src/routes/docs/typography/blockquote.md b/src/routes/docs/typography/blockquote.md index 3e4ad8546..76f41a9fd 100644 --- a/src/routes/docs/typography/blockquote.md +++ b/src/routes/docs/typography/blockquote.md @@ -65,7 +65,7 @@ Use this example to show an icon above the blockquote text content. Use this example to show a blockquote component between multiple paragraph elements. -```svelte example +```svelte example hideResponsiveButtons diff --git a/src/routes/docs/typography/heading.md b/src/routes/docs/typography/heading.md index ad4f38a06..0bbc9f57c 100644 --- a/src/routes/docs/typography/heading.md +++ b/src/routes/docs/typography/heading.md @@ -31,7 +31,7 @@ At least one unique H1 tag should be available for each page on your website wit Use this example of a H1 heading in the context of a paragraph and CTA button for landing pages. -```svelte example +```svelte example hideResponsiveButtons @@ -69,7 +69,7 @@ Use this example to apply rounded corners to the image by using the rounded-size Use this example to mask the image inside a circle using the rounded-full utility class from Tailwind CSS. -```svelte example class="flex justify-center" hideScript +```svelte example class="flex justify-center" hideScript hideResponsiveButtons @@ -81,7 +81,7 @@ Use this example to mask the image inside a circle using the rounded-full utilit This example can be used to show a shadow effect for the image using the shadow-size utility class. -```svelte example class="flex justify-center" hideScript +```svelte example class="flex justify-center" hideScript hideResponsiveButtons @@ -121,7 +121,7 @@ Use image effects such as grayscale or blur to change the appearances of the ima Use the filter option and apply a grayscale to the image element using the grayscale class. -```svelte example class="flex justify-center" hideScript +```svelte example class="flex justify-center" hideScript hideResponsiveButtons @@ -133,7 +133,7 @@ Use the filter option and apply a grayscale to the image element using the grays Apply a blur by using the blur-size utility class from Tailwind CSS to an image component. -```svelte example class="flex justify-center" hideScript +```svelte example class="flex justify-center" hideScript hideResponsiveButtons @@ -149,7 +149,7 @@ Align the image component to the left, center or right side of the document page By default, the image component will be aligned to the left side of the page. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -161,7 +161,7 @@ By default, the image component will be aligned to the left side of the page. Horizontally align the image to the center of the page using the `mx-auto` class. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -173,7 +173,7 @@ Horizontally align the image to the center of the page using the `mx-auto` class Use the `ml-auto` class to align the image to the right side of the page. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -189,7 +189,7 @@ Set the size of the image using the w-size and h-size or max-w-size utility clas Use the `max-w-xs` class to set a small size of the image. -```svelte example class="flex justify-center" hideScript +```svelte example class="flex justify-center" hideScript hideResponsiveButtons @@ -201,7 +201,7 @@ Use the `max-w-xs` class to set a small size of the image. Use the `max-w-md` class to set a medium size of the image. -```svelte example class="flex justify-center" hideScript +```svelte example class="flex justify-center" hideScript hideResponsiveButtons @@ -213,7 +213,7 @@ Use the `max-w-md` class to set a medium size of the image. Use the max-w-xl class to set a large size of the image. -```svelte example class="flex justify-center" hideScript +```svelte example class="flex justify-center" hideScript hideResponsiveButtons diff --git a/src/routes/docs/typography/paragraph.md b/src/routes/docs/typography/paragraph.md index 7e4277768..101926fad 100644 --- a/src/routes/docs/typography/paragraph.md +++ b/src/routes/docs/typography/paragraph.md @@ -163,7 +163,7 @@ Use this example to show multiple paragraphs on a single line. Use this example to separate paragraphs into two columns for better readability. -```svelte example +```svelte example hideResponsiveButtons @@ -180,7 +180,7 @@ Use this example to separate paragraphs into two columns for better readability. This example can be used to separate paragraphs into three separate columns. -```svelte example +```svelte example hideResponsiveButtons @@ -198,7 +198,7 @@ This example can be used to separate paragraphs into three separate columns. Use this example to separate paragraphs into two uneven columns. -```svelte example +```svelte example hideResponsiveButtons diff --git a/src/routes/docs/typography/text.md b/src/routes/docs/typography/text.md index 05e152cc0..8287ad0b9 100644 --- a/src/routes/docs/typography/text.md +++ b/src/routes/docs/typography/text.md @@ -28,7 +28,7 @@ Get started with a collection of text customization examples to learn how to upd Use this example to set the font size of inline text elements using the `size` prop. -```svelte example class="flex flex-wrap items-center space-x-4" +```svelte example class="flex flex-wrap items-center space-x-4" hideResponsiveButtons @@ -52,7 +52,7 @@ Use this example to set the font size of inline text elements using the `size` p This example can be used to the font weight of an inline text element using the `weight` prop. -```svelte example class="flex flex-wrap items-center space-x-4" hideScript +```svelte example class="flex flex-wrap items-center space-x-4" hideScript hideResponsiveButtons @@ -72,7 +72,7 @@ This example can be used to the font weight of an inline text element using the Use the `color` prop to set the color of the inline text. -```svelte example class="flex flex-wrap items-center space-x-4" hideScript +```svelte example class="flex flex-wrap items-center space-x-4" hideScript hideResponsiveButtons @@ -88,7 +88,7 @@ Use the `color` prop to set the color of the inline text. Increase or decrease the spacing between letters using the `space` prop. -```svelte example class="flex flex-wrap items-center space-x-4" hideScript +```svelte example class="flex flex-wrap items-center space-x-4" hideScript hideResponsiveButtons @@ -107,7 +107,7 @@ Increase or decrease the spacing between letters using the `space` prop. Update the text decoration style using the `underline` and `decorationClass` props. -```svelte example +```svelte example hideResponsiveButtons @@ -121,7 +121,7 @@ Update the text decoration style using the `underline` and `decorationClass` pro Set a strikethrough line on a text element using the `line-through` class. -```svelte example +```svelte example hideResponsiveButtons @@ -133,7 +133,7 @@ Set a strikethrough line on a text element using the `line-through` class. Force uppercase characters for a given portion of text using the uppercase class. -```svelte example +```svelte example hideResponsiveButtons @@ -149,7 +149,7 @@ Set italic or non italic styles with the props. Use the `italic` prop to set italic font style to a text element. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -161,7 +161,7 @@ Use the `italic` prop to set italic font style to a text element. Text elements by default are non-italic. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -177,7 +177,7 @@ Set the height between lines using the `height` prop. Use the `height="normal"` (default) prop to set default line height. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -189,7 +189,7 @@ Use the `height="normal"` (default) prop to set default line height. Use the `height="relaxed"` prop to increase the space between lines. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -201,7 +201,7 @@ Use the `height="relaxed"` prop to increase the space between lines. Use the `height="loose"` prop to set a large amount of space between text lines. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -213,7 +213,7 @@ Use the `height="loose"` prop to set a large amount of space between text lines. ### Left -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -223,7 +223,7 @@ Use the `height="loose"` prop to set a large amount of space between text lines. ### Center -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -235,7 +235,7 @@ Use the `height="loose"` prop to set a large amount of space between text lines. Use the `align="right"` prop to align the text element to the right side of the page. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -247,7 +247,7 @@ Use the `align="right"` prop to align the text element to the right side of the Use the `justify` prop to justify the text content. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -263,7 +263,7 @@ Configure the whitespace behaviour of inline text elements using the `whitespace Use the `whitespace="normal"` prop to set the default whitespace behaviour. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -275,7 +275,7 @@ Use the `whitespace="normal"` prop to set the default whitespace behaviour. Use the `whitespace="nowrap"` prop to prevent text being added to a new line when the full width has been reached. -```svelte example class="overflow-y-scroll" hideScript +```svelte example class="overflow-y-scroll" hideScript hideResponsiveButtons @@ -288,7 +288,7 @@ Use the `whitespace="nowrap"` prop to prevent text being added to a new line whe Use the `whitespace="preline'` prop to add whitespace exactly how it has been set from the source code. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -304,7 +304,7 @@ Use the `whitespace="preline'` prop to add whitespace exactly how it has been se Update the text decoration style using the `underline` and `decorationClass` props. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons @@ -318,7 +318,7 @@ Update the text decoration style using the `underline` and `decorationClass` pro Use the `opacity` and `color` prop to set the opacity of inline text elements. -```svelte example hideScript +```svelte example hideScript hideResponsiveButtons diff --git a/src/routes/utils/ExampleWrapper.svelte b/src/routes/utils/ExampleWrapper.svelte index a6f2cf6bd..7cab8d031 100644 --- a/src/routes/utils/ExampleWrapper.svelte +++ b/src/routes/utils/ExampleWrapper.svelte @@ -7,6 +7,7 @@ import { page } from '$app/stores'; import type { PageData } from '../$types'; import { identity } from 'svelte/internal'; + import { DesktopPcOutline, TabletOutline, MobilePhoneOutline } from 'flowbite-svelte-icons'; export let divClass = 'w-full mx-auto bg-gradient-to-r bg-white dark:bg-gray-900 p-2 sm:p-6'; // the source of the example, if you want it @@ -31,6 +32,13 @@ let showExpandButton: boolean = false; let expand: boolean = false; let dark: boolean = false; + let responsiveDevice: keyof typeof responsiveSize = 'desktop'; + + const responsiveSize = { + mobile: 'max-w-sm', + tablet: 'max-w-lg', + desktop: '' + }; function init(node: HTMLElement) { browserSupport = !!window?.navigator?.clipboard; @@ -85,11 +93,24 @@
{#if !meta.hideOutput}
-
+
{#if path} + {#if !meta.hideResponsiveButtons} +
+ + + +
+ {/if}
(dark = !dark)} {dark} />
@@ -100,7 +121,7 @@
-
+