Buttons: Cheat sheet – Nucleus UI

Let's dive deep into how a design system typically defines a button.

Note that this is not a design system document for Nucleus UI; rather, it's a cheat sheet that will assist you in creating a design system.

Check out Nucleus UI to help jumpstart any UI design project or design system.

Never recreate the same things; focus on what matters.

Learn more

See preview

Button

A button allows people to initiate a specific action or process, such as submitting a form, opening a link, or starting a download. The action is usually clearly communicated through the button’s label (e.g., Save, Cancel, Download).

Check out buttons on Nucleus UI

Anatomy

  1. Container: A rectangle or rounded rectangle that holds the button text or icon.

  2. Label: Descriptive text that communicates what will happen when clicking the button.

  3. Leading icon: An icon, placed before the button label, providing visual context or reinforcing the button’s action. For example:

    1. A magnifying glass icon before "Search" indicates its search functionality,

    2. A plus icon before "Add New" suggests a creation action. These icons are valuable for quick visuals in a limited space.

  4. Trailing icon An icon, placed after the button label, suggesting a subsequent step or action.

    1. An arrow pointing right after "Next" indicates that clicking the button will take the user to the next step in a sequence.

    2. A downward arrow following "Options" might imply that clicking the button will open a dropdown menu.

Hierarchy

Button hierarchy emphasizes the relative importance of each button within the context, helping users quickly decide which action to take.

  • Primary Button: The most prominent button used for the main call-to-action. It's used for the most important actions.

  • Secondary Button: Less prominent than the primary button, used for important actions but not the primary focus. These often have a more subdued style.

  • Tertiary Button: The least prominent, used for the least critical actions or where space and context require a more subtle approach. Often styled as text or outlined.

  • Text-only Button: Mostly appears as plain text but is clickable, used when the action requires the least emphasis or to fit seamlessly with other textual content.

  • Danger Button: Used for actions that could have negative consequences (like deleting or disabling). This variant is typically styled with a warning color (e.g., red).

Check out buttons on Nucleus UI

Sizes

Here are typical size variants found in design systems:

  1. Extra Small (XS): Typically around 24 to 28 pixels. Suitable for very dense interfaces or alongside small form elements.

  2. Small (S): Generally between 28 to 32 pixels. Used where a bit more prominence is needed than XS, but space is still limited.

  3. Medium (M): Often set at 32 to 40 pixels. This is the standard size for most buttons and is commonly used for primary actions across various interfaces.

  4. Large (L): Usually ranging from 40 to 48 pixels. These buttons provide greater visibility and are easier to interact with, especially on touch devices.

  5. Extra Large (XL): This could be anywhere from 48 to 56 pixels or more. These are used sparingly for very prominent calls to action where maximum visibility and ease of interaction are paramount.

Tip: You won't need to use all the size variants in a single project. Most mobile apps might use 1-2 size variants, a marketing site could also use 1-2 sizes, while A SaaS platform could have more—2-4 sizes, depending on the context.

States

Buttons in a design system have different states to indicate their interactivity and purpose. Here are the various states a button can have:

  • Normal (Default): This is the base state of a button. It is interactable but not being interacted with.

  • Hover: This state is triggered when people point their cursor over the button. It usually changes the background color, border, or elevation to indicate it is interactive.

  • Active (Pressed): This state occurs when the button is being clicked or tapped–not yet released. It often features a more pronounced stylistic change such as a darker background color or an inset shadow to mimic a physical button being pressed.

  • Focused: When a button is in focus, typically from tab navigation or clicking without releasing, it is highlighted. This often involves an outline or change in shadow to emphasize that the button is ready to be activated by pressing enter or clicking.

  • Disabled: This state is used when a button cannot be interacted with due to certain conditions not being met. Visually, it is usually rendered with muted colors and a lack of shadow or interactive cues, indicating it is not active.

  • Loading: Some systems include a loading state for buttons that initiate processes requiring time, such as submitting a form. This state might show a spinner or progress bar to indicate that the action is in progress and that the button cannot be pressed again until complete.

Check out buttons on Nucleus UI

Best practices

  1. Use concise and action-oriented labels on buttons that convey the intended action or purpose.


  2. Make sure the label color and background color have enough contrast to improve readability and accessibility.


  3. Maintain a consistent visual style for buttons throughout the interface to create a cohesive and recognizable design.


  4. Choose a button size that aligns with its importance and usage context. Important actions should have larger buttons to draw attention.


  5. Limit the number of buttons on a screen to prevent visual clutter and focus on essential actions.

If you're on the hunt for a design system starter kit, check out Nucleus UI. It's the perfect toolkit to kick off your design projects.

Never recreate the same things; focus on what matters.

Learn more

See preview

More by Thomas Budiman

View profile