Skip to content

Modal

The Modal component is used to display content in a focused overlay layer, helping users complete tasks such as confirmations, forms, or alerts without leaving the current context.

  • Overlay-based UI: Focuses user attention on critical content.
  • Controlled state: Open/close is managed externally via props.
  • Composable structure: Supports header, content, and actions sections.
  • Accessible behavior: Designed for keyboard and interaction safety.
PropTypeDefaultDescription
isOpenbooleanfalseControls whether the modal is visible.
handleClosefunctionCallback executed when the modal requests to close.
PropTypeDefaultDescription
alignstring"left"Controls header content alignment.
classstringOptional additional styles.
stylestringInline style overrides.
PropTypeDefaultDescription
classstringOptional styling for modal body.
stylestringInline style overrides.
PropTypeDefaultDescription
alignstring"right"Aligns action buttons within the footer.
classstringOptional styling for actions container.
stylestringInline style overrides.
  • Keep modal content focused and task-oriented.
  • Always provide a clear way to close the modal (handleClose).
  • Avoid placing too many actions inside Modal.Actions.
  • Use Modal.Header for context and clarity.
  • Ensure keyboard accessibility and proper focus handling.