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

Laravel

This page explains how to integrate Azalea Kit UI with a Laravel 9 app using Vite. For additional details refer to the Bundling Assets (Vite) section in the official Laravel docs.

Requirements

  • Laravel 9.1
  • Vite 3.0

Instructions

These instructions assume a default Laravel 9 install that uses Vite to bundle assets. Be sure to run npm install to install the default Laravel front-end dependencies before installing Azalea Kit UI.

Install the Azalea Kit UI package

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

Import the default theme

Import the Azalea Kit UI default theme (stylesheet) in /resources/css/app.css:

@import '/node_modules/@azaleahealth/azalea-kit-ui/dist/themes/light.css';

Import Azalea Kit UI components

Import each component you plan to use in /resources/js/bootstrap.js. Use the full path to each component (as outlined in the Installation instructions). You can find the full import statement for a component in the Importing section of the component’s documentation (use the Bundler import). Your imports should look similar to:

import '@azaleahealth/azalea-kit-ui/components/button/button.js';
import '@azaleahealth/azalea-kit-ui/components/checkbox/checkbox.js';
import '@azaleahealth/azalea-kit-ui/components/menu/menu.js';

Verify vite entry points

Laravel pre-configures the Vite entry points in vite.config.js as resources/css/app.css and resources/js/app.js. If you use a different location for your CSS and/or Javascript entry point, update this configuration to accordingly.

plugins: [
        laravel({
            input: ["resources/css/app.css", "resources/js/app.js"],
            refresh: true,
        }),
    ],

Compile front-end assets

Run the Vite development server or production build.

## run the Vite development bundle
npm run dev

## build a production bundle (with versioning)
npm run build

Include front-end assets in your layout file

Add the @vite() Blade directive to the <head> of your application’s root template.

<head>
  ... @vite(['resources/css/app.css', 'resources/js/app.js'])
</head>