-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from qwikerx/feat/banner-component
feat: add banner component
- Loading branch information
Showing
16 changed files
with
424 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ export default component$(() => { | |
- Alert | ||
- Avatar | ||
- Badge | ||
- Banner | ||
- Breadcrumb | ||
- Button | ||
- Card | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { component$ } from '@builder.io/qwik' | ||
import { ComponentDocPage } from '~/components/ComponentDocPage/ComponentDocPage' | ||
import { DocumentHead } from '@builder.io/qwik-city' | ||
|
||
export default component$(() => { | ||
return ( | ||
<ComponentDocPage name="banner"> | ||
<div q:slot="explanation"> | ||
Get started with the sticky banner component coded with Tailwind CSS and Flowbite to show marketing, informational and CTA messages to your | ||
website visitors fixed to the top or bottom part of the page as the user scroll down the main content area. Explore the following examples | ||
based on various styles, sizes, and positionings to leverage the sticky banner component and increase marketing conversions with a responsive | ||
element supporting dark mode. | ||
</div> | ||
</ComponentDocPage> | ||
) | ||
}) | ||
|
||
export const head: DocumentHead = () => ({ | ||
title: 'Qwik Banner - Flowbite', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
apps/web/src/routes/examples/[theme-rtl]/banner/01-default-banner/index@examples.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/** | ||
* title: Default sticky banner | ||
* description: Use this free example to show a text message for announcement with a CTA link, an icon element and a close button to dismiss the banner. | ||
* height: 450 | ||
*/ | ||
|
||
import { component$ } from '@builder.io/qwik' | ||
import { StaticGenerateHandler } from '@builder.io/qwik-city' | ||
import { Banner, BannerCollapseButton } from 'flowbite-qwik' | ||
import { staticGenerateHandler } from '~/routes/examples/[theme-rtl]/layout' | ||
import { IconCloseOutline, IconShareNodesSolid } from 'flowbite-qwik-icons' | ||
|
||
export default component$(() => { | ||
return ( | ||
<div class="h-[440px]"> | ||
<Banner sticky="top"> | ||
<div class="flex w-full justify-between border-b border-gray-200 bg-gray-50 p-4 dark:border-gray-600 dark:bg-gray-700"> | ||
<div class="mx-auto flex items-center"> | ||
<p class="flex items-center text-sm font-normal text-gray-500 dark:text-gray-400"> | ||
<IconShareNodesSolid class="mr-4 h-4 w-4" /> | ||
<span class="[&_p]:inline"> | ||
New brand identity has been launched for the | ||
<a | ||
href="https://flowbite.com" | ||
class="inline font-medium text-cyan-600 underline decoration-solid underline-offset-2 hover:no-underline dark:text-cyan-500" | ||
> | ||
Flowbite Library | ||
</a> | ||
</span> | ||
</p> | ||
</div> | ||
<BannerCollapseButton color="light" class="border-0 bg-transparent text-gray-500 dark:text-gray-400"> | ||
<IconCloseOutline class="h-4 w-4" /> | ||
</BannerCollapseButton> | ||
</div> | ||
</Banner> | ||
<div class="max-w-lg mx-auto"> | ||
<div role="status" class="my-7 animate-pulse"> | ||
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-48 mb-4"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[380px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px]"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="max-w-lg mb-7 animate-pulse"> | ||
<div class="flex items-center justify-center w-full h-48 bg-gray-300 rounded dark:bg-gray-700"> | ||
<svg class="w-12 h-12 text-gray-200" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" viewBox="0 0 640 512"> | ||
<path d="M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"></path> | ||
</svg> | ||
</div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="my-6 animate-pulse"> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[380px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px]"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="my-6 animate-pulse"> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
}) | ||
|
||
export const onStaticGenerate: StaticGenerateHandler = async () => { | ||
return staticGenerateHandler() | ||
} |
82 changes: 82 additions & 0 deletions
82
apps/web/src/routes/examples/[theme-rtl]/banner/02-banner-bottom-position/index@examples.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* title: Bottom banner position | ||
* description: This example can be used to position the sticky banner to the bottom side of the page instead of the top side. | ||
* height: 450 | ||
*/ | ||
|
||
import { component$ } from '@builder.io/qwik' | ||
import { StaticGenerateHandler } from '@builder.io/qwik-city' | ||
import { Banner, BannerCollapseButton } from 'flowbite-qwik' | ||
import { IconArrowRightOutline, IconCloseOutline, IconSalePercentOutline } from 'flowbite-qwik-icons' | ||
import { staticGenerateHandler } from '~/routes/examples/[theme-rtl]/layout' | ||
|
||
export default component$(() => { | ||
return ( | ||
<div class="h-[440px]"> | ||
<Banner sticky="bottom"> | ||
<div class="flex w-full justify-between border-b border-gray-200 bg-gray-50 p-4 dark:border-gray-600 dark:bg-gray-700"> | ||
<div class="mx-auto flex items-center"> | ||
<p class="flex items-center text-sm font-normal text-gray-500 dark:text-gray-400"> | ||
<span class="mr-3 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-200 p-1 dark:bg-gray-600"> | ||
<IconSalePercentOutline class="h-4 w-4" /> | ||
</span> | ||
<span class="[&_p]:inline"> | ||
Get 5% commision per sale | ||
<a | ||
href="https://flowbite.com" | ||
class="ml-0 flex items-center text-sm font-medium text-cyan-600 hover:underline dark:text-cyan-500 md:ml-1 md:inline-flex" | ||
> | ||
Become a partner | ||
<IconArrowRightOutline class="ml-2" /> | ||
</a> | ||
</span> | ||
</p> | ||
</div> | ||
<BannerCollapseButton color="light" class="border-0 bg-transparent text-gray-500 dark:text-gray-400"> | ||
<IconCloseOutline class="h-4 w-4" /> | ||
</BannerCollapseButton> | ||
</div> | ||
</Banner> | ||
<div class="max-w-lg mx-auto"> | ||
<div role="status" class="my-7 animate-pulse"> | ||
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-48 mb-4"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[380px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px]"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="max-w-lg mb-7 animate-pulse"> | ||
<div class="flex items-center justify-center w-full h-48 bg-gray-300 rounded dark:bg-gray-700"> | ||
<svg class="w-12 h-12 text-gray-200" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" viewBox="0 0 640 512"> | ||
<path d="M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"></path> | ||
</svg> | ||
</div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="my-6 animate-pulse"> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[380px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px]"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="my-6 animate-pulse"> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
}) | ||
|
||
export const onStaticGenerate: StaticGenerateHandler = async () => { | ||
return staticGenerateHandler() | ||
} |
77 changes: 77 additions & 0 deletions
77
apps/web/src/routes/examples/[theme-rtl]/banner/03-banner-marketing-cta/index@examples.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* title: Marketing CTA banner | ||
* description: Use this free example to show a text message for announcement with a CTA link, an icon element and a close button to dismiss the banner. Set a different width by using the max-w-{*} utility classes from Tailwind CSS. | ||
* height: 450 | ||
*/ | ||
|
||
import { component$ } from '@builder.io/qwik' | ||
import { StaticGenerateHandler } from '@builder.io/qwik-city' | ||
import { Banner, BannerCollapseButton, Button } from 'flowbite-qwik' | ||
import { IconCloseSolid } from 'flowbite-qwik-icons' | ||
import { staticGenerateHandler } from '~/routes/examples/[theme-rtl]/layout' | ||
|
||
export default component$(() => { | ||
return ( | ||
<div class="h-[440px]"> | ||
<Banner sticky="top"> | ||
<div class="flex w-[calc(100%-2rem)] flex-col justify-between rounded-lg border border-gray-100 bg-white p-4 shadow-sm dark:border-gray-600 dark:bg-gray-700 md:flex-row lg:max-w-7xl"> | ||
<div class="mb-3 mr-4 flex flex-col items-start md:mb-0 md:flex-row md:items-center"> | ||
<a href="https://flowbite.com/" class="mb-2 flex items-center border-gray-200 dark:border-gray-600 md:mb-0 md:mr-4 md:border-r md:pr-4"> | ||
<img src="https://flowbite.com/docs/images/logo.svg" class="mr-2 h-6" alt="Flowbite Logo" /> | ||
<span class="self-center whitespace-nowrap text-lg font-semibold dark:text-white md:pr-6">Flowbite</span> | ||
</a> | ||
<p class="flex items-center text-sm font-normal text-gray-500 dark:text-gray-400"> | ||
Build websites even faster with components on top of Tailwind CSS | ||
</p> | ||
</div> | ||
<div class="flex shrink-0 items-center"> | ||
<Button href="#">Sign up</Button> | ||
<BannerCollapseButton color="light" class="border-0 bg-transparent text-gray-500 dark:text-gray-400"> | ||
<IconCloseSolid class="h-4 w-4" /> | ||
</BannerCollapseButton> | ||
</div> | ||
</div> | ||
</Banner> | ||
<div class="max-w-lg mx-auto"> | ||
<div role="status" class="my-7 animate-pulse"> | ||
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-48 mb-4"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[380px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px]"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="max-w-lg mb-7 animate-pulse"> | ||
<div class="flex items-center justify-center w-full h-48 bg-gray-300 rounded dark:bg-gray-700"> | ||
<svg class="w-12 h-12 text-gray-200" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" viewBox="0 0 640 512"> | ||
<path d="M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"></path> | ||
</svg> | ||
</div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="my-6 animate-pulse"> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[380px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px]"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
<div role="status" class="my-6 animate-pulse"> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[450px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[460px] mb-2.5"></div> | ||
<div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[500px] mb-2.5"></div> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
}) | ||
|
||
export const onStaticGenerate: StaticGenerateHandler = async () => { | ||
return staticGenerateHandler() | ||
} |
Oops, something went wrong.