Getting started
The packages are not published to a registry. Inside this repository they are workspace packages; other repositories link them with bun link.
Inside the monorepo
Depend on a package with the workspace protocol and run bun install at the root:
{
"dependencies": {
"@peleda-app/tokens": "workspace:*",
"@peleda-app/ui": "workspace:*",
"@peleda-app/landing": "workspace:*"
}
}From another repository
Register the packages once from a checkout of peleda-app/ui:
bun run link:alllink:all runs bun link in packages/tokens, packages/ui, packages/landing, packages/docs, packages/site and packages/storybook-kit. In the other repository, depend on the links and install:
{
"dependencies": {
"@peleda-app/tokens": "link:@peleda-app/tokens",
"@peleda-app/ui": "link:@peleda-app/ui"
}
}The linked packages are live source. Keep a single copy of React by deduplicating it in Vite:
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: { dedupe: ['react', 'react-dom'] },
})@peleda-app/ui needs React 19.3 as a peer dependency.
CSS
One stylesheet brings in Tailwind 4, the tokens and the kits:
@import 'tailwindcss';
@import '@peleda-app/tokens/index.css';
@import '@peleda-app/ui/styles.css';
@import '@peleda-app/landing/styles.css';
@source './';@peleda-app/tokens/index.cssimportsfonts.css,tokens.css, the generated default themetheme.cssandtailwind.css.tailwind.cssresets Tailwind's colour, radius and font scales and maps them to--pl-*variables with@theme inline, adds thedarkvariant, therounded-*andcorner-*utilities that setcorner-shape, and base styles for the cursor, selection and the root font.@peleda-app/ui/styles.cssand@peleda-app/landing/styles.csshold only@source './', so Tailwind scans the kit sources for class names.
Leave out the landing stylesheet in an app that does not use the landing kit.
Fonts
index.css loads Geist, Geist Mono and the Noto Sans families for other scripts through fonts.css. An app that lets people choose a font imports fonts-all.css before index.css; it adds Inter, IBM Plex, Atkinson Hyperlegible Next, Lexend and OpenDyslexic:
@import 'tailwindcss';
@import '@peleda-app/tokens/fonts-all.css';
@import '@peleda-app/tokens/index.css';Fonts are @font-face rules from Fontsource, so a browser only downloads the files a page uses. See Fonts and scripts.
Providers
Components animate with m from motion/react inside LazyMotion, and tooltips need a provider. Wrap the app once:
import { MotionProvider, TooltipProvider } from '@peleda-app/ui'
export function App({ children }: { children: React.ReactNode }) {
return (
<MotionProvider>
<TooltipProvider>{children}</TooltipProvider>
</MotionProvider>
)
}MotionProvider sets reducedMotion="user", so animations follow the system setting.