Changelog Azalea Kit UI 101 Usage Customizing Utilities Form controls Laravel Vue FHIR Types Accessibility Icons Actions Button Button group Layout and structure Card Card section Care summary Care timeline Divider Empty state Footer Header Layout Stack Table Selection and input Calendar Checkbox Checkbox group Color picker Combobox Combobox option Input Input mask Memorable date Number input Option Phone input Radio Radio button Radio group Range Select SSN input Tag Textarea Toggle ZIP code input Images and icons Avatar Icon Icon button Logo Feedback indicators Badge Banner Progress bar Skeleton Skeleton body text Skeleton display text Skeleton thumbnail Spinner Typography Text Navigation Breadcrumb Breadcrumb item Dropdown Menu Menu item Menu label Navigation Nav group Nav item Nav toggle Pagination Tab Tab group Tab panel Top bar Tree Tree item User menu Overlays Dialog Popover Tooltip Utilities Collapsible FHIR address FHIR human name FHIR quantity FHIR questionnaire Format bytes Format date Format number Relative time Resize observer Split panel Tooltip Border Color Shadow Spacing Transition Typography Z-index Contributing Visual Tests Light Dark System

Divider

<ahi-divider> | AhiDivider

Dividers are used to visually separate or group elements.

<ahi-divider></ahi-divider>

Using TailwindCSS with AKU may override divider styles, making them invisible. As a workaround, add this to your TailwindCSS input file:

@layer base {
  ahi-divider:not([vertical]) {
    border-top: solid var(--width) var(--color);
  }

  ahi-divider[vertical] {
    border-left: solid var(--width) var(--color);
  }
}

Examples

Width

Use the --width custom property to change the width of the divider.

<ahi-divider style="--width: 4px;"></ahi-divider>

Color

Use the --color custom property to change the color of the divider.

<ahi-divider style="--color: var(--ahi-color-red-600);"></ahi-divider>

Spacing

Use the --spacing custom property to change the amount of space between the divider and it’s neighboring elements.

Above Below
<div style="text-align: center;">
  Above
  <ahi-divider style="--spacing: 2rem;"></ahi-divider>
  Below
</div>

Vertical

Add the vertical attribute to draw the divider in a vertical orientation. The divider will span the full height of its container. Vertical dividers work especially well inside of a flex container.

First Second Third
<div style="display: flex; align-items: center; height: 2rem;">
  First
  <ahi-divider vertical></ahi-divider>
  Second
  <ahi-divider vertical></ahi-divider>
  Third
</div>

Use dividers in menus to visually group menu items.

Option 1 Option 2 Option 3 Option 4 Option 5 Option 6
<ahi-menu style="max-width: 200px;">
  <ahi-menu-item value="1">Option 1</ahi-menu-item>
  <ahi-menu-item value="2">Option 2</ahi-menu-item>
  <ahi-menu-item value="3">Option 3</ahi-menu-item>
  <ahi-divider></ahi-divider>
  <ahi-menu-item value="4">Option 4</ahi-menu-item>
  <ahi-menu-item value="5">Option 5</ahi-menu-item>
  <ahi-menu-item value="6">Option 6</ahi-menu-item>
</ahi-menu>

Importing

Script Bundler

To import this component using a script tag:

<script type="module" src="/path/to/azalea-kit-ui/dist/components/divider/divider.js"></script>

To import this component using a bundler:

import '@azaleahealth/azalea-kit-ui/dist/components/divider/divider.js';

Properties

Name Description Type Default
vertical Draws the divider in a vertical orientation. boolean false
updateComplete A read-only promise that resolves when the component has finished updating.

Learn more about properties and attributes.

Custom Properties

Name Description Default
--color The color of the divider.
--width The width of the divider.
--height The height of the divider.
--spacing The spacing of the divider.

Learn more about customizing CSS custom properties.