React — guide & examples
Online React playground with live preview, JSX support, and React components. Build and test React applications directly in your browser.
About React
Online React playground with live preview, JSX support, and React components. Build and test React applications directly in your browser.
Runtime: v19.2.3
Features
- React 19 Support
- JSX Editor
- Live Preview
- React Hooks
- Component Development
- State Management
- Event Handling
Browser playground limits
- • Code runs in a sandboxed browser preview, without Node.js, a backend, or private environment variables.
- • The Console prompt can inspect browser globals and the rendered DOM, but not variables scoped inside ES modules or component state.
- • Download the project when you need build plugins, server APIs, native modules, or a production dependency workflow.
How to use the React playground
- Edit a source file from the project explorer — the live preview recompiles automatically.
- Add, rename, duplicate or delete project files as needed. Update affected imports after renaming or moving a file.
- Use the console for logs and errors, and Format to tidy the active file.
- Share the complete project or download a Vite project ZIP with its source files and package.json.
Editing
Select next occurrenceCtrl / ⌘+D
Delete lineCtrl / ⌘+Shift+K
Move line up / downAlt+↑ / ↓
Copy line up / downAlt+Shift+↑ / ↓
Navigation
Go to symbolCtrl / ⌘+Shift+O
Selection
Select all occurrencesCtrl / ⌘+Shift+L
Terminal
Interrupt / kill processCtrl+C
Send EOF (close stdin)Ctrl+D
Console shortcuts
Press Enter to evaluate, ↑ and ↓ to browse command history, and Ctrl/⌘ + L to clear the console.
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from './App'
import './styles.css'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)
import { useState } from 'react'
import { CounterCard } from './components/CounterCard'
export default function App() {
const [count, setCount] = useState(0)
return (
<main className="app-shell">
<p className="eyebrow">React 19 · TypeScript + JSX</p>
<h1>Build with real components</h1>
<p className="intro">
This playground compiles JSX, TypeScript, CSS, and local component
imports directly in your browser.
</p>
<CounterCard count={count} onIncrement={() => setCount((value) => value + 1)} />
</main>
)
}
Frequently asked questions
- Is the React playground free?
- Yes. The React playground is completely free with no sign-up — write, run and share React code in your browser.
- Do I need to install anything to run React online?
- No. The live preview compiles and runs in your browser. After downloading the project, install its dependencies before running it locally.
- Can I share or export my React code?
- Yes. Share creates a link to your project. Download exports a Vite project ZIP with its source files and package.json.
- Does the editor support autocomplete and live preview?
- It does — a Monaco-powered editor with autocomplete and formatting, a live preview that updates as you type, and a console for logs and errors.
compilebytes.com/tools/react