defmodule PyrauiWeb.DocsLive.ModalDocs do use PyrauiWeb, :html def render(assigns) do assigns = assigns |> assign_new(:docs_modal_confirm_open, fn -> false end) |> assign_new(:docs_modal_glass_open, fn -> false end) |> assign_new(:docs_modal_large_open, fn -> false end) ~H"""
Modal Overlays

Modal

Accessible dialogs with variants, subtle motion, and thoughtful defaults.

Classic Confirmation

Use for destructive or high-signal actions.

Variant: classic
Open confirm
<:title>Delete project

Deleting will remove all data. This action cannot be undone.

<:footer> Cancel Delete

Glass Info

A frosted panel for light, non-blocking content.

Variant: glass
Open glass modal
<:title>What’s new

PyraUI 1.3 introduces tone-aware badges, tables, and chart upgrades.

<:footer> Got it

Danger + Large

Prominent header line signals a risky operation.

Variant: danger · Size: lg
Open large modal
<:title>Rotate access tokens

We’ll generate new client secrets and disable the previous set after 24 hours.

<:footer> Cancel Rotate now

Props

Control size, variant, and accessibility labels. Bind show to LiveView state and use open-modal/close-modal events as shown.

Prop Type Default Description
id string Unique id for dialog and accessibility hooks.
show boolean false Controls visibility; bind to LiveView assigns.
size :sm | :md | :lg | :xl :md Max width of the dialog frame.
variant :classic | :glass | :danger :classic Visual style for the frame and header.
title (slot) slot Dialog title area.
footer (slot) slot Actions area; place primary action last.
""" end end