Skip to main content
K
Last modified: 24/Jun/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
primary
#icon
"AnalyticsAlt" | "AnalyticsCircleAlt" | "AnalyticsCircleSolidAlt" | "AnalyticsCircleSolid" | "AnalyticsCircle" | "AnalyticsSmall" | "AnalyticsSquareAlt" | "AnalyticsSquareSolidAlt" | ... 525 more ... | "Wrench"
Adds an icon to the button
#iconPosition
IconPosition
Positions the icon before or after the button text
start
#htmlType
"button" | "submit" | "reset"
Indicates the behavior of the button
button
#isDisabled
boolean
Sets the disabled state of button
false
#isLoading
boolean
Sets the loading status of button
false
#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 the Button's type prop to determine its look
  • ButtonProps: props of the Button component processed by stratus
  • ButtonInterface: ButtonProps extended by HTMLAttributes<HTMLButtonElement>

Read more about types here


#See also