Dropdown Navbar
Examples
You can change textsize prop to text-xs, text-sm, text-base, text-lg or text-xl.
Dropdown Navbar Setup
<script>
import { DropdownNavbar } from "flowbite-svelte";
let sitename = "Flowbite Svelte";
let logo = "/images/flowbite-svelte-logo-30.png";
let alt = "flowbite-svelte";
let textsize = "text-lg";
let menus = [
{
name: "Home",
href: "/",
rel: "",
},
{
name: "Cards",
href: "/cards",
rel: "",
child: [
{
name: "Card",
href: "/cards/card",
rel: "",
},
{
name: "CTA Card",
href: "/cards/cta",
rel: "",
},
{
name: "Ecommerce Card",
href: "/cards/ecommerce",
rel: "",
},
],
},
{
name: "Modals",
href: "/",
rel: "",
child: [
{
name: "Small",
href: "/modals/small",
rel: "",
},
{
name: "Medium",
href: "/modals/medium",
rel: "",
},
],
},
];
</script>
<DropdownNavbar {menus} {sitename} {alt} {logo} {textsize} />
Props
The component has the following props, type, and default values. See types page for type information.
Name | Type | Default |
---|---|---|
user = ' | user | '' |
sitename | string | 'Svelte Flow' |
logo | string | '/images/flowbite-svelte-logo-30.png' |
alt | string | - |
textsize | string | 'text-sm' |
menus | NavbarType[] | - |
navClass | string | 'px-2 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700' |
spanClass | string | 'self-center text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white' |
buttonClass | string | 'inline-flex justify-center items-center ml-3 text-gray-400 rounded-lg md:hidden hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:text-gray-400 dark:hover:text-white dark:focus:ring-gray-500' |
dropdownDiv | string | 'z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600' |
dropdownLinkClassWithChild | string | `block py-2 px-4 ${textsize} text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-400 dark:hover:text-white` |
dropdownLinkClassWithoutChild | string | `block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 dark:hover:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent ${textsize}` |
liButtonClass | string | `flex justify-between items-center py-2 pr-4 pl-3 w-full ${textsize} font-medium text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent` |