Button
Button is an interactive component that allows the user to execute an action. Button comes in three distinct appearances: solid, bordered, and transparent. These styles provide greater choice and flexibility for establishing hierarchy and affordance within a UI. You can display a button with or without a text description or icon.
Also known as: Action, UI action
| Salt package | @salt-ds/core |
|---|
- Keep the text description short, ideally one to three words and no more than five. If you’re including an icon with the text, use no more than three words.
To allow the user to execute an action, such as “submit”, “merge” or “upload”. Buttons are typically placed in components and contexts such as dialogs, cards and forms.
- When the interaction navigates the user to a different destination rather than triggering an on-page action. Instead, use
Linkfor inline or lower-priority navigation, orLinkButtonwhen navigation stands alone, should stand out from inline links, or sits alongside buttons and should share their visual weight and alignment.
To import Button and OnSolidButton from the core Salt package, use:
import { Button, OnSolidButton } from "@salt-ds/core";
- Always style button text in all caps for prominence. This avoids confusion with body text or general writing.
- Never use ampersand (&) in button text to save space.
- Always use verbs that emphasize the action the button carries out. For example, use Create instead of Ok to create a profile, or Save/Discard instead of Yes/No to save changes.
- Be succinct. Avoid having more than two or three words in a button label.
- Button Pattern (https://www.w3.org/WAI/ARIA/apg/patterns/button/) W3C