/** @jsxImportSource @blender-ui/react */ // The same counter in JSX. Bun runs it as is: `bun examples/counter.jsx`. // Elsewhere, compile with `"jsxImportSource": "@blender-ui/react"`. import { render, useState } from '@blender-ui/react' function Counter () { const [count, setCount] = useState(0) const [name, setName] = useState('') return (

BUI + React

Clicks: {count}
setName(e.target.value)} /> {name.value &&

Hello, {name}!

}
) } const { app, window } = render(, { title: 'BUI + React', width: 420, height: 260 }) window.body.setAttribute('styled', '') window.body.className = 'm-0 bg-[#2b2b2b] text-[#e6e6e6]' if (process.env.BUI_EXAMPLE_SECONDS) setTimeout(() => app.quit(), Number(process.env.BUI_EXAMPLE_SECONDS) * 1000)