2.1.9 • Published 2 years ago
@semiorbit/react-ui-tools v2.1.9
Semiorbit React UI Tools
- A collection of wrappers for Material-ui controls Grid, GridItem, Button, Password, Select, TextField, Checkbox
- Custom UI controls Section, Counter, CheckAdornment
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
Method | Description |
---|---|
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
2 years ago
2.1.1
2 years ago
2.0.16
2 years ago
2.1.4
2 years ago
2.1.3
2 years ago
2.1.6
2 years ago
2.1.5
2 years ago
2.0.12
2 years ago
2.1.8
2 years ago
2.1.7
2 years ago
2.1.0
2 years ago
2.1.9
2 years ago
2.0.19
2 years ago
2.0.18
2 years ago
1.3.15
4 years ago
1.3.13
4 years ago
1.3.14
4 years ago
1.3.12
4 years ago
1.3.10
4 years ago
1.3.11
4 years ago
1.3.9
4 years ago
1.3.8
4 years ago
1.3.7
4 years ago
1.3.6
4 years ago
1.3.2
4 years ago
1.2.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago