-
Notifications
You must be signed in to change notification settings - Fork 48
feat: make flowbite-navbar-* usable as directive #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MGREMY
merged 1 commit into
themesberg:feature-make-component-available-as-directive
from
MGREMY:navbar_as_directive
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,66 @@ | ||
| --- | ||
| title: Navbar Component | ||
| route: component | ||
| keyword: NavbarPage | ||
| --- | ||
|
|
||
| {% import "../../shared/component-deprecated-usage.md" as cdu %} | ||
|
|
||
| {{ cdu.deprecated() }} | ||
|
|
||
| ## Default navbar | ||
|
|
||
| {{ NgDocActions.demo('c_default', {container: false}) }} | ||
|
|
||
| ```angular-html file="./component/_default.component.html" group="default" name="html" | ||
|
|
||
| ``` | ||
|
|
||
| ```angular-ts file="./component/_default.component.ts"#L1-L5 group="default" name="typescript" | ||
|
|
||
| ``` | ||
|
|
||
| ## Navbar with brand | ||
|
|
||
| Use this example to display a brand element inside the navbar by importing the | ||
| `NavbarBrandComponent` component. | ||
|
|
||
| {{ NgDocActions.demo('c_brand', {container: false}) }} | ||
|
|
||
| ```angular-html file="./component/_brand.component.html" group="brand" name="html" | ||
|
|
||
| ``` | ||
|
|
||
| ```angular-ts file="./component/_brand.component.ts"#L1-L6 group="brand" name="typescript" | ||
|
|
||
| ``` | ||
|
|
||
| ## Navbar with dropdown | ||
|
|
||
| Use this example to feature a dropdown menu when clicking on the settings dropdown inside the navbar | ||
| by importing the `DropdownComponent` and `DropdownItemComponent` components. | ||
|
|
||
| {{ NgDocActions.demo('c_dropdown', {container: false}) }} | ||
|
|
||
| ```angular-html file="./component/_dropdown.component.html" group="dropdown" name="html" | ||
|
|
||
| ``` | ||
|
|
||
| ```angular-ts file="./component/_dropdown.component.ts"#L1-L7 group="dropdown" name="typescript" | ||
|
|
||
| ``` | ||
|
|
||
| ## Responsive navbar | ||
|
|
||
| On mobile device the navigation bar will be collapsed and you will be able to use the hamburger menu | ||
| to toggle the menu items by adding the `NavbarToggleComponent` component. | ||
|
|
||
| {{ NgDocActions.demo('c_responsive', {container: false}) }} | ||
|
|
||
| ```angular-html file="./component/_responsive.component.html" group="responsive" name="html" | ||
|
|
||
| ``` | ||
|
|
||
| ```angular-ts file="./component/_responsive.component.ts"#L1-L7 group="responsive" name="typescript" | ||
|
|
||
| ``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
apps/docs/docs/components/navbar/directive/_brand.component.html
This file contains hidden or 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,10 @@ | ||
| <nav | ||
| flowbite-navbar | ||
| [isOpen]="true"> | ||
| <div flowbite-navbar-brand>Flowbite</div> | ||
|
|
||
| <div flowbite-navbar-content> | ||
| <li flowbite-navbar-item>Home</li> | ||
| <li flowbite-navbar-item>Contacts</li> | ||
| </div> | ||
| </nav> |
15 changes: 15 additions & 0 deletions
15
apps/docs/docs/components/navbar/directive/_brand.component.ts
This file contains hidden or 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,15 @@ | ||
| import { | ||
| NavbarBrandComponent, | ||
| NavbarComponent, | ||
| NavbarContentComponent, | ||
| NavbarItemComponent, | ||
| } from 'flowbite-angular/navbar'; | ||
|
|
||
| import { Component } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'flowbite-demo-navbar-brand', | ||
| imports: [NavbarComponent, NavbarItemComponent, NavbarContentComponent, NavbarBrandComponent], | ||
| templateUrl: './_brand.component.html', | ||
| }) | ||
| export class FlowbiteBrandComponent {} |
7 changes: 7 additions & 0 deletions
7
apps/docs/docs/components/navbar/directive/_default.component.html
This file contains hidden or 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,7 @@ | ||
| <nav | ||
| flowbite-navbar | ||
| [isOpen]="true"> | ||
| <div flowbite-navbar-content> | ||
| <li flowbite-navbar-item>Hello world!</li> | ||
| </div> | ||
| </nav> |
14 changes: 14 additions & 0 deletions
14
apps/docs/docs/components/navbar/directive/_default.component.ts
This file contains hidden or 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,14 @@ | ||
| import { | ||
| NavbarComponent, | ||
| NavbarContentComponent, | ||
| NavbarItemComponent, | ||
| } from 'flowbite-angular/navbar'; | ||
|
|
||
| import { Component } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'flowbite-demo-navbar-default', | ||
| imports: [NavbarComponent, NavbarItemComponent, NavbarContentComponent], | ||
| templateUrl: './_default.component.html', | ||
| }) | ||
| export class FlowbiteDefaultComponent {} |
15 changes: 15 additions & 0 deletions
15
apps/docs/docs/components/navbar/directive/_dropdown.component.html
This file contains hidden or 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,15 @@ | ||
| <nav | ||
| flowbite-navbar | ||
| [isOpen]="true"> | ||
| <div flowbite-navbar-brand>Flowbite</div> | ||
|
|
||
| <div flowbite-navbar-content> | ||
| <li flowbite-navbar-item>Hello world!</li> | ||
|
|
||
| <flowbite-dropdown label="Settings"> | ||
| <flowbite-dropdown-item> Profile </flowbite-dropdown-item> | ||
| <flowbite-dropdown-item> Billing </flowbite-dropdown-item> | ||
| <flowbite-dropdown-item> App settings </flowbite-dropdown-item> | ||
| </flowbite-dropdown> | ||
| </div> | ||
| </nav> | ||
23 changes: 23 additions & 0 deletions
23
apps/docs/docs/components/navbar/directive/_dropdown.component.ts
This file contains hidden or 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,23 @@ | ||
| import { DropdownComponent, DropdownItemComponent } from 'flowbite-angular/dropdown'; | ||
| import { | ||
| NavbarBrandComponent, | ||
| NavbarComponent, | ||
| NavbarContentComponent, | ||
| NavbarItemComponent, | ||
| } from 'flowbite-angular/navbar'; | ||
|
|
||
| import { Component } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'flowbite-demo-navbar-dropdown', | ||
| imports: [ | ||
| NavbarComponent, | ||
| NavbarContentComponent, | ||
| NavbarBrandComponent, | ||
| NavbarItemComponent, | ||
| DropdownComponent, | ||
| DropdownItemComponent, | ||
| ], | ||
| templateUrl: './_dropdown.component.html', | ||
| }) | ||
| export class FlowbiteDropdownComponent {} |
15 changes: 15 additions & 0 deletions
15
apps/docs/docs/components/navbar/directive/_responsive.component.html
This file contains hidden or 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,15 @@ | ||
| <nav flowbite-navbar> | ||
| <div flowbite-navbar-brand>Flowbite</div> | ||
|
|
||
| <button | ||
| type="button" | ||
| flowbite-navbar-toggle> | ||
| <span class="sr-only">Open navbar menu</span> | ||
| </button> | ||
MGREMY marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <div flowbite-navbar-content> | ||
| <li flowbite-navbar-item>Home</li> | ||
| <li flowbite-navbar-item>Pricing</li> | ||
| <li flowbite-navbar-item>Contacts</li> | ||
| </div> | ||
MGREMY marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </nav> | ||
22 changes: 22 additions & 0 deletions
22
apps/docs/docs/components/navbar/directive/_responsive.component.ts
This file contains hidden or 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,22 @@ | ||
| import { | ||
| NavbarBrandComponent, | ||
| NavbarComponent, | ||
| NavbarContentComponent, | ||
| NavbarItemComponent, | ||
| NavbarToggleComponent, | ||
| } from 'flowbite-angular/navbar'; | ||
|
|
||
| import { Component } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'flowbite-demo-navbar-responsive', | ||
| imports: [ | ||
| NavbarComponent, | ||
| NavbarContentComponent, | ||
| NavbarItemComponent, | ||
| NavbarBrandComponent, | ||
| NavbarToggleComponent, | ||
| ], | ||
| templateUrl: './_responsive.component.html', | ||
| }) | ||
| export class FlowbiteResponsiveComponent {} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.