@briza/air

The building blocks for a custom InsureTech experience

Usage no npm install needed!

<script type="module">
  import brizaAir from 'https://cdn.skypack.dev/@briza/air';
</script>

README

Briza Air

The building blocks for a custom insuretech experience

v.0.1.4

What is it?

Briza Air is a web components library designed to help developers create the best experience for merchants who use Briza API. It is framework-agnostic, which means it is not dependent or restricted to any one framework for implementation.

Our design system helps agencies, developers and designers work together to build great insuretech experiences. It has been built using the principles of Atomic Design.

Using the web components

Installation

Run the following command using npm:

npm install @briza/air --save

If you prefer Yarn, use the following command instead:

yarn add @briza/air

Usage

Integrating the Briza Air components library to a project without a JavaScript framework is straightforward.

Import

Import the library to your module and define custom elements:


NOTE

When defineCustomElements() is called, it will define every component in the bundle. However, it does not run automatically and it will not be called if it is not imported and executed.


import { defineCustomElements } from '@briza/air'
defineCustomElements()

Render

Render Briza Air Button element in the DOM:

<air-button type="button">Click me!</air-button>

NOTE: The air-button component example demonstrates how to assign HTML attributes and pass data as a slot. Render Briza Air Select element in the DOM:

<air-select></air-select>

Props

You can find prop interfaces on the documentation page under each component's section usage.

const airSelectElement = document.querySelector('air-select');
airSelectElement.options = {
  { value: '1', label: 'Item 1' },
  { value: '2', label: 'Item 2' },
  { value: '3', label: 'Item 3' },
  { value: '4', label: 'Item 4' },
};

Events

Briza Air provides custom events with the prefix air-.

const airSelectElement = document.querySelector('air-select')
airSelectElement.addEventListener('air-change', function (event) {
  console.log('Emitted data: ', event.detail)
})

Styling and customization

Theming

To speed up customizing Briza Air's global look and feel to fit your visual identity, Briza Air provides a theme file housing global variables affecting color, typography, and spacing. Download this theme file, edit (editing overwrites the variables) and include it in your project.

Usage

You can use these theme stylesheets in the following ways.

HTML Embed

Include your CSS file (available in the application styles folder) into index.html.

<link rel="stylesheet" href="/styles/theme.css" />
Import into module

Import into a required module.

import '/styles/theme.css'

Component customization

Briza Air provides the ability to customize component properties such as size (width, height), spacing (margin, padding), typography, colors. You can download the collection of each file.


NOTE

Single CSS files for each component can be downloaded at their respective component page.


Every component has a list of variables that can be defined and overwritten to match your brand guidelines. You should include these styles in your application's main CSS file.

:root {
  --air-color-white: #ffffff;
  --air-color-accent: #8a2be2;
  --air-color-eclipse: #3a3a3a;
  --air-color-success: #5ec075;
  --air-color-warning: #ffdf52;
  --air-color-error: #e55451;
  --air-body-color: var(--air-color-eclipse);
  --air-body-font-family: Inter;
  --air-body-font-size: 1rem;
  ...;
}

Refer to documentation, for more information on using CSS variables.

Useful links