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

Function Example

stories/examples/InputGroup/Button.js:12–58  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

10} from 'reactstrap';
11
12function Example(props) {
13 const [dropdownOpen, setDropdownOpen] = useState(false);
14 const [splitButtonOpen, setSplitButtonOpen] = useState(false);
15
16 const toggleDropDown = () => setDropdownOpen(!dropdownOpen);
17
18 const toggleSplit = () => setSplitButtonOpen(!splitButtonOpen);
19
20 return (
21 <div>
22 <InputGroup>
23 <Button>I&lsquo;m a button</Button>
24 <Input />
25 </InputGroup>
26 <br />
27 <InputGroup>
28 <Input />
29 <ButtonDropdown isOpen={dropdownOpen} toggle={toggleDropDown}>
30 <DropdownToggle caret>Button Dropdown</DropdownToggle>
31 <DropdownMenu>
32 <DropdownItem header>Header</DropdownItem>
33 <DropdownItem disabled>Action</DropdownItem>
34 <DropdownItem>Another Action</DropdownItem>
35 <DropdownItem divider />
36 <DropdownItem>Another Action</DropdownItem>
37 </DropdownMenu>
38 </ButtonDropdown>
39 </InputGroup>
40 <br />
41 <InputGroup>
42 <ButtonDropdown isOpen={splitButtonOpen} toggle={toggleSplit}>
43 <Button outline>Split Button</Button>
44 <DropdownToggle split outline />
45 <DropdownMenu>
46 <DropdownItem header>Header</DropdownItem>
47 <DropdownItem disabled>Action</DropdownItem>
48 <DropdownItem>Another Action</DropdownItem>
49 <DropdownItem divider />
50 <DropdownItem>Another Action</DropdownItem>
51 </DropdownMenu>
52 </ButtonDropdown>
53 <Input placeholder="and..." />
54 <Button color="secondary">I&lsquo;m a button</Button>
55 </InputGroup>
56 </div>
57 );
58}
59
60export default Example;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…