The Button
component is a simple button that can be used to trigger actions.
For best UI/UX practices try to only use one primary button per page (or a maximum of two clearly separated by concern) to denote the most important/common/desired action to the user.
Examples of this include:
Try not to use primary buttons for:
For everything else, there's secondary. This should be your "go to" in nitpick for anything that isn't important enough to be a primary action. If you have a document UI akin to Google Docs then every button that isn't "share" along your header is going to be a secondary.
Outlined buttons in the eyes of nitpick exist for convenience for the developer, but are rarely used. That doesn't mean you shouldn't of course!
You may want an outlined button for:
Try not to:
Accent buttons are often used as CTA's or a positively encouraged action to the user.
This one's easy, don't delete your account by accident! Use this for destructive actions.
A text button is for when you want a button that looks just like a bit of text but retains the spacing of the button style. It happens.
The loading variant lets you quickly turn a button into a disabled loading state.
While the button is in the loading state, it will be disabled and the text will be replaced with a loading spinner without it resizing the button.
You cannot click or interact with the button while it is in the loading state.
A shimmer is a great way to draw attention to a button that is waiting for user input. This is useful when a form has been completed and is awaiting submission.
This is used for example by Stripe in their new checkout experience, where the button always appears "enabled" but begins to "shimmer" when the checkout form becomes valid.
You can also specify the size of your button.