@sineverba/feedback
v0.1.0
Published
Renders a simple box with contextual advice to use in React projects
Downloads
8
Readme
Feedback
| CI / CD | Status | | ------- | ------ | | NPM | | | Semaphore CI | | | Circle CI | | | Coverall | | | SonarCloud | |
Feedback
renders a simple box with contextual advice to use in React projects.
Inspired by react-bootstrap Alert
.
Installation
npm install @sineverba/feedback
Usage
import {Feedback} from "@sineverba/feedback";
export const App = () => {
return (
<Feedback />
{/* It shows a success message "Operazione eseguita con successo" */}
<Feedback message="great job!" />
{/* It shows a success message "great job!" */}
<Feedback isError />
{/* It shows an error message "Si è verificato un errore" */}
<Feedback isError message="oh no!" />
{/* It shows an error message "Oh no!" */}
)
}:
export default App;
Props
| Name | Type | Default value |
| ---- | ---- | ------------- |
| message | string | Operazione eseguita con successo (if isError
is false) or Si è verificato un errore (if isError
is true) |
| isError | boolean | false |
Tests
npm run test
for simple test
npm run cover
for coverage