Button
Button
Use the Button component when you want users to perform an action like connecting their Ethereum account or starting a transaction. It contains a label with an optional icon before or after the label. It maps to a <button type='button'>
element and extends Box.
Import component
import { Button } from "rimble-ui";
Examples
Different ways to use the Button
component.
In special cases where you'd like to use a <a>
styled like a Button
, use <Button as='a'></Button>
and provide an href.
Default button
Use to show users the primary action(s) they can take from the screen they're on.
Solid
Outline
Text
Base
Minimal styling. Used for composing buttons with more complex styles.
Different sizes
Disabled button
Use to indicate to the user that they need to do something before they can perform the action.
Icon
Use to add visual reinforcement to an action. In most cases an icon should support button copy and not replace. Copy is less ambiguous than an icon.
Loading button
Use to give users reassurance that the action they want is happening. If possible, include copy that further explains what's happening like "Loading" or "Sending"
Link button
Use when you want a primary action to navigate the user to a new page or area. Use action words as the button label.
This also requires you to import the Link component from the rimble-ui library.
Link Button Outline
Success color style
Danger color style
Custom color
Props
bg
'silver'
border
'none'
color
'white'
contrastColor
'white'
fontFamily
'sansSerif'
fontSize
'inherit'
fontWeight
3
height
'3rem'
icon
icononly
iconpos
lineHeight
1
mainColor
'primary'
minWidth
'3rem'
position
'relative'
px
4
py
0
size
theme
Styled System Props
Button
uses COMMON
, LAYOUT
, POSITION
, FLEXBOX
, BORDERS
groups of Styled System props.
Design guidelines
Some best practices for using Button
in your product.
Don't just use icons
Don’t use Button
for navigational links
Keep position consistent
This will let users know where to look when they want to perform actions
Consider visual hierarchy of buttons
Don’t use too many buttons together on one piece of interface: prioritise the most important action. Use Button.Text
and Button.Outline
to give your actions visual hierarchy
What's a transaction fee?
Content
Some best practices for writing Button
microcopy.
Explain what pressing the button will do
Keep copy concise
Explain the next step, not the end goal
Lead with a verb and follow with a noun
Related components
- MetaMaskButton – a ready-styled button to tell your users that they can connect with MetaMask
- UPortButton – a ready-styled button ready to tell your users that they can connect with uPort