AisBrandBar
Basic Example
The AisBrandBar accepts a site prop for the application name and a href or to prop for the link to the application home page.
Search
The application Search link is disabled by default but can be used by using the searchable prop. The Search link emits a search-click event when clicked, allowing the developer to trigger any necessary behavior.
User Menu
If your application uses authentication, the AisBandBar exposes a Boolean auth prop and a user prop. The auth prop is required to use the user menu.
Auth Prop
Once auth is set to true and prior to authentication, when the user prop is empty, a 'Sign in' link is visible. This 'Sign in' link will emit the @login event when it is clicked. Handle the event to trigger your application's authentication flow.
User Prop
Once the user authenticates and the user prop is populated, the user menu is displayed. The user prop accepts a String if you only want to pass the Hawk ID or a user Object, which must contain a hawkId attribute. By default, the user menu will have a Sign Out menu option which will emit a logout event when clicked.
If you'd like to have other menu items, you can achieve this in one of two ways: using the user-menu-items prop or by using the userMenuItems slot. Either way, additional menu items will be listed above the Sign Out menu item, which will always be last in the menu.
User Menu Items Prop
The user-menu-items prop accepts an Array of JavaScript objects, representing the menu items. See AisMenu for more details on the options available.
User Menu Items Slot
The userMenuItems slot accepts any combination of AisMenuItem, AisMenuDivider, or AisMenuGroup components to fill out your menu. See AisMenu for more detail.
Complete Example
Component Reference
Props
Property | Type(s) | Required | Default | Description | Deprecated |
|---|---|---|---|---|---|
| auth | Boolean | false | Boolean prop to indicate that authentication is used in the application. | false | |
| href | String | '' | The url for the application home page | false | |
| originalUser | Object, String | '' | This is used when impersonating to keep track of the actual user. | false | |
| searchable | Boolean | false | Whether the Search bar should be displayed in the header | false | |
| site | String | '' | The application site name | false | |
| to | String | '' | The nuxt/vue path to the application home page | false | |
| user | Object, String | '' | For the User Menu. Accepts either a String (Hawk ID) or a user object, which must include the key "hawkId" | false | |
| userMenuItems | Array | [] | Menu items to display in the user menu (AisUserMenu) | false |
Slots
Name | Scoped | Description |
|---|---|---|
| sitename | No | Scoped slot for custom rendering site name link |
| userMenuItems | No | Scoped slot for custom rendering the menu items for the user menu (AisUserMenu) |
Events
Event | Arguments | Description |
|---|---|---|
| login |
| Emitted when the user clicks login |
| logout |
| Emitted when the page changes |
| search-click |
| Emitted when the search button is clicked |
| stopImpersonating |
| Emitted when the page changes |