Button
Button Component is use to render a button in the user interface, that can perform tasks when clicked
Appearance#
The Palette Button component has two appearance
primarysecondarytertiarylink
Example#
Code#
Size#
Since the Button component renders the children as it is, the height is determined by the children.
Code#
Color#
The Palette Button component has type prop which is used as the background color or the text color depending on the appearance
prop.
There are five color types,
defaultsuccessinfowarningdanger
The following is the way in which the type is applied
appearance-primarythentype-background-colorappearance-secondarythentype-text colorappearance-tertiarythentype-text colorappearance-linkthen does not apply
Primary Appearance#
Secondary Appearance#
Tertiary Appearance#
Code#
The above code is only for appearance
"primary", the same applies to other two appearance -"secondary"&"tertiary"
Icon buttons#
Since the child of the Button component is rendered as it is when can render icons easily
Code#
Disabled button#
The disabled prop is used to render a disabled button in the user interface
Code#
API#
| Prop | Type | Possible values | Default Value |
|---|---|---|---|
| appearance | string | "primary","secondary","tertiary" and "link" | "primary" |
| type | string | "default", "success", "info", "danger" and "warning" | default |
| disabled | boolean | true and false | false |
| onClick | ()=>void | - | - |
Built by Akshay 🤙