Sisitech Navigation Bar Library
Sisitech library that handles website navigation bars
[]
Installation
Usage
Import the library
About
The library is made up of 5 main components :
Component Selector | Description | Parameters |
---|---|---|
brand-navbar | Part of the navbar that houses the company logo. The logo is clickable and can redirect to a select url. |
|
link-navbar | Where the links to different routes within the website are placed. This section takes multiple arrays as input, each array defining attributes of a single link. |
|
action-navbar | Defines the different buttons to be displayed on the navbar along with their functions on click. |
|
search-navbar | Defines a search form that allows a user to search through the active web page | N/A |
profile-navbar | Shows the profile summary of the user when logged in and a sign in button when logged out. |
|
Example
The library can be consumed as a whole with preselected components and in an already defined order as shown :
app.component.html
The output would be as shown below :
[]
The library could also be consumed in bits, choosing a few compoenents and in whichever order the developer desires as shown :
app.component.html
<div>
<brand-navbar [brandDetails]="myNav.brand" ></brand-navbar>
<link-navbar [linkDetails]="myNav.links"></link-navbar>
<action-navbar [actionDetails]="myNav.actions"></action-navbar>
<search-navbar></search-navbar>
</div>
To achieve the image above, the arrays to be passed t the library are as shown :
app.component.ts
myBrand: any = [
{
src: "https://sisitech.com/images/logo-dark.png",
url: "http://localhost:4200/",
alt: "company-logo"
},
]
myLinks: any = [
{
type: "single",
name: "Home",
route: "",
},
{
type: "single",
name: "About Us",
route: "about"
},
{
type: "dropdown",
name: "Portfolio",
subLinks : [
{
type: "single",
name: "Websites",
route: "portfolio/websites"
},
{
type: "single",
name: "Mobile Apps",
route: "portfolio/mobile-apps"
},
{
type: "single",
name: "IoT",
route: "portfolio/iot"
},
],
},
{
type: "single",
name: "Blog",
route: "null"
},
{
type: "single",
name: "Our Products",
route: "null",
fragment: "products"
},
{
type: "single",
name: "Contact Us",
route: "null"
}
]
myActions: any = [
{
name: "Access Service Desk",
action : this.service()
}
]
myProfile: any =[
{
src: "https://i.pinimg.com/custom_covers/222x/85498161615209203_1636332751.jpg",
actions : [
{
name: "My Profile",
route: "profile"
},
{
name: "My Collections",
route: "collections"
}
]
}
]
myNav={
brand: this.myBrand,
links: this.myLinks,
actions: this.myActions,
profile: this.myProfile,
}
Note
The functions being passed in the actions array need to be defined in the app.component.ts file.