This library was generated with Nx.
Run nx test player to execute the unit tests via Vitest.
npm init vite@latest my-project --template react
# chose React and Typescript
cd my-project
npm install
npm run dev npm install @carbon-builder/player-react @carbon/reactRename App.css -> App.scss and change the import path to it in App.tsx
Add the following to the top of App.scss to activate Carbon styles
@use '@carbon/react';You can remove other existing stuff from it or add your own Build your page with Carbon UI Builder or using Builder SDK then click "Export" and open JSON tab in the export modal
import { useState } from 'react'
import { UIFragment } from '@carbon-builder/player-react';
import './App.scss'
const componentObj = {}; // paste your exported JSON model here
function App() {
const [state, setState] = useState(componentObj);
return <UIFragment state={state} setState={setState} />;
}
export default App;