Last modified: 4/Oct/2024
Button
Use the button component for simple interactions that needs labeling as they can’t be described with an icon. You can though extend the button with a prefix- or suffix icon to better convey their action.
Check out the figma documentation page here.
#Usage
import { Button } from '@kinsta/stratus'
const MyComponent = () => (
<>
<Button>Hello there!</Button>
</>
)
#Props
The Button
components interface extends the
HTMLButtonElement
interface. So you can use any props which documented there. Also, you can utilize all the React Synthetic events (on*
),
and props related to styling (className
, style
).
#type
ButtonTypes
Sets the type of the component
#icon
"AnalyticsAlt" | "AnalyticsCircleAlt" | "AnalyticsCircleSolidAlt" | "AnalyticsCircleSolid" | "AnalyticsCircle" | "AnalyticsSmall" | "AnalyticsSquareAlt" | "AnalyticsSquareSolidAlt" | ... 529 more ... | "Wrench"
Adds an icon to the button
#iconPosition
IconPosition
Positions the icon before or after the button text
#htmlType
"button" | "submit" | "reset"
Indicates the behavior of the button
#isDisabled
boolean
Sets the disabled state of button
#isLoading
boolean
Sets the loading status of button
#tooltip
TooltipType
Adds a Tooltip component around the button. Required if
isDisabled
is true
#ariaLabel
string
ARIA label of the button. Required if
tooltip
is not provided#href
string
If href is passed button will act as a link
#title
string
The title of the link
#target
"_blank" | "_self" | "_parent" | "_top"
#rel
"noopener" | "noreferrer" | "noopener noreferrer"
#Types
ButtonTypes
: types that can be given to theButton
'stype
prop to determine its lookButtonProps
: props of theButton
component processed by stratusButtonInterface
:ButtonProps
extended byHTMLAttributes<HTMLButtonElement>
Read more about types here