Skip to content

Commit 59a06cb

Browse files
authored
docs(button): improve basic button example with state toggle (#5368)
1 parent 5c992dd commit 59a06cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

documentation-site/examples/button/basic.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@ import * as React from "react";
22
import { Button } from "baseui/button";
33

44
export default function Example() {
5-
return <Button onClick={() => alert("thank you 🙂")}>Click me!</Button>;
5+
const [clicked, setClicked] = React.useState(false);
6+
7+
return (
8+
<Button onClick={() => setClicked(!clicked)}>
9+
{clicked ? "Clicked!" : "Click me"}
10+
</Button>
11+
);
612
}

0 commit comments

Comments
 (0)