JSPM

@workday/canvas-kit-react-modal

3.0.0-alpha.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 77
  • Score
    100M100P100Q82131F
  • License Apache-2.0

Modal to display a popup with a translucent background

Package Exports

  • @workday/canvas-kit-react-modal

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@workday/canvas-kit-react-modal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Canvas Kit Modal

A Modal component that allows you to render a Popup with translucent overlays.

Installation

yarn add @workday/canvas-kit-react

or

yarn add @workday/canvas-kit-react-modal

Usage

import * as React from 'react';
import {Modal} from '@workday/canvas-kit-react-modal';

<Modal open width={Modal.Width.m} heading={'Modal Title'} handleClose={this.handleClose}>
  {this.props.children}
</Modal>;

Static Properties

Width: ModalWidth

<Modal width={Modal.Width.m} heading={'Modal Title'} handleClose={this.handleClose} />

Component Props

Required

None


Optional

open: boolean

Allows you to open/close modal

Default: false

width: ModalWidth

You can choose between s or m for your modal width

Default: ModalWidth.s

Name Size (px)
s 440
m 800

padding: PopupPadding

You can choose between zero, s, l for your padding

Default: PopupPadding.l

Name Size (px)
zero 0
s 16
l 32

handleClose: () => void

Callback to handle close of your Modal and any other event when the Modal is closed.


transformOrigin: TransformOrigin

Origin from which the popup will animate from

Default:

{
  horizontal: 'center',
  vertical: 'top',
}

heading: ReactNode

Heading at the top of the card.