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

Vue

Vue.js has excellent support for custom elements, it only requires a little configuration.

Installation

To add Azalea Kit UI to your Vue app, install the package from npm.

npm install git@bitbucket.org:azaleahealth/azalea-kit-ui.git

Next, include a theme in your main entry point.

// main.js or main.ts
import '@azaleahealth/azalea-kit-ui/themes/light.css';

Configuration

If you haven’t configured your Vue.js project to work with custom elements/web components, follow the instructions here based on your project type to ensure your project will not throw an error when it encounters a custom element.

Types

Once you have configured your application for custom elements, you should be able to use Azalea Kit UI in your application without it causing any errors. Unfortunately, this doesn’t register the custom elements to behave like components built using Vue. To provide autocomplete information and type safety for your components, you can import the Azalea Kit UI Vue types into your tsconfig.json to get better integration in your standard Vue and JSX templates.

{
  "compilerOptions": {
    "types": ["@azaleahealth/azalea-kit-ui/dist/types/vue"]
  }
}

Usage

Example

<template>
  <ahi-button variant="primary" @click="count++"> Count is: {{ count }} </ahi-button>
</template>

<script setup>
  import { ref } from 'vue';
  import '@azaleahealth/azalea-kit-ui/components/button/button.js';

  const count = ref(0);
</script>

Binding complex data

When binding complex data such as objects and arrays, use the .prop modifier to make Vue bind them as a property instead of an attribute.

<ahi-user-menu :user.prop="myUserObj"></ahi-user-menu>

Two-way Binding

One caveat is there’s currently no support for v-model on custom elements, but you can still achieve two-way binding manually.

<!-- This doesn't work -->
<ahi-input v-model="name"></ahi-input>
<!-- This works, but it's a bit longer -->
<ahi-input :value="name" @input="name = $event.target.value"></ahi-input>

Using Icons

Icons are loaded automatically — no imports or registration required. Simply use the name attribute with any Tabler icon name.

<template>
  <ahi-icon name="home"></ahi-icon>
  <ahi-icon name="phone"></ahi-icon>
</template>