1.0.6 • Published 12 months ago

romch-modal-library v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

romch-modal-library

A simple customizable modal component for react application.

Table of Content

Features

  • Customizable: Style the modal for different usecases (success, warning, danger, info).
  • Lightweight

Installation

# Using npm:
npm install romch-modal-library

Usage

import React, { useState } from 'react';
import Modal from 'romch-modal-library'

function App() {
 const [isOpen, setIsOpen] = useState(false);

 <Modal
  type="success"
  title="Add title"
  isOpen={isOpen}
  onClose={() => setIsClosed(false)}
 >
   Content here!
 <Modal />
 }

export default App;

Props

PropTypeDescriptionRequiredDefault
isOpenbooleanControls the visibility of the modal.Yes
onClosefunctionCallback function invoked to request closing the modal (e.g., when Xmark is pressed or ESC is pressed).Yes
titlestringTitleNo
childrenReactNodeElements to be rendered inside the modal.Yes
1.0.2

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.1

12 months ago

1.0.0

1 year ago