Modal

Dialog overlay for confirmations and focused tasks. Figma V8.0: Stacked / Horizontal × Default / Warning / Destructive, Desktop + Mobile breakpoints.

import{ Modal } from "@pepulux/ui"

Type: Stacked left aligned (default)

Type: Horizontal

Color: Warning — stacked + horizontal

Destructive: True — stacked + horizontal

Color: Success

Header: Center aligned

Header: With maximize button

Actions: Vertical fill container

Actions: Horizontal right aligned (checkbox)

Actions: divider=false

With custom content (children)

Props

PropTypeDefaultDescription
open*boolean—Controls modal visibility
onClose*() => void—Called when backdrop or × is clicked
title*string—Modal heading
descriptionReactNode—Supporting text below the title
variant"stacked" | "horizontal""stacked"Figma Header Type — Stacked (icon above text) | Horizontal (icon beside text)
align"left" | "center""left"Figma Header Type — Left aligned | Center aligned. Only applies when variant="stacked"
showMaximizebooleanfalseFigma Header — shows an expand/fullscreen button next to the close button
onMaximize() => void—Called when the maximize button is clicked
color"default" | "success" | "warning" | "error" | "brand""default"Figma color — controls featured icon color
destructivebooleanfalseFigma Destructive=True — shorthand for color=error + red primary button
actionsLayout"horizontal" | "vertical" | "spread""horizontal"Figma Actions Type — Horizontal fill container | Vertical fill container | Horizontal right aligned (checkbox)
dividerbooleantrueFigma Actions "divider" — shows the divider line above the footer actions
primaryActionModalAction—{ label, onClick, loading?, disabled? } — main CTA button
secondaryActionModalAction—{ label, onClick, loading?, disabled? } — cancel/secondary button
tertiaryActionModalTertiaryAction—{ label, onClick, icon?, disabled? } — "Settings"-style button, rendered only with actionsLayout="spread"
showDontShowAgainbooleanfalseShows the "Don't show again" checkbox, rendered only with actionsLayout="spread"
dontShowAgainCheckedboolean—Controlled checked state for the "Don't show again" checkbox
onDontShowAgainChange(checked: boolean) => void—Called when the "Don't show again" checkbox changes
dontShowAgainLabelstring"Don't show again"Label text for the "Don't show again" checkbox
childrenReactNode—Custom body content rendered between header and footer
maxWidthstring"400px"Max width of the modal panel
Application component → Modalswww.pepulux.com

Notes and documentation

Space for notes, documentation, and best practices for using these components.

Interrupt only when needed

Use a modal for a decision or focused task that must be completed before continuing. Put the primary action on the right (or bottom on mobile) and make the title say what will happen.

Destructive confirmations use the red primary button and name the thing being deleted.

Do

  • Close on Escape and backdrop click when safe
  • Return focus to the trigger when closed

Don't

  • Open a modal from another modal