Modal
Overlay dialog for focused interactions, with size, placement, and backdrop variants.
Basic
Reset password
Enter your email to reset your password.
Sizes
Set width through class: responsive max-widths, fixed pixel widths, or full-width.
A responsive max-width modal
This modal uses Tailwind's max-w-xl
and w-full
for a responsive layout: full width on small screens, capped at xl on larger ones.
A fixed-width modal
A fixed 400px width keeps layouts stable across screens.
A full-width modal
A full-width modal spans the entire viewport. Useful for dense dashboards or long-form editors.
Placement
Position the modal near any viewport edge. center is the default; edge-anchored placements slide in with a subtle offset. For full-height drawers or full-width banners, reach for Fluxon.Components.Sheet instead.
Center
This modal uses the center placement.
Top
This modal uses the top placement.
Bottom
This modal uses the bottom placement.
Left
This modal uses the left placement.
Right
This modal uses the right placement.
Custom backdrop
Override the overlay with backdrop_class: blur, blackout, or a tinted color.
Frosted glass
A subtle dim plus a backdrop blur keeps the page legible while pushing it back.
Blackout
Opaque black hides the page entirely. Good for media viewers and immersive flows.
Light dim
A soft 10% dim keeps the surrounding context fully visible.
Blue tint
Tint the backdrop with any color to match the brand or signal mood.
Scrollable layout
Pin a header and footer while letting the middle section scroll. Use p-0 on the modal and pad each region individually.
Recent activity
Jane Doe created project Aurora
2 minutes ago
Marco Rossi merged pull request #412 Tighten rate limiter
14 minutes ago
Aisha Khan uploaded design-mocks-v3.fig
32 minutes ago
Kenji Tanaka commented on Onboarding revamp
1 hour ago
Lina Park archived project Polaris (legacy)
3 hours ago
Jane Doe invited ben@fluxland.dev
5 hours ago
Marco Rossi deployed release v2.4.0
yesterday
Aisha Khan renamed project Helix to Helios
yesterday
Kenji Tanaka resolved issue #387 Stale cache on profile
2 days ago
Lina Park shared dashboard Q2 metrics
2 days ago
Confirmation dialog
The classic destructive-action pattern. Compose close_dialog with JS.push so a single click closes the dialog and dispatches the action.
Archive this project?
The project will move to the archive. You can restore it within 30 days.
Type-to-confirm delete
A high-friction destructive flow. The submit button stays disabled until the user types the exact phrase and ticks the acknowledgement checkbox.
Form integration
Form bound to a LiveView changeset. phx-change validates on every keystroke; phx-submit closes the modal on success and shows field-level errors otherwise.
Image lightbox
Pair a dark backdrop with hide_close_button and a transparent surface to show media without competing chrome.
Mountain landscape - photo by Unsplash
Command palette
placement="top" with a search input and result list. A common pattern for keyboard-first apps.
Integration setup
Onboarding flow with selectable methods and a conditional input. The Continue button stays disabled until the chosen method is satisfied.
Review with inline warning
An inline <.alert> shows the consequence the moment the user picks the action, replacing a separate confirmation step. The expandable target row reveals metadata on demand.
Move domain
Move fluxonui.com to another environment.
Multi-step wizard
Multi-step form inside a modal. Each step is validated by its own changeset before Next advances; Previous and clicking any already visited step in the sidebar are always allowed.
Loading state
Render the loading visual as the modal's default content so it is on screen the moment the dialog opens. Three variants below: a centered spinner, a layout-matching skeleton, and a streaming bar pulse. Each kicks off a 1.5s server roundtrip before the real content takes over.
Loading user details
Fetching profile data...
Streaming profile
connectedClosing behavior
Disable individual dismissal paths with close_on_esc and close_on_outside_click, or block all of them with prevent_closing. The server can always force a close through Fluxon.close_dialog/2 regardless of these flags.
ESC disabled
Pressing the Escape key will not dismiss this modal. The backdrop click and close button still work.
Outside click disabled
Clicking the backdrop will not dismiss this modal. ESC and the close button still work.
All client closing disabled
The close button is also hidden. The dialog can only be closed from the server (or by reloading the page). See the Server-driven flow example below for a working demo.
Hide the close button
hide_close_button removes the built-in close icon in the top-right corner so the modal can ship its own dismissal UI. ESC and outside-click still work unless they are individually disabled.
Stacked modals
Multiple modals can be open at once. Fluxon tracks the stack: the topmost dialog stays interactive and focus-trapped, the rest dim. Closing the top one returns focus to its previous holder.
Jane Doe
Adminjane@example.com
Active now
- Joined
- March 2024
- Projects
- 12 owned
Edit Jane Doe
Changes apply immediately when you save.
Save changes?
Updating the user will notify them by email.
Delete Jane Doe?
This action cannot be undone.
Open from the server
The server can open a modal at any time with Fluxon.open_dialog/2: delayed prompts, push notifications, or any flow where the trigger lives in handle_info/2 rather than a click.
The button does not open the modal directly. It pushes a server event; the LiveView counts down and then calls
Fluxon.open_dialog/2
from a handle_info/2.
Opened by the server
The countdown finished, then the LiveView pushed the open event through Fluxon.open_dialog/2.
Close from the server
Lock down dismissal with prevent_closing and let the server close the modal once the workflow finishes.
Confirm payment
Esc, backdrop click, and the close button are all disabled. Only the server can dismiss this dialog after the charge succeeds.