Install with your package manager of choice:
npm install @emdgroup-liquid/liquid
yarn add @emdgroup-liquid/liquid
pnpm add @emdgroup-liquid/liquid
There are multiple options to choose from when importing and registering Liquid Web Components:
The self-lazy-loading bundle is a tree shakable bundle, which includes all Liquid components as well as polyfills. You just import it once, then it automatically loads components lazily whenever they are used in your app.
import { defineCustomElements } from '@emdgroup-liquid/liquid/dist/loader'
defineCustomElements()
The dist-custom-elements output target is used to generate custom elements in a more optimized way for tree shaking. The generated output consists of ES Modules which helps bundlers to parse and optimize the code.
import { LdButton } from '@emdgroup-liquid/liquid/dist/components/ld-button'
customElements.define('ld-button', LdButton)
Learn more about the differences in the Stencil docs.
We recommend importing Liquid stylesheets in a central place respectively the entry file of your application.
There are two options to choose from when importing stylesheets from Liquid. Depending on your needs you should choose one or the other.
import '@emdgroup-liquid/liquid/dist/css/liquid.css'
import '@emdgroup-liquid/liquid/dist/css/liquid.global.css'
import '@emdgroup-liquid/liquid/dist/css/ld-button.css'