You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-core/src/components/Button/examples/Button.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,13 @@ Stateful buttons are ideal for displaying the state of notifications. Use `varia
125
125
```ts file="./ButtonStateful.tsx"
126
126
```
127
127
128
+
### Favorite
129
+
130
+
You can pass both the `isFavorite` and `variant="plain"` properties into the `<Button>` to create a favorite button. Passing the `isFavorited` property will determine the current favorited state and update styling accordingly.
131
+
132
+
```ts file = "./ButtonFavorite.tsx"
133
+
```
134
+
128
135
## Using router links
129
136
130
137
Router links can be used for in-app linking in React environments to prevent page reloading. To use a `Link` component from a router package, you can follow our [custom component example](#custom-component) and pass a callback to the `component` property of the `Button`:
@@ -133,4 +140,4 @@ Router links can be used for in-app linking in React environments to prevent pag
0 commit comments