ComponentsBaseModal

UI component

BaseModal

BaseModal gives you a reusable dialog shell for confirmation flows, editors, and detail views without tying the content to a specific workflow.

Installation

Install the package in your app.

pnpm add @rapidset/rapidkit

Usage

Import components from the package entrypoint.

import { BaseModal, ButtonVariant } from '@rapidset/rapidkit';

Examples

Preview the component and copy the snippet.

API Reference

Commonly used props at a glance.

PropDescription
isOpenControls whether the dialog is currently shown.
onCloseCloses the dialog from escape, overlay, or button actions.
title and descriptionAdds a clear heading and supporting context for the dialog content.
onSave and onCancelWires the default footer actions without custom markup.
customButtonsAdds extra footer actions when your flow needs more than save and cancel.
preventOutsideCloseKeeps the dialog open when the surrounding workflow should not be dismissed accidentally.

Accessibility

The dialog uses accessible modal primitives for focus trapping, escape handling, and announced title and description content.

Optional access rules

Optional access props let you hide the dialog entirely or gate save and custom actions without moving that logic into the modal itself.