2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Components

Modal

Updated: July 27, 2026
View on GitHub
The Modal component creates a full-screen overlay with a slide-up animation from the bottom. It features automatic scroll locking, keyboard navigation, and click-outside-to-close functionality. Add custom backdrop content behind the modal dialog using the backdrop prop. The Modal component includes several built-in features:
  • Smooth animations: Fade-in overlay with slide-up modal transition
  • Scroll lock: Prevents body scrolling while modal is open
  • Keyboard navigation: Press Escape to close
  • Click outside: Click outside the modal to dismiss
  • Auto-scroll reset: Content scrolls to top when modal opens
  • Accessibility: role="dialog" and aria-modal="true" on the overlay
Modal does not currently contain focus: Tab from the last control inside it moves to the page behind, and focus is not returned to the trigger on close. aria-modal="true" tells a screen reader the rest of the page is inert, which is not yet enforced. Until that is fixed, wrap the contents in a FocusTrap when the modal is a real modal step rather than an aside — or use Dialog, which traps focus and restores it.
  • Modal slides up from the bottom with a 600ms ease transition
  • Overlay fades in with a 300ms transition
  • Close button is positioned in the top-right corner
  • Content area is scrollable if it exceeds viewport height
  • Modal is rendered in a portal to document.body
Prop
Type
Default
children
Modal content
React.ReactNode
backdrop
Optional backdrop content behind the modal
React.ReactNode
titlerequired
Modal title displayed at the top
React.ReactNode
openrequired
Controls modal visibility
boolean
onCloserequired
Callback when modal should close
() => void
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club