2.1.9 • Published 7 months ago

@semiorbit/react-ui-tools v2.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Semiorbit React UI Tools

useAlert()

React hook that utilize material-ui Alert component to easily prompt messages to user interface.

Usage

import React from 'react';
import useAlert from "@semiorbit/react-ui-tools/Alert/useAlert";

const MyView = props => {

    const alert = useAlert();

    alert.error('Connection Failed');

    return (
        <div>
            Some content here!
            <form>
                <input type="text" />
                ...etc
            </form>
            {alert.show()}
        </div>
    );
    
};

export default MyView;

Reference

MethodDescription
alert.error(msg)Build error message
alert.warning(msg)Build warning message
alert.info(msg)Build info message
alert.success(msg)Build success message
alert.show()Output alert
alert.set(msg, severity)Build message and assign severity which is 'success' by default.
alert.global(msg, severity)Assign global message that can be displayed in another component, by just calling alert.show()
alert.clearGlobal()Clear global message
alert.isClosed()Boolean. Check if the user closed the alert.
alert.onClose(handler)Pass function or event handler to be fired when user closes alert.

useMobileView

A shortcut for useMediaQuery(theme.breakpoints.down(breakpoint)) in MUI

Usage

import useAlert from "@semiorbit/react-ui-tools/Containers/Grid/useAlert";

const isMobileView = useMobileView('sm');

if (isMobileView) {
 // something ...
}

License

MIT

2.1.2

7 months ago

2.1.1

7 months ago

2.0.16

7 months ago

2.1.4

7 months ago

2.1.3

7 months ago

2.1.6

7 months ago

2.1.5

7 months ago

2.0.12

7 months ago

2.1.8

7 months ago

2.1.7

7 months ago

2.1.0

7 months ago

2.1.9

7 months ago

2.0.19

7 months ago

2.0.18

7 months ago

1.3.15

3 years ago

1.3.13

3 years ago

1.3.14

3 years ago

1.3.12

3 years ago

1.3.10

3 years ago

1.3.11

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.2

3 years ago

1.2.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago