diff --git a/packages/playground-react/pages/combinations/form.tsx b/packages/playground-react/pages/combinations/form.tsx new file mode 100644 index 0000000000..4b726f1782 --- /dev/null +++ b/packages/playground-react/pages/combinations/form.tsx @@ -0,0 +1,353 @@ +import { useState } from 'react' +import { Switch, RadioGroup, Listbox, Combobox } from '@headlessui/react' +import { classNames } from '../../utils/class-names' + +function Section({ title, children }) { + return ( +
+ ) +} + +let sizes = ['xs', 'sm', 'md', 'lg', 'xl'] +let people = [ + { id: 1, name: { first: 'Alice' } }, + { id: 2, name: { first: 'Bob' } }, + { id: 3, name: { first: 'Charlie' } }, +] +let locations = ['New York', 'London', 'Paris', 'Berlin'] + +export default function App() { + let [result, setResult] = useState(() => (typeof window === 'undefined' ? [] : new FormData())) + let [notifications, setNotifications] = useState(false) + let [apple, setApple] = useState(false) + let [banana, setBanana] = useState(false) + let [size, setSize] = useState(sizes[(Math.random() * sizes.length) | 0]) + let [person, setPerson] = useState(people[(Math.random() * people.length) | 0]) + let [activeLocation, setActiveLocation] = useState( + locations[(Math.random() * locations.length) | 0] + ) + let [query, setQuery] = useState('') + + return ( +