Components

Modal

Dialog modal with backdrop, focus trapping, keyboard dismissal, and optional footer actions.

import{ Modal }from"oks-ui"
Focus trapEscape dismissBackdrop blurCustom sizesFooter actions

Basic

Controlled via isOpen and onClose. Supports title, children, and footer actions.

Interactive Playground

Controls

Preview

Generated Code

const [isOpen, setIsOpen] = useState(false);

<Button onPress={() => setIsOpen(true)}>Open Modal</Button>
<Modal isOpen={isOpen} onClose={() => setIsOpen(false)} title="Modal Title">
  This is the modal body.
</Modal>

Props

isOpen

boolean

Controls visibility (required).

onClose

() => void

Called when modal is dismissed (required).

title

ReactNode

Modal title rendered in the header.

children

ReactNode

Modal body content.

actions

ReactNode

Footer action buttons.

size"md"

"sm" | "md" | "lg"

Modal size.

dismissibletrue

boolean

Show close button.

closeOnOutsideClicktrue

boolean

Close on backdrop click.

closeOnEscapetrue

boolean

Close on Escape key.

blurfalse

boolean | 'sm' | 'md' | 'lg' | number

Backdrop blur intensity.

portaltrue

boolean

Render in portal.