Monorepo of React component libraries for Lido Finance projects.
ui.lido.fi itself is a landing page linking to all three.
This repository is a Yarn workspaces monorepo orchestrated with Turborepo. It publishes the following packages to npm:
| Package | npm name | Description | Storybook |
|---|---|---|---|
packages/lido-landing-ui |
@lidofinance/lido-landing-ui |
Components tailored for Lido's landing / marketing pages (banners, cards, tags, tooltips, typography, etc). One of the two current replacements for lido-ui. |
ui.lido.fi/lido-landing-ui |
packages/lido-app-ui |
@lidofinance/lido-app-ui |
Components for Lido app/widget products. Currently small and growing. The other current replacement for lido-ui. |
ui.lido.fi/lido-app-ui |
packages/lido-shared-ui |
@lidofinance/lido-shared-ui |
Shared hooks, utils, theme CSS and types consumed by the other packages. No Storybook of its own. | — |
packages/lido-ui |
@lidofinance/lido-ui |
Deprecated / legacy. The original component library (buttons, inputs, modals, data tables, icons, theme, etc). Being phased out in favor of lido-landing-ui / lido-app-ui. Avoid adding new components here. |
ui.lido.fi/lido-ui |
Note:
@lidofinance/lido-uiis deprecated and no longer the primary library. It is being slowly replaced by@lidofinance/lido-landing-uior@lidofinance/lido-app-ui, depending on the design requirements of the consuming project — pick whichever matches the target project's design system for new work.
Published Storybooks are deployed to GitHub Pages by the deploy-storybook / deploy-pages jobs in publish-production.yml: each package's Storybook is published under its own subfolder, and the domain root (ui.lido.fi) serves a landing page (source: .github/pages/index.html) linking to all three.
lido-shared-uihas no internal dependencies — it's the shared foundation (hooks, utils, theme-css, types).lido-landing-uiandlido-app-uidepend onlido-shared-ui.lido-uicurrently has no internal dependencies and is self-contained (legacy, not built on the shared foundation).
Each package under packages/* follows the same shape:
src/- component source codedist/- build output (cjsandesm), generated onbuild, not committedrollup.config.mjs- Rollup build configtsconfig.json/tsconfig.production.json- TypeScript configs (production config is used for.d.tsgeneration during build)vitest.config.ts- test config
Turborepo (configured in turbo.json) runs tasks across all packages and caches results:
yarn build→turbo run build- builds every package; a package'sbuilddepends on^build(its dependencies' builds), solido-shared-uiis always built beforelido-landing-ui/lido-app-ui.yarn test→turbo run testyarn lint→turbo run lintyarn types→turbo run typesyarn build-storybook→turbo run build-storybook
- Install the required node version
nvm use
- To get started, install the dependencies:
yarn install
- Build the packages:
yarn build
Run a package's Storybook directly:
yarn storybook:ui- Storybook forlido-ui(port5555)yarn storybook:landing- Storybook forlido-landing-ui(port5556)yarn storybook:app- Storybook forlido-app-ui(port5557)
Or target any workspace script directly with yarn workspace <package-name> <script>, e.g.:
yarn workspace @lidofinance/lido-ui test
yarn workspace @lidofinance/lido-landing-ui icons:convertRepo-wide scripts:
yarn build- Build all packages.yarn test- Run tests across packages.yarn lint- Run eslint across packages.yarn lint:css- Run stylelint across packages.yarn types- Type-check all packages (tsc --noEmit).
Packages are automatically published to npm when you push to main. The publication is based on semantic-release and @lidofinance/multi-semantic-release.
All packages are versioned and published together — multi-semantic-release understands the internal dependency graph above (e.g. a breaking change in lido-shared-ui bumps the packages depending on it too). See RELEASES.md for the full release process.
For correct version detection, please follow the conventional commit format. To release a new major version, create a commit with ! like this - feat!: ui v4
Add the package matching your project's design system:
yarn add @lidofinance/lido-landing-ui # or @lidofinance/lido-app-uiSetup, styles import, typography and CSS variable customization differ per package (lido-landing-ui and lido-ui use --lido-ui-* variables, lido-app-ui uses --lido-app-ui-*), so follow the package README:
lido-landing-uilido-app-uilido-ui(deprecated)
Theme providers live in lido-shared-ui (src/theme-css) and are re-exported by lido-landing-ui and lido-app-ui.
By default, the theme will be set to the value obtained after calling the themeScriptValueString method and will be the same as all other Lido products. This ensures consistent theming across the Lido ecosystem.
- For products with theme switching: You must use
CookieThemeProviderandThemeTogglercomponents - For products without theme switching: You must use
ThemeProviderwith your chosen theme. OrCookieThemeProviderwith hardcodedoverrideThemeNameandinitialThemeName
The CookieThemeProvider determines the theme based on the following priority:
- Override theme (if provided)
- URL query parameter
- Cookie value
- Initial theme (if provided)
- System preference (light/dark mode)
- Default theme
Drop the SVG under the package's src/icons/svg/ and commit. The pre-commit hook runs that package's icons:convert and stages the generated files. To run it manually: yarn workspace <package-name> icons:convert.
lido-ui: flatsvg/*.svg, converted to PascalCase components insrc/icons/index.tsx.lido-landing-ui: category foldersbase/,defi/,general/,lido/,logo/,strategies/,token/.logo/icons get aLogosuffix (e.g.AaveLogo).lido-app-ui: category foldersbase/,chains/,protocols/,token/,wallets/.base/icons get anIconprefix (IconArrowUp),token/icons aTokenprefix (TokenAave).