-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ghost vs. Secondary Buttons #15
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,49 +99,56 @@ storiesOf('Breadcrumb', module) | |
))); | ||
|
||
storiesOf('Buttons', module) | ||
.add('Primary Button', withInfo('')(() => ( | ||
.add('Primary Button', withInfo('Buttons set an action in motion. Instead of using “Yes” or “Okay”, it’s better to use verbs that explain what the triggered action will be. For example, “Create new”, “Discard draft”, etc. Use the primary button when it’s the main action on a page/table. Use the smaller one in case of limited space.')(() => ( | ||
<div> | ||
<Button bsStyle="primary" onClick={action('clicked')}>{'Primary Button'}</Button> | ||
<Button bsSize="small" bsStyle="primary" onClick={action('clicked')}>{'Primary Small Button'}</Button> | ||
</div> | ||
))) | ||
|
||
.add('Secondary Button', withInfo('')(() => ( | ||
.add('Default Button', withInfo('Default buttons are used for secondary actions. They’re usually paired with a primary button to provide an alternate choice.')(() => ( | ||
<div> | ||
<Button bsStyle="secondary" onClick={action('clicked')}>{'Secondary Button'}</Button> | ||
<Button bsSize="small" bsStyle="secondary" onClick={action('clicked')}>{'Secondary Small Button'}</Button> | ||
<Button bsStyle="default" onClick={action('clicked')}>{'Default Button'}</Button> | ||
<Button bsSize="small" bsStyle="default" onClick={action('clicked')}>{'Default Small Button'}</Button> | ||
</div> | ||
))) | ||
|
||
.add('Warning Button', withInfo('')(() => ( | ||
.add('Ghost Button', withInfo('Use ghost buttons to reduce visual clutter on the screen. Take care that the actions via a ghost button are not primary actions.')(() => ( | ||
<div> | ||
<Button bsStyle="secondary" onClick={action('clicked')}>{'Ghost Button'}</Button> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Bootstrap v4 ghost buttons seem to correspond with outline buttons (I guess they're interchangeable): https://getbootstrap.com/docs/4.0/components/buttons/#outline-buttons. So #18 changes this to use those instead of the secondary style. |
||
<Button bsSize="small" bsStyle="secondary" onClick={action('clicked')}>{'Small ghost Button'}</Button> | ||
</div> | ||
))) | ||
|
||
.add('Warning Button', withInfo('Just when you need to nudge the user’s attention to make sure they know it’s not another ordinary action, use the warning button.')(() => ( | ||
<div> | ||
<Button bsStyle="warning" onClick={action('clicked')}>{'Warning Button'}</Button> | ||
<Button bsSize="small" bsStyle="warning" onClick={action('clicked')}>{'Warning Small Button'}</Button> | ||
</div> | ||
))) | ||
|
||
.add('Danger Button', withInfo('')(() => ( | ||
.add('Danger Button', withInfo('When the primary action is “negative” or irreversible, make use of the danger button to warn the user. For example, “Delete”, “Erase”, “Discard”, “Remove”, etc.')(() => ( | ||
<div> | ||
<Button bsStyle="danger" onClick={action('clicked')}>{'Danger Button'}</Button> | ||
<Button bsSize="small" bsStyle="danger" onClick={action('clicked')}>{'Danger Small Button'}</Button> | ||
</div> | ||
))) | ||
|
||
.add('Success Button', withInfo('')(() => ( | ||
.add('Success Button', withInfo('The “Yay, you did it!” button. Use them for highlighting “positive” actions like “Submit”.')(() => ( | ||
<div> | ||
<Button bsStyle="success" onClick={action('clicked')}>{'Success Button'}</Button> | ||
<Button bsSize="small" bsStyle="success" onClick={action('clicked')}>{'Success Small Button'}</Button> | ||
</div> | ||
))) | ||
|
||
.add('Set of Buttons', withInfo('')(() => ( | ||
.add('Set of Buttons', withInfo('To make clear a distinction between two options, sometimes it’s better to use different visual weights for buttons.')(() => ( | ||
<div> | ||
<Button bsStyle="secondary" onClick={action('clicked')}>{'Secondary Button'}</Button> | ||
<Button bsStyle="default" onClick={action('clicked')}>{'Secondary Button'}</Button> | ||
<Button bsStyle="primary" onClick={action('clicked')}>{'Primary Button'}</Button> | ||
</div> | ||
))) | ||
|
||
.add('Links', withInfo('')(() => ( | ||
.add('Links', withInfo('Links are typically used as a means of navigation either within the application, to a place outside, or to a resource. For anything else, especially things that change data, you should be using a button.')(() => ( | ||
<div> | ||
<Button bsStyle="link" onClick={action('clicked')}>{'I am a default link'}</Button> | ||
<Button bsSize="xsmall" bsStyle="link" onClick={action('clicked')}>{'I am a small link'}</Button> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Bootstrap v4 has a dedicated "secondary" style (and with that I'm not sure we'd ever use a default button), so I removed this in #18. If we do think a button with no set style is useful we could add it back, but it'd need a different description at least.