GitHub
Core
Glass
Brutal
Humanist

Status Modal

StatusModals provide critical information and require user action to proceed. They support four distinct status variants and should be wrapped in a Modal component for proper overlay behavior.

Status Modal Playground

Status Modal Playground
Preview
Code
Controls
Status:
Default
Success
Warning
Destructive
Checkbox:

Installation

You can add the status modal component to your project manually:

1

Install the following dependencies:

npm install class-variance-authority clsx tailwind-merge @phosphor-icons/react @react-aria/focus @react-aria/interactions @react-aria/utils
2

Copy and paste the following code into your project.

Loading source code...
3

Update the import paths to match your project setup.

Update the import aliases (e.g. @/components, @/utils) in the copied files to match your project's path configuration.

Basic Usage

StatusModal is a presentational component that should be wrapped in a Modal for overlay behavior:

import { useState } from 'react';
import { Modal } from '@versaui/ui/components/Modal';
import { StatusModal } from '@versaui/ui/components/Modal';
import { Button } from '@versaui/ui/components/Button';
function Example() {
    const [isOpen, setIsOpen] = useState(false);
    return (
        <>
            <Button onClick={() => setIsOpen(true)}>
                Show Status
            </Button>
            <Modal open={isOpen} onOpenChange={setIsOpen} size="sm">
                <StatusModal
                    status="success"
                    title="Project Published"
                    description="Your project is now live and accessible to your team."
                    confirmText="View Project"
                    cancelText="Dismiss"
                    onConfirm={() => setIsOpen(false)}
                    onCancel={() => setIsOpen(false)}
                />
            </Modal>
        </>
    );
}

Status Variants

Four status variants are available, each with its own color scheme and default icon:

// Default - Informational (purple icon)
<StatusModal status="default" title="Invite Team Members" ... />
// Success - Positive outcome (green icon)
<StatusModal status="success" title="File Uploaded" ... />
// Warning - Caution required (amber icon)
<StatusModal status="warning" title="Storage Limit" ... />
// Destructive - Dangerous action (red icon, red confirm button)
<StatusModal status="destructive" title="Delete Account" ... />

With Checkbox

Show a "Don't show again" checkbox for dismissible notifications:

<StatusModal
    status="default"
    title="New Feature Available"
    description="Check out our new dashboard features."
    showCheckbox={true}
    checkboxLabel="Don't show again"
    checkboxChecked={dontShow}
    onCheckboxChange={setDontShow}
    onConfirm={handleConfirm}
    onCancel={handleCancel}
/>

Custom Icon

Override the default status icon:

import { RocketLaunch } from '@phosphor-icons/react';
<StatusModal
    status="success"
    icon={<RocketLaunch size={24} weight="duotone" />}
    title="Launch Successful"
    description="Your application is now deployed."
    ...
/>

Accessibility

The StatusModal component follows accessibility best practices:

  • Focus management: Focus is trapped within the Modal when open
  • Keyboard navigation: Escape key closes the modal
  • Screen readers: Title and description are announced
  • Button labels: Clear action labels for confirm/cancel

StatusModal Props

PropTypeDefaultDescription
status'default' | 'destructive' | 'success' | 'warning''default'Semantic status variant controlling colors and icon.
titlestringModal title text (required).
descriptionstringDetail text below the title (required).
iconReactNodeCustom icon to override the default status icon.
showCheckboxbooleantrueShow the "Don't show again" checkbox.
checkboxLabelstring'Don\'t show again'Label for the checkbox.
checkboxCheckedbooleanfalseCheckbox checked state.
confirmTextstring'Continue'Confirm button label.
cancelTextstring'Cancel'Cancel button label.
onConfirm() => voidCallback when confirm is clicked.
onCancel() => voidCallback when cancel is clicked.
onCheckboxChange(checked: boolean) => voidCallback when checkbox changes.
classNamestring''Additional CSS classes.

On this page