React Flagship
Workshop flagship: React Flagship Model—powering ac.yunyoujun.cn, complete with 600 × 200 wide casing plus 3D wall and tower modes.
Not Yet Published to npm
@air-conditioner/react currently lives inside this monorepo (pnpm workspace) and powers ac.yunyoujun.cn. For external React apps, use the Web Component or the published Vue component.
For a ready-made unit, the Web Component is enough. For a custom—or AI-generated—skin, build your own shell with core's createAirConditionerHeadless + useSyncExternalStore today instead of waiting for a styled React package; see AI Custom Skins.
Install the React adapter inside the workspace:
pnpm add @air-conditioner/reactRender the all-in-one widget:
import { AirConditionerWidget } from '@air-conditioner/react'
import '@air-conditioner/react/style.css'
export function App() {
return <AirConditionerWidget storageKey="ac:state" />
}Or compose AirConditionerProvider, AirConditioner, and RemoteControl manually:
import {
AirConditioner,
AirConditionerProvider,
RemoteControl,
} from '@air-conditioner/react'
import '@air-conditioner/react/style.css'
export function App() {
return (
<AirConditionerProvider>
<AirConditioner />
<RemoteControl />
</AirConditionerProvider>
)
}Parity with the Vue Edition
Both React and Vue share the same style.css, markup structure, and visual tests.
| Prop | Default | Description |
|---|---|---|
logoUrl | /yun-logo.svg | Center logo image URL |
assetsBaseUrl | /assets | Base path for fonts/ and audio/ |
audioExt | m4a | Audio file extension |
enableAudio | true | Enable sound effects |
showEnergyLabel | true | Show the energy efficiency label |
When using AirConditioner directly, pass size="wide" for the 600 × 200 wide chassis (default 360 × 128). Any children are positioned onto the front panel (used by the live demo site for decorative stickers). See Audio and Sound Modes, Airflow and Swing, and Remote Buttons for command details.