Esc

Components

All components Every component, with search. Accordion Sections that expand and collapse, one at a time or several. Alert A highlighted message, optionally dismissible. Avatar A person's picture, with initials when there is none. Avatar group Overlapping avatars with a "+N" count for the rest. Badge A small status label. Banner A dismissible strip across the top of a page. Breadcrumb The path to the current page, collapsing long trails. Button Buttons in every variant and size, with icons and a loading state. Button to A button that submits a one-off form, like Rails' button_to. Card A bordered container with header, content and footer. Checkbox A checkbox with label, standalone or bound to a form builder. Collapsible A section that opens and closes under its trigger, like a branch of a nav tree. Data grid A sortable, filterable, server-paged table on AG Grid. Date picker A typed date field with a calendar, on Cally. Dialog A modal dialog on the native <dialog> element. Divider A horizontal or vertical rule, optionally labelled. Form field A label, hint and error message wired to any form control. Icon A Lucide icon. Image An image with consistent sizing and corner radius. Input A text field with label, hint and error message, standalone or with a form builder. Input group A text field with addons before or after it. Label A form label with a required marker. Link A link styled as text or as a button. Menu A dropdown menu with keyboard navigation. Pagination Page links for a long list, from a Pagy object. Password input A password field with a show/hide toggle. Popover Floating content anchored to a trigger. Radio group A set of radio buttons. Native select The browser's own select, styled closed; best for phones' system pickers. Select A styled dropdown with keyboard navigation and type-ahead, posting like a native select. Sheet A panel that slides in from an edge of the screen. Sidebar A collapsible application sidebar with groups and menus. Spinner A loading indicator. Switch An on/off toggle. Table A styled table with header, rows and caption. Table of contents An "On this page" list that follows the reader's scroll. Tabs Tabbed panels with keyboard navigation. Text Body text in set sizes, weights and tones. Textarea A multi-line text field with label, hint and error, that can grow with its text. Theme toggle A light/dark/system theme switcher. Tooltip A hint shown on hover and focus. Typography Headings, lead, muted, code and blockquote text styles.

Dialog

UI::Dialog

A modal dialog on the native <dialog> element.

bin/rails generate velvetkit:add dialog
Stimulus
ui--dialog
Installs
Nothing

Examples

Default

Edit profile

Make changes to your profile here. Click save when you're done.

Confirmation

Delete this project?

This action cannot be undone. All project data will be removed permanently.

Custom Trigger

Release notes

A custom trigger can adopt the dialog semantics without rendering a nested button.

Dialog trigger attributes are merged into the anchor element.

The trigger keeps its own classes while inheriting the chosen button variant tokens.

Long Content

Usage policy

Long-form modal content should remain readable and keep actions pinned at the end.

Dialogs are best reserved for focused tasks, decisions, or short forms.

Because the component uses the native dialog element, focus is moved into the modal and restored to the opener when it closes.

The content element is portaled under body at runtime so the backdrop and stacking context stay predictable.

Sizes

Small dialog

This is the smallest dialog size, great for confirmations.

Default dialog

This is the default dialog size for most use cases.

Large dialog

This is a large dialog, useful for forms and detailed content.

Extra large dialog

This is the largest dialog size, ideal for complex workflows.

Without Close Button

No close button

This dialog hides the default close button. Users must interact with the footer actions to dismiss it.

Without Title

This dialog has no title or description header.

Use this pattern when the content speaks for itself or when you want a cleaner, minimal modal.

Scrollable Body

Terms of Service

Please review the full terms before continuing.

1. Acceptance of Terms
By accessing or using our services, you agree to be bound by these Terms of Service. If you do not agree to all the terms and conditions, you may not access the service.

2. Changes to Terms
We reserve the right, at our sole discretion, to modify or replace these Terms at any time. It is your responsibility to review these Terms periodically for changes.

3. Use License
Permission is granted to temporarily use the materials on our website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title.

4. Disclaimer
The materials on our website are provided on an 'as is' basis. We make no warranties, expressed or implied, and hereby disclaim and negate all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights.

5. Limitations
In no event shall we or our suppliers be liable for any damages arising out of the use or inability to use the materials on our website, even if we or an authorized representative has been notified orally or in writing of the possibility of such damage.

6. Accuracy of Materials
The materials appearing on our website could include technical, typographical, or photographic errors. We do not warrant that any of the materials on our website are accurate, complete, or current.

7. Links
We have not reviewed all of the sites linked to our website and are not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by us of the site.

8. Governing Law
These terms and conditions are governed by and construed in accordance with the laws of the jurisdiction in which we operate, and you irrevocably submit to the exclusive jurisdiction of the courts in that location.

API

Arguments
UI::Dialog.new(class: nil, **html_attrs)
Slots: with_trigger with_body with_content with_title with_description with_footer

Notes

UI::Dialog — modal dialog backed by the native <dialog> element + showModal(). Why native <dialog>: - Browser owns the modal mode, focus trap, ESC handling, and inert background. We do not reimplement any of that in JS. - The Stimulus controller only opens, closes, and dismisses on backdrop click. Everything else is delegated to the platform. Compound: UI::Dialog UI::Dialog::Trigger — wraps any element with a click action UI::Dialog::Content — the <dialog> box; exposes with_title / with_description / with_footer block helpers (no further sub-component classes).