Breadcrumb
<ahi-breadcrumb> | AhiBreadcrumb
Breadcrumbs provide a group of links so users can easily navigate a website’s hierarchy.
Breadcrumbs are usually placed before a page’s main content with the current page shown last to indicate the user’s position in the navigation.
<ahi-breadcrumb>
<ahi-breadcrumb-item>Home</ahi-breadcrumb-item>
<ahi-breadcrumb-item>RCM Dashboard</ahi-breadcrumb-item>
<ahi-breadcrumb-item>General</ahi-breadcrumb-item>
</ahi-breadcrumb>
Examples
Links
By default, breadcrumb items are rendered as buttons so you can use them to navigate single-page applications. In this case, you’ll need to add event listeners to handle clicks.
For websites, you’ll probably want to use links instead. You can make any breadcrumb item a link by applying an href attribute to it. Now, when the user activates it, they’ll be taken to the corresponding page — no event listeners required.
<ahi-breadcrumb>
<ahi-breadcrumb-item href="https://example.com/home">Home</ahi-breadcrumb-item>
<ahi-breadcrumb-item href="https://example.com/home/rcm-dashboard">RCM Dashboard</ahi-breadcrumb-item>
<ahi-breadcrumb-item href="https://example.com/home/rcm-dashboard/general">General</ahi-breadcrumb-item>
</ahi-breadcrumb>
Custom separators
Use the separator slot to change the separator that goes between breadcrumb items. Icons work
well, but you can also use text or an image.
<ahi-breadcrumb>
<ahi-icon name="arrow-narrow-right" slot="separator"></ahi-icon>
<ahi-breadcrumb-item>First</ahi-breadcrumb-item>
<ahi-breadcrumb-item>Second</ahi-breadcrumb-item>
<ahi-breadcrumb-item>Third</ahi-breadcrumb-item>
</ahi-breadcrumb>
<br />
<ahi-breadcrumb>
<span slot="separator">/</span>
<ahi-breadcrumb-item>First</ahi-breadcrumb-item>
<ahi-breadcrumb-item>Second</ahi-breadcrumb-item>
<ahi-breadcrumb-item>Third</ahi-breadcrumb-item>
</ahi-breadcrumb>
Prefixes
Use the prefix slot to add content before any breadcrumb item.
<ahi-breadcrumb>
<ahi-breadcrumb-item>
<ahi-icon slot="prefix" name="home"></ahi-icon>
Home
</ahi-breadcrumb-item>
<ahi-breadcrumb-item>RCM Dashboard</ahi-breadcrumb-item>
<ahi-breadcrumb-item>General</ahi-breadcrumb-item>
</ahi-breadcrumb>
Suffixes
Use the suffix slot to add content after any breadcrumb item.
<ahi-breadcrumb>
<ahi-breadcrumb-item>Settings</ahi-breadcrumb-item>
<ahi-breadcrumb-item>General</ahi-breadcrumb-item>
<ahi-breadcrumb-item>
Security
<ahi-icon slot="suffix" name="shield"></ahi-icon>
</ahi-breadcrumb-item>
</ahi-breadcrumb>
With dropdowns
Dropdown menus can be placed in the default slot to provide additional options.
<ahi-breadcrumb>
<ahi-breadcrumb-item>Settings</ahi-breadcrumb-item>
<ahi-breadcrumb-item>
<ahi-dropdown>
<ahi-button slot="trigger" size="small" plain>
<ahi-icon label="More options" name="dots"></ahi-icon>
</ahi-button>
<ahi-menu>
<ahi-menu-item type="checkbox" checked>General</ahi-menu-item>
<ahi-menu-item type="checkbox">Billing</ahi-menu-item>
<ahi-menu-item type="checkbox">Scheduler</ahi-menu-item>
</ahi-menu>
</ahi-dropdown>
</ahi-breadcrumb-item>
<ahi-breadcrumb-item>Users</ahi-breadcrumb-item>
</ahi-breadcrumb>
Alternatively, you can place dropdown menus in a prefix or suffix slot.
<ahi-breadcrumb>
<ahi-breadcrumb-item>Settings</ahi-breadcrumb-item>
<ahi-breadcrumb-item>
General
<ahi-dropdown slot="suffix">
<ahi-button slot="trigger" size="small" plain>
<ahi-icon label="More options" name="dots"></ahi-icon>
</ahi-button>
<ahi-menu>
<ahi-menu-item type="checkbox" checked>Users</ahi-menu-item>
<ahi-menu-item type="checkbox">Roles</ahi-menu-item>
<ahi-menu-item type="checkbox">Locations</ahi-menu-item>
</ahi-menu>
</ahi-dropdown>
</ahi-breadcrumb-item>
</ahi-breadcrumb>
Importing
To import this component using a script tag:
<script type="module" src="/path/to/azalea-kit-ui/dist/components/breadcrumb/breadcrumb.js"></script>
To import this component using a bundler:
import '@azaleahealth/azalea-kit-ui/dist/components/breadcrumb/breadcrumb.js';
Slots
| Name | Description |
|---|---|
| (default) | One or more breadcrumb items to display. |
separator
|
The separator to use between breadcrumb items. Works best with <ahi-icon>. |
Learn more about using slots.
Properties
| Name | Description | Type | Default | |
|---|---|---|---|---|
label
|
The label to use for the breadcrumb control. This will not be shown on the screen, but it will be announced by screen readers and other assistive devices to provide more context for users. |
string
|
''
|
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about properties and attributes.
CSS Parts
| Name | Description |
|---|---|
base |
Deprecated. Use the breadcrumb part instead. |
breadcrumb |
The component’s outer wrapper. |
Learn more about customizing CSS parts.
Dependencies
This component automatically imports the following dependencies.
<ahi-icon>