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 ^19, react-dom ^19, aura-glass/styles.css
Motion-rich components
motion ^12 only when the selected surface uses aura-glass/motion
Icons
First-party `aura-glass/icons` entrypoint; no icon peer dependency
Forms and validation
react-hook-form ^7 only when a form recipe or aura-glass/forms binding uses it
Date and calendar
@internationalized/date and react-aria-components for aura-glass/date
Charts and analytics
d3-scale and d3-shape for chart adapters framed by aura-glass/data
3D and spatial effects
three, @react-three/fiber, @react-three/drei from aura-glass/three
AI surfaces
The app supplies provider calls; aura-glass/ai renders Thread, Message, and Composer from props

#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 (React 19)
npm install aura-glass@5.0.2

# Motion (only for aura-glass/motion surfaces)
npm install motion

# Charts (adapters framed by ChartFrame from aura-glass/data)
npm install d3-scale d3-shape

# Date and calendar (aura-glass/date)
npm install @internationalized/date react-aria-components

# Forms
npm install react-hook-form

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

#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.css` is missing or loaded in the wrong place.

Cannot resolve d3-scale
Install the d3 peers for the chart adapter or remove the chart surface
Cannot resolve three
Install 3D peers or avoid spatial components
Cannot resolve @internationalized/date
Install the date peers for aura-glass/date components
Cannot resolve motion
Install motion ^12 for aura-glass/motion surfaces
Unstyled UI
Import `aura-glass/styles.css` 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.