Installation
BiibaOS is a premium, platform-adaptive UI component library designed for high-performance React and Next.js applications. Build seamless user interfaces with standard-based CSS variables, native spring physics, and robust theme switches.
Unified Design System
Coherent tokens, spacing, and typography that scale consistently across every viewport.
Platform-Adaptive
Components automatically feel native — desktop gets hover precision, mobile gets touch targets and spring physics.
Runtime Theming
CSS variable tokens update globally at runtime. No rebuild required for dark mode or branding changes.
AI-Optimized Integration
Ships with a modular llms.txt doc set — index + per-component pages — so AI coding tools (Claude, ChatGPT, Cursor) fetch exactly the props they need, instantly.
Package Installation
Install the package from npm. The library ships as ESM + CJS with full TypeScript types.
npm install biibaosProviders Setup
Create a Providers.tsx wrapper component. You must include 'use client' at the top of the file when using Next.js App Router.
REQUIRED SETUP
The ToastProvider and SnackbarProvider are essential for notifications to render properly. They must sit inside the primary BiibaOSProvider.
'use client'
import { BiibaOSProvider, ToastProvider, SnackbarProvider } from 'biibaos'
import 'biibaos/styles'
export function Providers({ children }: { children: React.ReactNode }) {
return (
<BiibaOSProvider followSystemTheme>
<SnackbarProvider>
<ToastProvider position="top-right">
{children}
</ToastProvider>
</SnackbarProvider>
</BiibaOSProvider>
)
}Finally, wrap your root layout with this Providers component.
import { Providers } from '@/components/Providers'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<Providers>{children}</Providers>
</body>
</html>
)
}AI Setup Guide
BiibaOS ships its own llms.txt documentation set so AI tools (Cursor, Claude, ChatGPT, Windsurf, Copilot) generate code with the exact current props — instead of guessing from training data or mixing in patterns from other UI libraries.
One file used to be enough — not anymore
This is now a small file tree, not a single llms.txt. Point your agent at the index first, and let it fetch the specific component page(s) it needs — that keeps its context small and its props accurate, since each page reflects the current release only.
1. The doc structure
Every URL below is public and always reflects the installed version (biibaos Sierra 2026.1.0).
/llms.txtStart hereThe index. Lists every component with a one-line summary and a link to its page. Small enough to paste anywhere.
/llms/00-setup.mdFetch second, alwaysBiibaOSProvider props, theming, the shared base props (className/style/platform), and shared tokens (BiibaSize, BiibaVariant…) that every other page assumes you already know.
/llms/<Component>.mdFetch per component, on demandOne focused file per component (Button.md, Modal.md, DynamicIsland.md…) with its exact, current prop table. Only fetch the ones actually used in the task.
/llms-full.txtFallback for single-file toolsEvery page above concatenated into one document — for tools that only accept one URL or one uploaded file (no per-page fetching).
2. Connect it to your AI tool
Pick whichever you use — each one takes under a minute.
- Open Cursor Settings → Indexing & Docs → Add Doc.
- Paste
/llms.txtand name it "BiibaOS". - In chat, type
@Docsand select it whenever you build UI.
Or, skip the manual step and make it automatic project-wide:
---
description: BiibaOS component usage rules
globs: ["**/*.tsx"]
alwaysApply: true
---
Before writing or editing any UI, fetch /llms.txt to see which
components exist, then fetch the specific /llms/<Component>.md
page(s) you need. Also fetch /llms/00-setup.md before using any
component for the first time in this session — it defines shared base
props and tokens that aren't repeated on each component page.
Never invent a prop that isn't in the fetched page. Import everything
from 'biibaos' — there are no deep imports.3. The prompt that actually works
Vague instructions ("read the docs") make agents skim once and start guessing. Be explicit about what to fetch, when, and what not to do — this is the prompt we use internally, drop it into a system prompt, .cursorrules, or the first message of a chat:
You are building UI with BiibaOS (biibaos, Sierra 2026.1.0) —
not a generic component library. Do not use props, imports, or patterns
from memory; this library is custom and versioned independently.
Before writing any component:
1. Fetch /llms.txt — it's an index of every component with a link
to its own doc page. Use it to find what exists.
2. Fetch /llms/00-setup.md once per session, before your first
component — it covers BiibaOSProvider, shared base props
(className/style/platform), and shared tokens (BiibaSize, BiibaVariant,
BiibaRadius) that are NOT repeated on individual component pages.
3. For every component you plan to use, fetch its own page —
/llms/<Component>.md — and use only the props listed there.
4. If you can't browse URLs at all, ask me to paste /llms-full.txt
instead, and treat it as the full reference.
Hard rules:
- Never invent a prop. If it's not documented on that component's page,
don't use it — ask, or pick a documented alternative.
- Import everything from 'biibaos' — there are no deep
imports like 'biibaos/Button'.
- Always wrap the app in <BiibaOSProvider>. Add <ToastProvider> /
<SnackbarProvider> only if useToast() / useSnackbar() are actually used.
- If a prop you expect seems missing, re-fetch the page rather than
assuming it exists — pages change between releases.Provider Options
| Prop | Type | Default | Description |
|---|---|---|---|
theme | Partial<BiibaTheme> | — | Override any design token at provider level |
defaultDark | boolean | undefined | Force initial dark mode on mount |
followSystemTheme | boolean | true | Automatically track OS colour scheme |
motion | BiibaMotionProp | moderate | Configure animation presets or custom platform physics |
spatialDepth | boolean | false | Enable Pillar 2 iOS-style tilt-parallax globally (requires sensor permission) |
spatialIntensity | BiibaTiltIntensity | moderate | Configure spatial parallax tilt intensity ('subtle' | 'moderate' | 'expressive') |
capabilities | Partial<BiibaSierraCapabilities> | — | Toggle animations/features globally (entrance, choreography, throwGestures, tiltParallax, ambientContrast, chartPhysics) |
componentOverrides | BiibaComponentOverrideMap | — | Granular capability and motion override per component name (e.g. { Toast: { entrance: false } }) |
Dark Mode
// Automatic — follows OS preference
<BiibaProvider followSystemTheme>
// Force dark on load
<BiibaProvider defaultDark>
// Manual control via hook
const { isDark, toggleDark, setDark } = useBiiba()
<button onClick={toggleDark}>{isDark ? 'Light Mode' : 'Dark Mode'}</button>Motion System
BiibaOS comes with a comprehensive, platform-adaptive physics-based motion system. By default, it automatically adjusts spring stiffness, damping, and transition times based on the user's device (Mobile vs Desktop) to ensure native-feeling interactions.
// Simplest — use a global preset
<BiibaProvider motion="expressive">
// Advanced — Different feel per platform
<BiibaProvider
motion={{
desktop: {
preset: 'subtle', // Fast, less bouncy for mouse
spring: { stiffness: 400, damping: 35, mass: 0.8 },
},
mobile: {
preset: 'expressive', // Slower, more bouncy for touch
spring: { stiffness: 220, damping: 18, mass: 1.2 },
},
reducedMotion: undefined, // Follows OS accessibility settings automatically
}}
>
// Disable animations entirely on a specific platform
<BiibaProvider
motion={{
desktop: { preset: 'none' }, // No animations on desktop
mobile: { preset: 'moderate' }, // Normal animations on mobile
}}
>Sierra Overrides & Capabilities
Sierra introduces a powerful, multi-level capability override chain. This system lets you turn specific motion features on or off globally, target individual component classes, or customize a specific element instance.
Capabilities Schema
| Field | Type | Default | Description |
|---|---|---|---|
entrance | boolean | true | Allows components to slide/fade on mount. |
choreography | boolean | true | Sequenced sub-component animations (icon → title → body → footer). |
throwGestures | boolean | true | Enable velocity-based throw dismissals. |
tiltParallax | boolean | false | Enable iOS-style glass layers shifting on phone tilt. |
ambientContrast | boolean | false | Dynamic contrast alpha-nudge theme adjustments. |
chartPhysics | boolean | true | Spring staggered entrances and draw paths for Recharts. |
The Override Chain (Priority Order)
Settings resolve dynamically starting from instance properties down to global preferences:
- Instance Props: prop overrides defined directly on a component (e.g.
<Card choreography={false} />) - Component Overrides:
componentOverridesdefined on the Provider (e.g.Toast: { entrance: false }) - Global Capabilities:
capabilitiestoggle defined on the Provider (e.g.capabilities={{ throwGestures: false }}) - Global Preset: standard motion preset selection (e.g.
motion="snappy") - Platform Default: standard desktop/mobile timing configuration from `motion.ts`
- Reduced Motion Preference:
prefers-reduced-motionmedia query always wins and disables motion.
import { BiibaOSProvider } from 'biibaos'
export function Providers({ children }) {
return (
<BiibaOSProvider
motion="moderate"
spatialDepth={true} // Opt-in to spatial depth (Pillar 2)
spatialIntensity="subtle"
capabilities={{
tiltParallax: true, // Turn tilt parallax on globally
ambientContrast: false, // Leave dynamic contrast opt-in
}}
componentOverrides={{
Toast: { entrance: false }, // Disable toast mount animations globally
ActionSheet: { throwGestures: false }
}}
>
{children}
</BiibaOSProvider>
)
}