Saltar al contenido

ejemplo de código de notificación reactstrap toast

Ejemplo 1: mensaje de brindis en reactstarp

importReactfrom'react';importToast,ToastBody,ToastHeaderfrom'reactstrap';constExample=(props)=>return(<div><div className="p-3 my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a white background — check it out!</ToastBody></Toast></div><div className="p-3 my-2 rounded bg-docs-transparent-grid"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a gridded background — check it out!</ToastBody></Toast></div><div className="p-3 bg-primary my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a primary background — check it out!</ToastBody></Toast></div><div className="p-3 bg-secondary my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a secondary background — check it out!</ToastBody></Toast></div><div className="p-3 bg-success my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a success background — check it out!</ToastBody></Toast></div><div className="p-3 bg-danger my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a danger background — check it out!</ToastBody></Toast></div><div className="p-3 bg-warning my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a warning background — check it out!</ToastBody></Toast></div><div className="p-3 bg-info my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on an info background — check it out!</ToastBody></Toast></div><div className="p-3 bg-dark my-2 rounded"><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a dark background — check it out!</ToastBody></Toast></div><div className="p-3 my-2 rounded" style= background:'black'><Toast><ToastHeader>Reactstrap</ToastHeader><ToastBody>This is a toast on a black background — check it out!</ToastBody></Toast></div></div>);;exportdefaultExample;

Ejemplo 2: mensaje de brindis en reactstarp

/* eslint react/no-multi-comp: 0, react/prop-types: 0 */importReact, useState from'react';importButton,Toast,ToastBody,ToastHeaderfrom'reactstrap';constToastDismissExample=(props)=>const buttonLabel = props;const[show, setShow]=useState(false);consttoggle=()=>setShow(!show);return(<div><Button color="primary" onClick=toggle>buttonLabel</Button><br /><br /><Toast isOpen=show><ToastHeader toggle=toggle>Toast title</ToastHeader><ToastBody>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</ToastBody></Toast></div>);exportdefaultToastDismissExample;

Comentarios y calificaciones

Nos puedes añadir valor a nuestro contenido informacional aportando tu veteranía en las acotaciones.

¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *