toast message in reactstarp

Solutions on MaxInterview for toast message in reactstarp by the best coders in the world

showing results for - "toast message in reactstarp"
Sofie
01 Jun 2017
1/* eslint react/no-multi-comp: 0, react/prop-types: 0 */
2
3import React, { useState } from 'react';
4import { Button, Toast, ToastBody, ToastHeader } from 'reactstrap';
5
6const ToastDismissExample = (props) => {
7  const { buttonLabel } = props;
8  const [show, setShow] = useState(false);
9
10  const toggle = () => setShow(!show);
11
12  return (
13    <div>
14      <Button color="primary" onClick={toggle}>{buttonLabel}</Button>
15      <br />
16      <br />
17      <Toast isOpen={show}>
18        <ToastHeader toggle={toggle}>Toast title</ToastHeader>
19        <ToastBody>
20          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.
21        </ToastBody>
22      </Toast>
23    </div>
24  );
25}
26
27export default ToastDismissExample;
28
Anabelle
17 Jan 2017
1import React from 'react';
2import { Toast, ToastBody, ToastHeader } from 'reactstrap';
3
4const Example = (props) => {
5  return (
6    <div>
7      <div className="p-3 my-2 rounded">
8        <Toast>
9          <ToastHeader>
10            Reactstrap
11          </ToastHeader>
12          <ToastBody>
13            This is a toast on a white background — check it out!
14          </ToastBody>
15        </Toast>
16      </div>
17      <div className="p-3 my-2 rounded bg-docs-transparent-grid">
18        <Toast>
19          <ToastHeader>
20            Reactstrap
21          </ToastHeader>
22          <ToastBody>
23            This is a toast on a gridded background — check it out!
24          </ToastBody>
25        </Toast>
26      </div>
27      <div className="p-3 bg-primary my-2 rounded">
28        <Toast>
29          <ToastHeader>
30            Reactstrap
31          </ToastHeader>
32          <ToastBody>
33            This is a toast on a primary background — check it out!
34          </ToastBody>
35        </Toast>
36      </div>
37      <div className="p-3 bg-secondary my-2 rounded">
38        <Toast>
39          <ToastHeader>
40            Reactstrap
41          </ToastHeader>
42          <ToastBody>
43            This is a toast on a secondary background — check it out!
44          </ToastBody>
45        </Toast>
46      </div>
47      <div className="p-3 bg-success my-2 rounded">
48        <Toast>
49          <ToastHeader>
50            Reactstrap
51          </ToastHeader>
52          <ToastBody>
53            This is a toast on a success background — check it out!
54          </ToastBody>
55        </Toast>
56      </div>
57      <div className="p-3 bg-danger my-2 rounded">
58        <Toast>
59          <ToastHeader>
60            Reactstrap
61          </ToastHeader>
62          <ToastBody>
63            This is a toast on a danger background — check it out!
64          </ToastBody>
65        </Toast>
66      </div>
67      <div className="p-3 bg-warning my-2 rounded">
68        <Toast>
69          <ToastHeader>
70            Reactstrap
71          </ToastHeader>
72          <ToastBody>
73            This is a toast on a warning background — check it out!
74          </ToastBody>
75        </Toast>
76      </div>
77      <div className="p-3 bg-info my-2 rounded">
78        <Toast>
79          <ToastHeader>
80            Reactstrap
81          </ToastHeader>
82          <ToastBody>
83            This is a toast on an info background — check it out!
84          </ToastBody>
85        </Toast>
86      </div>
87      <div className="p-3 bg-dark my-2 rounded">
88        <Toast>
89          <ToastHeader>
90            Reactstrap
91          </ToastHeader>
92          <ToastBody>
93            This is a toast on a dark background — check it out!
94          </ToastBody>
95        </Toast>
96      </div>
97      <div className="p-3 my-2 rounded" style={{ background: 'black' }}>
98        <Toast>
99          <ToastHeader>
100            Reactstrap
101          </ToastHeader>
102          <ToastBody>
103            This is a toast on a black background — check it out!
104          </ToastBody>
105        </Toast>
106      </div>
107    </div>
108  );
109};
110
111export default Example;
112