Create and share beautiful images of your source code. Start typing or paste a code snippet into the text area to get started.
import { useState } from 'react'
import { Switch } from '@headlessui/react'
export const Example = () => {
const [enabled, setEnabled] = useState(true)
return (
<form action="/notification-settings" method="post">
<Switch checked={enabled} onChange={setEnabled} name="notifications">
{/* ... */}
</Switch>
<button>Submit</button>
</form>
)
}