Documentation menu · Guides
Reference

Optional Peers

AuraGlass keeps advanced dependencies optional by feature family, including charts, Radix controls, 3D, AI, and media surfaces.

#Peer Matrix

Install peers for the components you import. Do not add 3D, AI, chart, realtime, or media dependencies to apps that only use cards, buttons, navigation, and layout surfaces.

When an import fails at runtime, first identify the feature family. A missing chart peer should not lead to installing Three.js. A command palette needing icons should not lead to installing AI SDKs.

Core controls and surfaces
react, react-dom, aura-glass/styles
Motion-rich components
framer-motion if the selected component imports motion primitives
Icons and command surfaces
lucide-react
Forms and Radix-backed controls
@radix-ui/react-* and react-hook-form as documented per component
Charts and analytics
chart.js and react-chartjs-2
3D and spatial effects
three, @react-three/fiber, @react-three/drei from aura-glass/three
AI and server services
openai or service-specific environment configuration

#Install Commands by Family

Use these commands only when the selected component family needs them. Keep the core install separate from feature installs so dependency review is understandable in pull requests.

Some advanced features also need application configuration: API keys, realtime URLs, media permissions, or server routes. The peer package only provides the client capability; it does not replace app-level infrastructure.

bash
# Core
npm install aura-glass

# Charts
npm install chart.js react-chartjs-2

# Forms
npm install react-hook-form

# 3D / spatial
npm install three @react-three/fiber @react-three/drei

# Icons / command surfaces
npm install lucide-react

#Failure Symptoms

A missing optional peer usually appears as a module resolution error during build or route load. An unconfigured service usually appears as an empty state, auth error, or network error inside the app. Treat those differently.

If a docs example renders without styles, that is not an optional peer issue. It means `aura-glass/styles` is missing or loaded in the wrong place.

Cannot resolve chart.js
Install chart peers or remove chart components
Cannot resolve three
Install 3D peers or avoid spatial components
Command icons missing
Install lucide-react when using icon-heavy command UI
Realtime empty state
Configure the app service, room id, and provider
Unstyled UI
Import `aura-glass/styles` once at the app root

#Agent Rule

AI agents should not install optional peers preemptively. They should name the component family, list the required peers, add only those packages, and report why each dependency was added.

For recipes, keep the peer list beside the code block. A copied recipe should make the dependency cost visible before the developer pastes it into an app.