error-message-tal
v1.0.4
Published
React component for showing error/success messages in your webpage
Downloads
4
Maintainers
Readme
Error-Message
this package contains error message components and all country codes component
how to install?
npm
npm i error-message-tal
yarn
yarn add error-message-tal
Few things to keep in mind while using it
The error message can be a
string
or anarray
, but the success prop should always be astring
If you are using
className
then theerrorStyle/messageStyle
prop won't work.
how to use country code component?
import {Country_Code} from 'error-message-tal'
function App() {
return (
<div>
<label>Select Country code</label>
<select
name="Country code"
className="select">
<Country_Code />
</select>
</div>
);
}
how to use the error-message component?
import { ErrorMessage } from "error-message-tal";
function App() {
const [success, setSuccess] = useState('yeah! its working');
const [error, seterror] = useState('');
return (
<div>
<ErrorMessage success={success} error={error}/>
</div>
);
}
props for error-message component
error, success, errorStyle, messageStyle, errorClass, messageClass,
| props | type | default | required | ------------- | ------------- | -------- | -------- | | success | string | string | true | error | string/array | array | true | errorStyle | Style(obj) | | false | messageStyle | Style(obj) | | false | errorClass | className(string) | null | false | messageClass | className(string) | null | false