Giter Club home page Giter Club logo

mui-react-modal's Introduction

mui-react-modal

Creating a Custom Modal and Dialog Component with MUI (Material-UI) in React for Enhanced User Experience.

Install

Using npm

npm i mui-react-modal

Using yarn

yarn add mui-react-modal

Basic Usage

import React, { useState } from 'react';
import { Modal } from 'mui-react-modal';
import { Button } from '@mui/material';

export default function Test() {
    const [open, setOpen] = useState(false);

    const handleModal = () => setOpen(!open);

    const modalAction = <Button variant='outlined' size='small'>Save</Button>
    
    return (
        <>
            <Button onClick={handleModal}>Open Modal</Button>
            <Modal
                open={open}
                title={"Modal heading"}
                description={"Modal description."}
                close={handleModal}
                action={modalAction}
                actionPosition="right"
            />
        </>
    )
}

API & Supported parameters

Property Type Default Required Description
open Boolean false true Controls whether the modal is open or closed.
close Function null false A function to close the modal.
title String || Element null false Show modal title.
description String || Element null false Show modal description.
action Element null false The element to be used as the modal's action button(s).
closeIcon Boolean true false Determines whether the modal close icon is visible.
customStyle Object Object false A style object that allows customization of the modal's default style.
actionPosition String left false The position of the action element(s) within the modal. Supported values are "left" "center"and"right".
modalRootClass String null false A CSS class name to modify the default style of the modal root.
closeIconRootClass String null false A CSS class name to modify the default style of the close icon.
titleRootClass String null false A CSS class name to modify the default style of the modal title.
descriptionRootClass String null false A CSS class name to modify the default style of the modal description.
actionRootClass String null false A CSS class name to modify the default style of the modal action element(s).
closeOnBackgroundCheck Boolean true false Make it false if you don't want to close modal on outside check or background check.

Upcoming Features

We're actively working on improving the library to better meet your needs.Here are some of the upcoming features you can look forward to:

  • [ Dialog Box] A new dialog box feature that allows you to display custom content in a styled dialog. You will be able to customize the title, content, actions, and appearance of the dialog box to suit your needs.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug fixes, feel free to open an issue or submit a pull request.

mui-react-modal's People

Contributors

rakeshkumawat1 avatar bahadurpratap avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.