Skip to main content

React

PCUI components can be used directly in React applications. Import the components from the React package and use them in your .jsx files as follows:

import * as React from 'react';
import ReactDOM from 'react-dom';
import { TextInput } from '@playcanvas/pcui/react';
import '@playcanvas/pcui/styles';

ReactDOM.render(
<TextInput />,
document.body
);

This example renders a basic text input component. You can see it in action below:

For more complex implementations, check out the examples section.

Storybook

The PCUI Storybook provides an interactive showcase of all available components. You can:

  • Explore each component's properties and behavior
  • Test different configurations in real-time
  • View component documentation
  • Copy example code