Files
flowbite-vue/docs/components/navbar.md
2022-12-14 22:53:01 +03:00

120 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup>
import NavbarExample from './navbar/examples/NavbarExample.vue'
import NavbarSolidExample from './navbar/examples/NavbarSolidExample.vue'
import NavbarActionButtonExample from './navbar/examples/NavbarActionButtonExample.vue'
import NavbarCustomMobileIconExample from './navbar/examples/NavbarCustomMobileIconExample.vue'
</script>
# Navbar Component Flowbite
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
## Default navbar
```vue
<script setup>
import { Navbar, NavbarLogo, NavbarCollapse, NavbarLink } from 'flowbite-vue'
</script>
<template>
<Navbar>
<template #logo>
<NavbarLogo link="https://www.google.com/" alt="Flowbite logo" image-url="https://flowbite.com/docs/images/logo.svg">
Flowbite
</NavbarLogo>
</template>
<template #default="{isShowMenu}">
<NavbarCollapse :isShowMenu="isShowMenu">
<NavbarLink isActive link="#">Home</NavbarLink>
<NavbarLink link="#">Services</NavbarLink>
<NavbarLink link="#">Pricing</NavbarLink>
<NavbarLink link="#">Contact</NavbarLink>
</NavbarCollapse>
</template>
</Navbar>
</template>
```
<NavbarExample />
## Solid navbar
```vue
<script setup>
import { Navbar, NavbarLogo, NavbarCollapse, NavbarLink } from 'flowbite-vue'
</script>
<template>
<Navbar solid>
<template #logo>
<NavbarLogo link="https://www.google.com/" alt="Flowbite logo" image-url="https://flowbite.com/docs/images/logo.svg">
Flowbite
</NavbarLogo>
</template>
<template #default="{isShowMenu}">
<NavbarCollapse :isShowMenu="isShowMenu">
<NavbarLink is-active>Home</NavbarLink>
<NavbarLink>Services</NavbarLink>
<NavbarLink>Pricing</NavbarLink>
<NavbarLink>Contact</NavbarLink>
</NavbarCollapse>
</template>
</Navbar>
</template>
```
<NavbarSolidExample />
## Navbar with action button
```vue
<script setup>
import { Navbar, NavbarLogo, NavbarCollapse, NavbarLink } from 'flowbite-vue'
</script>
<template>
<Navbar>
<template #logo>
<NavbarLogo link="https://www.google.com/" alt="Flowbite logo" image-url="https://flowbite.com/docs/images/logo.svg">
Flowbite
</NavbarLogo>
</template>
<template #default="{isShowMenu}">
<NavbarCollapse :isShowMenu="isShowMenu">
<NavbarLink is-active>Home</NavbarLink>
<NavbarLink>Services</NavbarLink>
<NavbarLink>Pricing</NavbarLink>
<NavbarLink>Contact</NavbarLink>
</NavbarCollapse>
</template>
<template #right-side>
<button type="button" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-3 md:mr-0 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">Get started</button>
</template>
</Navbar>
</template>
```
<NavbarActionButtonExample />
## Navbar with custom mobile icon
```vue
<script setup>
import { Navbar, NavbarLogo, NavbarCollapse, NavbarLink } from 'flowbite-vue'
</script>
<template>
<Navbar>
<template #logo>
<NavbarLogo link="https://www.google.com/" alt="Flowbite logo" image-url="https://flowbite.com/docs/images/logo.svg">
Flowbite
</NavbarLogo>
</template>
<template #default="{isShowMenu}">
<NavbarCollapse :isShowMenu="isShowMenu">
<NavbarLink is-active>Home</NavbarLink>
<NavbarLink>Services</NavbarLink>
<NavbarLink>Pricing</NavbarLink>
<NavbarLink>Contact</NavbarLink>
</NavbarCollapse>
</template>
<template #menu-icon>
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"></path></svg>
</template>
</Navbar>
</template>
```
<NavbarCustomMobileIconExample />