hiki - a dialog will turn into a drawer on small viewport
Preview the example on https://hiki.minhle.space/
import { Dialog } from "@monodyle/hiki"; // not published yet...
function Application() {
return (
<Dialog target={({ open }) => <button onClick={open}>Open Dialog</button>}>
{({ close }) => (
<div className="content">
{/* your code goes here */}
</div>
)}
</Dialog>
)
}
import { Dialog } from "@monodyle/hiki"; // not published yet...
function Application() {
const [open, setOpen] = useState(false)
return (
<Dialog open={open} onOpenChange={setOpen} target={<button onClick={() => setOpen(true)}>Open Dialog</button>}>
<div className="content">
{/* your code goes here */}
</div>
</Dialog>
)
}
yarn # install dependencies
yarn dev # make it awesome
Inspired by Devon Govett
MIT © Monody Le 2023+