About the Headless UI compiler
Unstyled, accessible UI components by Tailwind Labs. Built on VM via Vite + npm. Run Headless UI code in your browser with no install and no signup — the editor, the input and the output share one screen. Headless UI is executed by a remote runtime: your code is submitted to it and the output is returned to this page.
Press Run to execute the program, edit it and press Run again, or paste your own code over it. Everything you type stays in the page; the editor caches your work locally so a reload does not lose it.
A Headless UI example
This is the program the Headless UI editor opens with — run it as it is, then change it.
import { useState, Fragment } from 'react';
import { Menu, Transition, Tab, Switch } from '@headlessui/react';
export default function App() {
const [enabled, setEnabled] = useState(false);
return (
<div className="max-w-md mx-auto space-y-6 p-8">
<h1 className="text-2xl font-bold text-gray-900">Headless UI</h1>
<p className="text-gray-600">Unstyled, accessible UI components</p>
{/* Dropdown Menu */}
<Menu as="div" className="relative inline-block">
<Menu.Button className="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700">
Options
</Menu.Button>
<Transition
as={Fragment}
enter="transition ease-out duration-100"
enterFrom="opacity-0 scale-95"
enterTo="opacity-100 scale-100"
>
<Menu.Items className="absolute left-0 mt-2 w-48 bg-white rounded-lg shadow-lg border p-1">
<Menu.Item>
{({ active }) => (
<button className={`${active ? 'bg-indigo-50' : ''} w-full text-left px-3 py-2 rounded-md text-sm`}>
Edit
The editor opens with the full program.
More Web UI Frameworks compilers
Browse all 109 languages — the same editor runs each of them, in the browser or on a shared runner.