Skip to content

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:

bash
pnpm add @air-conditioner/react

Render the all-in-one widget:

tsx
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:

tsx
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.

PropDefaultDescription
logoUrl/yun-logo.svgCenter logo image URL
assetsBaseUrl/assetsBase path for fonts/ and audio/
audioExtm4aAudio file extension
enableAudiotrueEnable sound effects
showEnergyLabeltrueShow 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.

Released under the MIT License · The only catch is no actual wind