Optimize a Lily application

Import only what the page uses, load one theme, and measure the built application—not the size of Lily's full catalog on disk.

Start with the smallest adoption path

Copying a component's semantic HTML adds no JavaScript dependency and no runtime beyond the markup itself. Choose a headless package when framework props, state, focus management, or keyboard behaviour save more code than the import costs. Choose a helper only when you need the complete interaction it owns.

Import the components you use

The JavaScript packages declare sideEffects: false, so a production bundler may discard unused exports. Prefer named imports and verify the production output; do not use the full installed footprint as a bundle estimate.

import { Button, Field, EmailInput } from "@lilydesignsystem/react-headless";

Svelte ships compiled component files so the consumer's compiler can optimize them. Vue emits per-component chunks. React bundles its catalog into a small number of ESM files. Those packaging differences make file counts incomparable; the application bundle after tree-shaking is the useful result.

Measured package sizes

These are npm registry unpackedSize measurements from 26 August 2026, recorded in the repository's benchmark report. They measure the installed package before bundling, not bytes sent to a user.

PackageMeasured versionUnpackedFiles
@lilydesignsystem/svelte-headless0.3.01,364 KB987
@lilydesignsystem/vue-headless0.3.0660 KB496
@lilydesignsystem/react-headless0.3.0572 KB5
@lilydesignsystem/react-theme-picker0.1.038 KB4
@lilydesignsystem/svelte-date-time-picker0.1.082 KB6

The 0.3.0 packaging work reduced the installed React and Svelte packages by 80% and Vue by 75% compared with 0.2.0. No current benchmark yet reports minified and compressed application bundles for 10, 50, and 200 components; do not turn the installed figures above into that claim.

Load one theme

Load one stylesheet from @lilydesignsystem/themes. The theme picker swaps the href of one managed link, so changing theme fetches one replacement stylesheet rather than loading all 63. If you own the visual design, a stylesheet containing only the hooks you use can be smaller still; Lily's planned CSS slicer is not shipped.

Measure the production build

  1. Build in production mode with source maps reported separately.
  2. Record minified and compressed sizes for the same application before and after the Lily imports.
  3. Inspect the bundle graph for unused barrel exports and duplicate framework runtimes.
  4. Test interaction and rendering on the slowest supported device; bytes alone do not measure responsiveness.
  5. Record tool, framework, browser, hardware, versions, and date so another person can reproduce the result.

Pin pre-1.0 versions

Lily remains pre-1.0, so a minor release may contain a breaking change. Pin exact package versions and review the changelog before updating. The documentation will not offer a version switcher until a first stable 1.0 release exists; a switcher with only unstable snapshots would imply a support promise the project does not make.