1.0.6 β€’ Published 3 years ago

@reaxio/modal v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

MODAL PORTAL Reaxio

An Introduction

React component, easy, simple, small and improved, this is MODAL PORTAL

When To Use

When requiring users to interact with the application, but without jumping to a new page and interrupting the user's workflow, you can use MODAL PORTAL to create a new floating layer over the current page to get user feedback or display information.

Why Should You Use This?

Many of the components for Reactjs are in a single installation, not only the component you need and in many cases very heavy, but this is ideal for:

  1. Quick and easy loading and small
  2. They don't inject extra javascript and DOM elements into your page, making it slower.
  3. Easy to customize enough to adapt to the design of your site.
  4. Reaxion MODAL PORTAL, takes up very little space, specific and simple for your project.
  5. It can be customized in any way.

πŸ“¦ Install

npm i @reaxio/modal

πŸ”¨ Usage

import {useState} from 'react';
import ModalPortal from "@reaxio/modal";

const App = () => {

	const [state,setState] = useState(false);

	const haldlenModalPortal=()=>{
		setState(!state)
	}


	return (
		<>
			<button onClick={haldlenModalPortal} >Open to Modal Portal</button>
			<ModalPortal 
					state={state} 
					title={<small>Title with small HTML 😬</small>}
					onBtnClose={haldlenModalPortal} 
					>
					<h4>Hi!! Here  Portal! is Okey! πŸ˜€ πŸ‘πŸΌ</h4>
			</ModalPortal>
		</>
			)
};

✨ API

PropertyDescriptionTypeDefault
stateWhether the modal dialog is visible or not buttonBooleanfalse
titleThe modal dialog's titlestring or HTMLElement
classNameThe class name of the container of the modal dialogstring
classNameTitleThe class name of the title of the modal dialogstring
classNameBodyThe class name of the Body of the modal dialogstring
classNameFooterThe class name of the Footer of the modal dialogstring
classNameBtnOneThe class name of the Button Close of the modal dialog, this button is default in case not config in props, set function onBtnClose for Specify a function that will be called when a user clicks maskstring
nameBtnSet objects for Text of the OK, Cancel ,second and third button, only default Text is Cancelobject*view Note 1
onBtnOkeySpecify a function that will be called when a user clicks the OK buttonfunction(e)
onBtnCloseSpecify a function that will be called when a user clicks the CANCEL or CLOSE buttonfunction(e)
onBtnSecondSpecify a function that will be called when a user clicks the second buttonfunction(e)
onBtnThirdSpecify a function that will be called when a user clicks the third buttonfunction(e)

  • Note 1: This props nameBtn value default is {ok:'',cancel:'CLOSE',secondBtn:'',thirdBtn:''}, only the element "cancel" is default text 'CLOSE'.
  • Note 2: If you want to activate the ok, second or third buttons, the element of the button that is assigned in the object is placed props nameBtn.
  • Note 3: All calls to the props methods close the Modal window, the (e) event is a boolean parameter return false, for state Modal is closed.

πŸ”ΊExamples

Look at our MODAL example in CodeSandox, easy, simple and fast !!!

Thanks for using it. πŸ˜ƒ πŸ‘ŠπŸΌ

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago