Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 677
Button API alignment#2893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Button API alignment #2893
Changes from all commits
c5d5d5dce151b7b09569dfa46713e88348124960bbdf4ca84cff1ce8526cdf190f82419925d0c1b28ee6d189074333deb532217f1b9b9a0e43d1226f5b93c88d2fea3206833943a76496e555d8d32f2ccad7a6e8e5b92011a4db9cf53c55aacdd42df9bbce7ea92994de0facffd99baf761b226e1387047b9586dde3dc1cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@primer/react": major | ||
| --- | ||
| - Changes `leadingIcon` and `trailingIcon` to `leadingVisual` and `trailingVisual` | ||
| - Removes `Button.Counter` as a child component, replacing it with a `count` prop. This change allows us to use the `trailingVisual` slot for counters. | ||
| - Removes the `outline` button variant as we wish to only support `invisible` buttons. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -31,14 +31,6 @@ The `danger` variant of `Button` is used to warn users about potentially destruc | ||
| <Button variant="danger">Danger</Button> | ||
| ``` | ||
| ### Outline button | ||
| The `outline` variant of `Button` is typically used as a secondary button | ||
| ```jsx live | ||
| <Button variant="outline">Outline</Button> | ||
| ``` | ||
| ### Invisible button | ||
| The `invisible` variant of `Button` indicates that the action is a low priority one. | ||
| @@ -68,11 +60,11 @@ It is recommended to use an octicon here. | ||
| ```jsx live | ||
| <> | ||
| <Button leadingIcon={SearchIcon}>Search</Button> | ||
| <Button trailingIcon={SearchIcon} sx={{mt: 2}}> | ||
| <Button leadingVisual={SearchIcon}>Search</Button> | ||
| <Button trailingVisual={SearchIcon} sx={{mt: 2}}> | ||
| Search | ||
| </Button> | ||
| <Button leadingIcon={SearchIcon} trailingIcon={CheckIcon} sx={{mt: 2}}> | ||
| <Button leadingVisual={SearchIcon} trailingVisual={CheckIcon} sx={{mt: 2}}> | ||
| Search | ||
| </Button> | ||
| </> | ||
| @@ -98,17 +90,12 @@ A separate component called `IconButton` is used if the action shows only an ico | ||
| </> | ||
| ``` | ||
| ### Counter component | ||
| ### Button with counter | ||
| A common use case for primer is a button with a counter component which shows the child count value. | ||
| We provide `Button.Counter` as a composite component which requires you to provide a number as child. | ||
| The counter will match the `variant` styles of the parent button. | ||
| To show a count value as a trailing visual inside `Button`, pass a value to the `count` prop. The counter will match the `variant` styles of the parent button. | ||
langermank marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ```jsx live | ||
| <Button> | ||
| Watch | ||
| <Button.Counter>1</Button.Counter> | ||
| </Button> | ||
| <Button count="1">Watch</Button> | ||
| ``` | ||
| ### Block button | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.