Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 677
SegmentedControl variant prop#2164
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.
Changes from all commits
77107939927ea5566af624c394de152293a63f9eb8cc1d9986f213cc1f924b597bc927ff0ffa2cb657272be3b898086767333e9bfd15f9872efe8b08bc3e73b1c7a7667c6df6d524e07e881f0f3cb68f8afabbeeb3d1e82891e357104b6deFile 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,5 @@ | ||
| --- | ||
| '@primer/react': minor | ||
| --- | ||
| Adds support for a responsive 'variant' prop to the SegmentedControl component |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -43,7 +43,7 @@ description: Use a segmented control to let users select an option from a short | ||
| ### With labels hidden on smaller viewports | ||
| ```jsx live drafts | ||
| <SegmentedControl aria-label="File view" variant={{narrow: 'hideLabels', regular: 'none'}}> | ||
| <SegmentedControl aria-label="File view" variant={{narrow: 'hideLabels', regular: 'default'}}> | ||
| <SegmentedControl.Button selected leadingIcon={EyeIcon}> | ||
| Preview | ||
| </SegmentedControl.Button> | ||
| @@ -55,7 +55,7 @@ description: Use a segmented control to let users select an option from a short | ||
| ### Convert to a dropdown on smaller viewports | ||
| ```jsx live drafts | ||
| <SegmentedControl aria-label="File view" variant={{narrow: 'dropdown', regular: 'none'}}> | ||
| <SegmentedControl aria-label="File view" variant={{narrow: 'dropdown', regular: 'default'}}> | ||
| <SegmentedControl.Button selected leadingIcon={EyeIcon}> | ||
| Preview | ||
| </SegmentedControl.Button> | ||
| @@ -161,11 +161,11 @@ description: Use a segmented control to let users select an option from a short | ||
| /> | ||
| <PropsTableRow | ||
| name="variant" | ||
| type="{ | ||
| narrow?: 'hideLabels' | 'dropdown', | ||
| regular?: 'hideLabels' | 'dropdown', | ||
| wide?: 'hideLabels' | 'dropdown' | ||
| type="'default' | { | ||
| narrow?: 'hideLabels' | 'dropdown' | 'default' | ||
| regular?: 'hideLabels' | 'dropdown' | 'default' | ||
| }" | ||
mperrotti marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| defaultValue="'default'" | ||
| description="Configure alternative ways to render the control when it gets rendered in tight spaces" | ||
| /> | ||
| <PropsTableSxRow /> | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking:
hideLabelslooks like a boolean type as opposed todropdownvariant. Wouldn't it be more consistent to useiconsinstead?