Eject with an upgrade path
The unsolved problem in component libraries: npm packages lock you out of internals, while copy-paste kits (shadcn-style) hand you the code but cut you off from upstream fixes forever. LatticeUI's CLI gives you both.
1. Eject a component
$ latticeui add button
+ latticeui-ui/button/button.tsx
+ latticeui-ui/button/button.css
Added button v0.1.0. Runtime deps: latticeui-core, latticeui-tokens.The source is now yours - edit it like any other file in your repo. Behind the scenes, LatticeUI records the pristine upstream snapshot in .latticeui/base/ and pins versions + content hashes in latticeui-lock.json.
2. Modify it freely
/* latticeui-ui/button/button.css - your edit */
[data-scope="button"][data-part="root"] {
height: 2.5rem; /* taller buttons for our brand */
}3. Pull upstream improvements later
$ latticeui update button
~ button.css (merged your changes with upstream)
Updated button to v0.2.0 cleanly.latticeui update runs a 3-way merge per file: base snapshot vs. your copy vs. the new upstream version. Non-overlapping changes merge cleanly; genuine overlaps produce git-style conflict markers you resolve in your editor - exactly like a rebase, but for vendored UI components.
Merge semantics
| Your copy | Upstream | Result |
|---|---|---|
| unchanged | unchanged | no-op |
| modified | unchanged | your copy kept untouched |
| unchanged | modified | fast-forwarded to upstream |
| modified | modified | 3-way merge (conflict markers only on true overlaps) |