0.1.7 • Published 2 years ago

@dvor77/cpmodal v0.1.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Introduction

This is a simple react modal

Alt text

Installation

To install, you can use npm:

$ npm i @dvor77/cpmodal

Examples

Here is a simple example of react modal being used in an app with some custom styles and focusable input elements within the modal content:

import React from 'react';
import MyModal from '@dvor77/cpmodal';
import { useState } from 'react';



function YourComponent() {
  const [opened, setOpened] = useState(false);
  
  const title = "Congratulations" // Write your own title
  const subtitle = "The form is registered" // Write your own subtitle
  
  // add this function inside your react component to manage the closing of component
  function closeModal() {
    setOpened(false)
  }

  return (
    <div>
      <MyModal opened={opened} closeModal={closeModal} title={title} subtitle={subtitle}/>
    </div>
  );
}

export default YourComponent;
0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago