npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@synerise/ds-modal

v0.17.48

Published

Modal UI Component for the Synerise Design System

Downloads

1,066

Readme


id: modal title: Modal

Modal UI Component

The Modal component provides a flexible and customizable way to display modal dialogs in your React applications. It offers various options and configurations to control the appearance and behavior of the modal dialogs.

Demo

Installation

Install the Modal component using npm:

npm install @synerise/ds-core

Deprecated Features

Some features of the Modal component have been deprecated. Please refer to the API and FOOTER section for more information on deprecated features.

API

(Deprecated) type Props is deprecated - recommended is using ModalProps

ModalProps

| Property | Description | Type | Default | Version | |---------------------|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|-------------------------------------------------| ------- | | description | The modal dialog's description | string | - | | headerActions | Append additional content to header actions space | React.ReactNode | - | | size | The modal size | small / medium / large / extraLarge/ fullSize. | - | | bodyBackground | Set color for body of modal | white / grey | white | | blank | Modal with header which contains only close button | Boolean | false | | titleContainerStyle | The modal title's container styles object | React.CSSProperties / undefined | - | | settingButtonText | Text of the setting button | string | Setting | | texts | Labels to render | { okButton: string; cancelButton: string } | { okButton: 'Apply', cancelButton: 'Cancel' } | | children | Children element to render | { okButton: string; cancelButton: string } | - | | visible | Whether the modal dialog is visible or not | boolean | false | | confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | false | | title | The modal dialog's title | string / ReactNode | - | | closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | true | | onOk | Specify a function that will be called when a user clicks the OK button | function(e) | - | | onCancel | Specify a function that will be called when a user clicks mask, close button on top right or Cancel button | function(e) | - | | afterClose | Specify a function that will be called when modal is closed completely. | function | - | | centered | Centered Modal | Boolean | false | | width | Width of the modal dialog | string / number | 520 | | footer | Footer content, set as footer={null} when you don't need default buttons | ReactNode | OK and Cancel buttons | | okText | Text of the OK button | string / ReactNode | OK | | okType | Button type of the OK button | string | primary | | cancelText | Text of the Cancel button | string / ReactNode | Cancel | | maskClosable | Whether to close the modal dialog when the mask (area outside the modal) is clicked | boolean | true | | forceRender | Force render Modal | boolean | false | | okButtonProps | The ok button props | ButtonProps | - | | cancelButtonProps | The cancel button props | ButtonProps | - | | destroyOnClose | Whether to unmount child components on onClose | boolean | false | | style | Style of floating layer, typically used at least for adjusting the position. | object | - | | wrapClassName | The class name of the container of the modal dialog | string | - | | getContainer | Return the mount node for Modal | HTMLElement / () => HTMLElement / Selectors /false | document.body | | zIndex | The z-index of the Modal | Number | 1000 | | bodyStyle | Body style for modal body element. Such as height, padding etc. | object | {} | | mask | Whether show mask or not. | Boolean | true | | closeIcon | custom close icon | ReactNode | - | | maskStyle | Style for modal's mask element. | object | {} |

and it is extended by props for ModalFooterBuilder:

| Property | Description | Type | Default | Version | |----------------|--------------------------------------------------------------|-----------------------|---------| ------- | | prefix | Element in footer, before Cancel Button | ReactNode | - | | infix | Element in footer between Cancel Button nad before Ok Button | ReactNode | - | | suffix | Element in footer, after Ok Button | ReactNode | - | | okButton | Custom OK button in footer | ReactNode | - | | cancelButton | Custom Cancel button in footer | ReactNode | - |

ModalTitle

type ModalTitleProps = Pick<
  ModalProps,
  | 'headerActions' 
  | 'onCancel' 
  | 'titleContainerStyle' 
  | 'blank' 
  | 'description' 
  | 'title'
>;

ModalFooter

export type ModalFooterProps = Pick<
  ModalProps,
  | 'prefix'
  | 'infix'
  | 'suffix'
  | 'okButton'
  | 'cancelButton'
  | 'CustomFooterButton'
  | 'DSButton'
  | 'texts'
  | 'onOk'
  | 'onCancel'
  | 'cancelText'
  | 'okText'
  | 'cancelButtonProps'
  | 'okType'
  | 'okButtonProps'
>;

(Deprecated) method buildModalFooter - use ModalFooter Component instead