MCPcopy Create free account
hub / github.com/reactstrap/reactstrap / Example

Function Example

stories/examples/Popover/Focus.js:10–65  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

8} from 'reactstrap';
9
10function Example(props) {
11 return (
12 <div>
13 <Button id="PopoverFocus" type="button">
14 Launch Popover (Focus)
15 </Button>{' '}
16 <Button id="PopoverClick" type="button">
17 Launch Popover (Click)
18 </Button>{' '}
19 <Button id="PopoverLegacy" type="button">
20 Launch Popover (Legacy)
21 </Button>
22 <UncontrolledPopover
23 trigger="focus"
24 placement="bottom"
25 target="PopoverFocus"
26 >
27 <PopoverHeader>Focus Trigger</PopoverHeader>
28 <PopoverBody>
29 Focusing on the trigging element makes this popover appear. Blurring
30 (clicking away) makes it disappear. You cannot select this text as the
31 popover will disappear when you try.
32 </PopoverBody>
33 </UncontrolledPopover>
34 <UncontrolledPopover
35 trigger="click"
36 placement="bottom"
37 target="PopoverClick"
38 >
39 <PopoverHeader>Click Trigger</PopoverHeader>
40 <PopoverBody>
41 Clicking on the triggering element makes this popover appear. Clicking
42 on it again will make it disappear. You can select this text, but
43 clicking away (somewhere other than the triggering element) will not
44 dismiss this popover.
45 </PopoverBody>
46 </UncontrolledPopover>
47 <UncontrolledPopover
48 trigger="legacy"
49 placement="bottom"
50 target="PopoverLegacy"
51 >
52 <PopoverHeader>Legacy Trigger</PopoverHeader>
53 <PopoverBody>
54 Legacy is a reactstrap special trigger value (outside of
55 bootstrap&lsquo;s spec/standard). Before reactstrap correctly
56 supported click and focus, it had a hybrid which was very useful and
57 has been brought back as trigger=&ldquo;legacy&ldquo;. One advantage
58 of the legacy trigger is that it allows the popover text to be
59 selected while also closing when clicking outside the triggering
60 element and popover itself.
61 </PopoverBody>
62 </UncontrolledPopover>
63 </div>
64 );
65}
66
67export default Example;

Callers

nothing calls this directly

Calls 1

PopoverFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…