Click, tap or press Space to play.
import { NotFoundBreakout } from '@brand-studio/ui';
export default function NotFoundBreakoutDemo() {
return (
<div style={{ width: '100%', maxWidth: 480 }}>
<NotFoundBreakout />
</div>
);
}Installation
pnpm add @brand-studio/uinpm install @brand-studio/uiyarn add @brand-studio/uibun add @brand-studio/uiInstall the peer dependencies
npm install react react-domImport the stylesheet once
import '@brand-studio/ui/styles.css';Wrap your app in a brand theme
import { BrandTheme, NotFoundBreakout } from '@brand-studio/ui'; import brand from './brand.json'; <BrandTheme palette={brand.tokens} mode="system"> {/* your app */} </BrandTheme>
Usage
import { NotFoundBreakout } from '@brand-studio/ui';<NotFound title="This page is not here" art={<NotFoundBreakout />} />Space, a click or a tap launches the ball. The paddle follows the pointer or the left and right arrow keys. The bricks take the brand's ink and the paddle and ball its accent, and both change with the theme.
Accessibility
- The game never starts by itself and pauses when the tab is hidden.
- The canvas takes keyboard focus, and a status line below it says how many bricks are left and what to press.
- Keep the way out of the page above the game, so nobody has to play to leave.
API Reference
| Prop | Type | Default |
|---|---|---|
label? | string | 'Brick game. Press Space to launch, and the left and right arrows to move.' |
className? | string | '' |