Skip to content

Commit 5fd4a3b

Browse files
authored
feat: make flowbite-navbar-* usable as directive (#110)
## PR Checklist Please check if your PR fulfills the following requirements: <!--- [ ] Tests for the changes have been added (for bug fixes/features)--> - [x] Docs have been added/updated (for bug fixes/features) ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting, local variables) - [ ] Refactoring (no functional changes, no API changes) - [ ] Build related changes - [ ] CI-related changes - [ ] Documentation content changes - [ ] Other... Please describe: ## Issue Number <!-- Bugs and features must be linked to an issue. --> Issue Number: N/A ## Does this PR introduce a breaking change? <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. --> - [ ] Yes - [x] No ## Other information <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Added comprehensive documentation for Navbar Component - Included examples for default, brand, dropdown, and responsive navbar configurations - **New Features** - Enhanced Navbar Component with multiple usage options - Added support for various HTML element selectors (nav, button, div, span, etc.) - **Improvements** - Expanded component flexibility across different template structures - Updated demo identifiers and file paths for better organization <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents c6ebc43 + 98f1b7c commit 5fd4a3b

25 files changed

+248
-30
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: Navbar Component
3+
route: component
4+
keyword: NavbarPage
5+
---
6+
7+
{% import "../../shared/component-deprecated-usage.md" as cdu %}
8+
9+
{{ cdu.deprecated() }}
10+
11+
## Default navbar
12+
13+
{{ NgDocActions.demo('c_default', {container: false}) }}
14+
15+
```angular-html file="./component/_default.component.html" group="default" name="html"
16+
17+
```
18+
19+
```angular-ts file="./component/_default.component.ts"#L1-L5 group="default" name="typescript"
20+
21+
```
22+
23+
## Navbar with brand
24+
25+
Use this example to display a brand element inside the navbar by importing the
26+
`NavbarBrandComponent` component.
27+
28+
{{ NgDocActions.demo('c_brand', {container: false}) }}
29+
30+
```angular-html file="./component/_brand.component.html" group="brand" name="html"
31+
32+
```
33+
34+
```angular-ts file="./component/_brand.component.ts"#L1-L6 group="brand" name="typescript"
35+
36+
```
37+
38+
## Navbar with dropdown
39+
40+
Use this example to feature a dropdown menu when clicking on the settings dropdown inside the navbar
41+
by importing the `DropdownComponent` and `DropdownItemComponent` components.
42+
43+
{{ NgDocActions.demo('c_dropdown', {container: false}) }}
44+
45+
```angular-html file="./component/_dropdown.component.html" group="dropdown" name="html"
46+
47+
```
48+
49+
```angular-ts file="./component/_dropdown.component.ts"#L1-L7 group="dropdown" name="typescript"
50+
51+
```
52+
53+
## Responsive navbar
54+
55+
On mobile device the navigation bar will be collapsed and you will be able to use the hamburger menu
56+
to toggle the menu items by adding the `NavbarToggleComponent` component.
57+
58+
{{ NgDocActions.demo('c_responsive', {container: false}) }}
59+
60+
```angular-html file="./component/_responsive.component.html" group="responsive" name="html"
61+
62+
```
63+
64+
```angular-ts file="./component/_responsive.component.ts"#L1-L7 group="responsive" name="typescript"
65+
66+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<nav
2+
flowbite-navbar
3+
[isOpen]="true">
4+
<div flowbite-navbar-brand>Flowbite</div>
5+
6+
<div flowbite-navbar-content>
7+
<li flowbite-navbar-item>Home</li>
8+
<li flowbite-navbar-item>Contacts</li>
9+
</div>
10+
</nav>

0 commit comments

Comments
 (0)