Skip to content
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

docs/buttons: edit styleguide #1432

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

docs/buttons: edit styleguide #1432

wants to merge 3 commits into from

Conversation

bettiifr
Copy link
Collaborator

The styleguide for the buttons is improved here

Copy link

changeset-bot bot commented Aug 14, 2024

⚠️ No Changeset found

Latest commit: ce6d738

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

Report of strictNullChecks (strictPropertyInitialization) check

Typescript check

Total errors are the same in both branches

ESLint check

Total ESLint warnings are the same in both branches

- **Secondary button:** The secondary button variant has a grayscale appearance to distinguish it from the primary button.
- **Danger button:** We use the danger button variant to emphasize particularly dangerous, destructive or critical actions that cannot easily be undone. Consider this especially in confirmation dialogs.
- **Primary:** Has a solid background in the primary color. We typically use primary buttons for the most important or most-likely next action within the UI.
- **Secondary:** Has a transparent background in the secondary color. We typically use secondary buttons for standard actions that need to be easily recognizable or for actions supporting the default (primary) action.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description is the same as for the Outline option ("for standard actions actions... supporting the primary action". In Figma the Secondary button is described as "Use for special usecases when other button types catch too much attention". The whole primary/secondary topic is highly confusing, we should spend a paragraph and an illustration on that.

- **Cluster buttons:** Buttons can be clustered in groups based on their relationship. A cluster can contain a mixture of buttons, e.g. a combination of a primary button with two primary ghost buttons. We recommend a minimum distance of `0.5rem` between adjacent buttons, and we typically cluster buttons if actions/functions are related but not excluding each other. Otherwise, consider using a `button group`.
- **Button width:** Button width depends on its content. In addition, buttons have a default minimum width of 5rem to lay out common combinations such as "OK" and "Cancel" more harmoniously with equal widths. The minimum width is customizable to accommodate other combinations.
- **Alignment:** Buttons can be left- or right-justified or fully span a container’s width.
- **Cluster buttons:** Cluster buttons in groups with related functions. A cluster might include various types of buttons, e.g. a primary and secondary ghost button. We recommend a gap of `0.5rem` between buttons.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would give an example that shows the intended use of primary and primary outline ("primary and secondary in UX context").

Copy link
Collaborator

@flxlst09 flxlst09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor things regarding vocabulary. Biggest topic is whether we can provide a better explanation in regard of the Primary vs Secondary confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants