No Setup Required

Live Code Playground

Write and run React code instantly in your browser. Experiment with examples or start from scratch.

import { useState } from 'react'

export default function App() {
  const [count, setCount] = useState(0)

  return (
    <div style={{ padding: '20px', textAlign: 'center' }}>
      <h1>Counter: {count}</h1>
      <button
        onClick={() => setCount(count + 1)}
        style={{
          padding: '10px 20px',
          fontSize: '16px',
          cursor: 'pointer',
          marginRight: '10px'
        }}
      >
        Increment
      </button>
      <button
        onClick={() => setCount(0)}
        style={{
          padding: '10px 20px',
          fontSize: '16px',
          cursor: 'pointer'
        }}
      >
        Reset
      </button>
    </div>
  )
}

Edit Code

Modify the code on the left and see live updates on the right

Try Templates

Click the buttons above to load different example projects

Experiment

Break things, fix them, and learn by doing!

Powered by Sandpack Built by Kushagra Kukreti