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.
| Package | Measured version | Unpacked | Files |
|---|---|---|---|
@lilydesignsystem/svelte-headless | 0.3.0 | 1,364 KB | 987 |
@lilydesignsystem/vue-headless | 0.3.0 | 660 KB | 496 |
@lilydesignsystem/react-headless | 0.3.0 | 572 KB | 5 |
@lilydesignsystem/react-theme-picker | 0.1.0 | 38 KB | 4 |
@lilydesignsystem/svelte-date-time-picker | 0.1.0 | 82 KB | 6 |
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
- Build in production mode with source maps reported separately.
- Record minified and compressed sizes for the same application before and after the Lily imports.
- Inspect the bundle graph for unused barrel exports and duplicate framework runtimes.
- Test interaction and rendering on the slowest supported device; bytes alone do not measure responsiveness.
- 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.