Button
Buttons are interactive components that guide and inform a user's interaction through an experience. They signal actions and provide clear visual cues to help users accomplish their goals with confidence and efficiency.
Usage
cv-button_hero
When to use
Use button variants to prioritize actions: Raised for primary actions like "Submit," Outlined for secondary actions like "Cancel," and Text for less prominent, inline tasks. Each style ensures clarity and purpose.
Variant | Purpose |
|---|---|
Raised | A primary button is used for the main action on a page or screen, such as "submit" or "save". |
Outline | A secondary button is used for less critical actions or alternatives, like "cancel" or "back". |
Text | A tertiary button is used for less critical actions or alternatives, like "cancel" or "back". |
Recommendations
Recommended practices ensure clear guidance, usability, accessibility, appropriate sizing, and user support.
Placement
cv-button_placement
cv-button_in-footers
Groupings and types
cv-button_action--primary
cv-button_action--destructive
cv-button_action--destructive--not-primary
Usage — additional resources
Style
Anatomy
cv-button_anatomy
- Icon that conveys the purpose of the button. Can be to the right or left of the button text.
- Describes the action performed by the button.
- Outline or color fill that contains the button contents.
Typography
Use these text styles for button:
- button
cv-button_typography
Content guidelines
Buttons trigger actions. Actionable labels ensure clarity and ease of use.
- Categorization: Use (Raised) primary buttons for main actions, (Outline) secondary for less critical actions.
- Use sentence style
- Word limit: Limit labels to 2-3 words.
Variants
Buttons are outlined by default or filled for higher emphasis. Use outlined buttons for everything except the primary action (if any). Use filled buttons for the primary action.
Buttons can have one icon to the left or right of the text.
cv-button_variants
States
Default
cv-button_state_default_filled
Filled button anatomy — Color tokens: 1, 2 — on-primary · 3 — primary
cv-button_state_default_outlined
Outlined button anatomy — Color tokens: 1, 2 — primary · 3 — outline
Positive
cv-button_state_positive_filled
Filled button anatomy — Color tokens: 1, 2 — on-positive · 3 — positive
cv-button_state_positive_outlined
Outlined button anatomy — Color tokens: 1, 2, 3 — positive
Caution
cv-button_state_caution_filled
Filled button anatomy — Color tokens: 1, 2 — on-caution · 3 — caution
cv-button_state_caution_outlined
Outlined button anatomy — Color tokens: 1, 2, 3 — caution
Negative
cv-button_state_negative_filled
Filled button anatomy — Color tokens: 1, 2 — on-negative · 3 — negative
cv-button_state_negative_outlined
Outlined button anatomy — Color tokens: 1, 2, 3 — negative
Emphasis
cv-button_state_emphasis_filled
Filled button anatomy — Color tokens: 1, 2 — on-emphasis · 3 — emphasis
cv-button_state_emphasis_outlined
Outlined button anatomy — Color tokens: 1, 2, 3 — emphasis
Secondary
cv-button_state_secondary_filled
Filled button anatomy — Color tokens: 1, 2 — on-secondary · 3 — secondary
cv-button_state_secondary_outlined
Outlined button anatomy — Color tokens: 1, 2, 3 — secondary
Interaction states
The following interaction states are available for buttons. See the state layers section on the Colors page for more details.
cv-button_interaction_states
Web components
Text variant
Props (summary)
label · icon · color: primary | secondary | emphasis | neutral | caution | negative | positive · raised · unelevated · outlined · dense · disabled · expandContent · fullwidth · trailingIcon
How to import
- MWC button (Material Web Components)
Accessibility
Overview
Buttons must be accessible to all users, ensuring equal interaction regardless of ability. They should have clear, descriptive labels, proper color contrast, and visible focus states to support usability and accessibility.
Keyboard interactions
Buttons should be fully operable via keyboard:
- Enter/Return key: Activates the button's action.
- Spacebar: Activates the button's action, consistent with standard keyboard behavior.
- Provide clear feedback, such as visual states (e.g., hover, focus, active), to indicate when the button is ready to be interacted with.
cv-button_accessibility
Tab index focus
Buttons must follow a logical tab order to maintain smooth navigation:
- Use
tabindex="0"for buttons to include them in the natural tab order. - Focus states should be clearly visible and distinct, meeting WCAG 2.1 contrast requirements.
- Avoid removing buttons from the tab order unless they are intentionally disabled, ensuring accessibility for keyboard and assistive technology users.