Support native dialog #6353
jim-king-2000
started this conversation in
Feature requests
Replies: 1 comment 1 reply
-
|
I build one, which is amazing: 'use client'
import { Button, Modal } from '@heroui/react'
import { Rocket } from '@gravity-ui/icons'
export default function Page() {
return (
<Modal>
<Button
render={(domProps) => (
<button {...domProps} command='show-modal' commandfor='my-dialog' />
)}
>
Open Modal
</Button>
<dialog
id='my-dialog'
className='sm:max-w-[360px] m-auto bg-overlay hidden open:block p-3 rounded-3xl'
>
<Modal.CloseTrigger
render={(domProps) => (
<button {...domProps} command='close' commandfor='my-dialog' />
)}
/>
<Modal.Header>
<Modal.Icon className='bg-default text-foreground'>
<Rocket className='size-5' />
</Modal.Icon>
<Modal.Heading>Welcome to HeroUI</Modal.Heading>
</Modal.Header>
<Modal.Body>
<p>
A beautiful, fast, and modern React UI library for building
accessible and customizable web applications with ease.
</p>
</Modal.Body>
<Modal.Footer>
<Button
className='w-full'
render={(domProps) => (
<button {...domProps} command='close' commandfor='my-dialog' />
)}
>
Continue
</Button>
</Modal.Footer>
</dialog>
</Modal>
)
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How to use native
<dialog>with heroui v3?Is there any easy way to change the code above to heroui style?
Beta Was this translation helpful? Give feedback.
All reactions