Dialog

A Dialog component displays a pop-up window for capturing user attention or input. Built on top of heroui-native Dialog.

Demo

Demo Coming Soon

Dialog examples will be available soon.

Usage

import { useState } from 'react';
import { NButton, NDialog, DialogSize } from '@nayan-ui/react';
const Dialog = () => {
const [isOpen, setIsOpen] = useState(false);
return (
<div>
<NDialog isOpen={isOpen} onClose={() => setIsOpen(false)} size={DialogSize.MD} title="Payment confirmation">
Your payment has been successfully submitted. We’ve sent you an email with all of the details of your order.
</NDialog>
<NButton onClick={() => setIsOpen(true)}>Show Dialog</NButton>
</div>
);
};
export default Dialog;

Attributes

NameTypeDefaultDetails
titlestringRequiredTitle for the dialog.
descriptionstringOptionalDescription text below the title.
childrenReact.ReactNodeOptionalContent for the dialog body.
triggerReact.ReactNodeOptionalTrigger element for the dialog.
isOpenbooleanOptionalControlled open state.
isDefaultOpenbooleanOptionalDefault open state for uncontrolled usage.
onOpenChange(isOpen: boolean) => voidOptionalCallback when open state changes.
isSwipeablebooleanOptionalWhether the dialog can be swiped to dismiss.
classNamestring' 'You can customise by passing tailwind classes.
titleClassNamestring' 'You can customise title by passing tailwind classes.
contentClassNamestring' 'You can customise content by passing tailwind classes.