Skip to content

Modal

Modal

Overlay component for displaying content in a dialog that requires user interaction.

Import

import { ModalComponent } from '@primitivekit/angular';

Basic Usage

<pk-modal>Content</pk-modal>

Props

No props available.

Customization

The Modal component supports CSS variables for complete customization:

<pk-modal [style]="{
  '--modal-bg-color': '#007bff',
  '--modal-text-color': '#ffffff'
}">Custom</pk-modal>

Design Tokens

The following design tokens are available for customization:

  • --modal-overlay-bg-color
  • --modal-overlay-opacity
  • --modal-overlay-backdrop-filter
  • --modal-overlay-z-index
  • --modal-overlay-animation-duration
  • --modal-overlay-animation-timing
  • --modal-bg-color
  • --modal-color
  • --modal-border-radius
  • --modal-border-width
  • … and 57 more

Accessibility

The Modal component is fully accessible and follows WCAG 2.1 AA standards:

  • ✅ Semantic HTML elements
  • ✅ Keyboard accessible
  • ✅ Focus visible indicator
  • ✅ Proper ARIA attributes
  • ✅ Screen reader compatible
  • ✅ Touch target size (44x44px minimum)
  • ✅ Color contrast compliance

Keyboard Navigation

KeyAction
TabMove focus to/from component

| Escape | Close component |

Related Components

  • Drawer - Overlay component for displaying a sliding panel from the edge of the screen.
  • Tooltip - Overlay component for displaying helpful information when hovering over an element.
  • Popover - Overlay component for displaying rich content in a floating panel triggered by user interaction.
  • Dropdown - Overlay component for displaying a menu or list of options triggered by a button.

See Also