This is a complete example of using Seatmap Canvas with React.
- Install dependencies:
cd examples/react
npm install- Run development server:
npm run dev- Open your browser at http://localhost:3001
- Component-based integration with TypeScript
- Ref usage for advanced control
- Event handling (seat clicks, selections)
- Dynamic data generation
- Zoom controls
- Selected seats management
- Price calculation
- Custom styling
examples/react/
├── index.html # HTML entry point
├── src/
│ ├── main.tsx # React app initialization
│ ├── App.tsx # Main component with full example
│ └── App.css # Styles
├── package.json # Dependencies
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This file
This example demonstrates:
- Component with Ref: Using forwardRef to access seatmap instance
- Props & Events: Passing options, data, and event handlers
- State Management: Managing selected seats with React state
- TypeScript: Full type safety with TypeScript
- Zoom Controls: Programmatic zoom control
- Dynamic Data: Generating random seat data