Ask Natuna

Ask about the design system

Hi, I am Natuna.

Ask me about the design system: components, tokens, statuses, and how to use them.

Natuna can be wrong. The docs are the source of truth.

Skip to content
  • IntroductionPage
  • Ask NatunaAsk about the design systemPage
  • FoundationColor, type, number, effectPage
  • Components overviewPage
  • ThemesLight and dark modePage
  • NamingProperty and page namesPage
  • Privacy statementPage
  • Text-safe stepsFirst AA and AAA step per color rampSection
  • AccessibilityWCAG 2.2 AAA rulesSection
  • Dark modeThemesSection
  • Using it todayFigma file and React codeSection
  • Component statusDesign status and In ReactSection

Arrow keys to move, Enter to open, Esc to close.

Modal

A dialog that interrupts the current context to focus the user on a task.

Status
ReadyBuild day 15 of 21
Code
In React
Role
Overlay

Usage

This demo is live, and the code below it is the same code, imports included. The component lives in src/ui of this repository and is not published to npm yet.

Remove saved account?

“Andi Pratama” will be removed from your saved accounts.

Pastes as editable layers. Shadows are not exported.

import { useState } from "react";
import { Button, Modal } from "@/ui";

export default function ModalDemo() {
  const [open, setOpen] = useState<boolean>(false);

  return (
    <>
      <Button variant="destructive" onClick={() => setOpen(true)}>Remove saved account</Button>
      <Modal
        open={open}
        onClose={() => setOpen(false)}
        title="Remove saved account?"
        description="“Andi Pratama” will be removed from your saved accounts."
        footer={<Button variant="destructive" onClick={() => setOpen(false)}>Remove</Button>}
      />
    </>
  );
}

Variants and states

Every specimen is the real component from src/ui, held in one state.

These are the dialog box on its own. Modal adds the backdrop, the focus trap, and Escape.

type confirmationsize sm

Remove saved account?

“Andi Pratama” will be removed from your saved accounts.
type formsize sm

Remove saved account?

“Andi Pratama” will be removed from your saved accounts.
Form content
type alertsize sm

Remove saved account?

“Andi Pratama” will be removed from your saved accounts.
size md, lg, xl560, 720, 960 wide, never wider than the screen

Remove saved account?

“Andi Pratama” will be removed from your saved accounts.

Remove saved account?

“Andi Pratama” will be removed from your saved accounts.

Remove saved account?

“Andi Pratama” will be removed from your saved accounts.

Pastes as editable layers. Shadows are not exported.

Props

open, onClose
boolean, () => void · default none
Required on Modal. onClose runs for the close button, the backdrop, and Escape.
title
string · default none
Required. Names the dialog.
description
ReactNode · default none
type
"confirmation" | "form" | "alert" · default "confirmation"
Alert adds a warning icon.
size
"sm" | "md" | "lg" | "xl" · default "sm"
400, 560, 720, 960 wide.
children
ReactNode · default none
The body, such as form fields.
footer
ReactNode · default none
Buttons, right aligned.
ModalPanel
component · default none
The box on its own, for documentation.

Figma to code

Figma properties by their exact names from Naming, and the React prop that carries each one. The table covers the shared properties that bear on this component; the Figma file decides which of them its component exposes. None means there is no prop for it yet.

🧰 Type
type
confirmation, form, or alert.
📐 Size
size
sm to xl.
Show Close
onClose
On ModalPanel, pass onClose.
Title, Show Description, Description
title, description
Same.
Show Button
footer
Pass your buttons.

Accessibility

What the code in src/ui does today, and what it leaves to you.

Keyboard

  • A native dialog: focus moves in, Tab stays inside, Escape closes, and focus returns to the trigger.

Screen readers

  • Named by its title. The page behind is inert.

What you still need to do

  • One primary action. A destructive one uses the destructive Button and a clear verb, such as Remove.
  • For something that is not critical, use a Drawer or the page itself.

When to use

Focused tasks, confirmations, and critical information that needs immediate attention.

Do and don't

Do

  • Provide a clear way to dismiss (close button, escape key, backdrop click).
  • Keep content focused on a single task.

Don't

  • Stack multiple modals on top of each other.
  • Use for content that could be a regular page or panel.

4 of 28 other molecules, same role and ready ones first.

See all components

Status reflects the component tracker snapshot of 29 October 2026.