Buttons communicate actions that users can take. They are typically placed throughout your UI, in places like:
Button
comes with three variants: text (default), contained, and outlined.medium
size-- button: TEXT variant: text link: index.html -- button: Contained variant: contained link: index.html -- button: Outlined variant: outlined link: index.html
small
size-- button: TEXT variant: text link: index.html size: small -- button: Contained variant: contained link: index.html size: small -- button: Outlined variant: outlined link: index.html size: small
large
size-- button: TEXT variant: text link: index.html size: large -- button: Contained variant: contained link: index.html size: large -- button: Outlined variant: outlined link: index.html size: large
title
required
)variant
required
)It’s used to define variant of the button. There are three(3) button variants:
text
- button appears as a text, and on mouse over background color is shown.
contained
- button appears as a contained button, with background color $inherited.colors.cta-primary.base
.
outlined
- button outlined with $inherited.colors.cta-primary.border
. link
optional
)url
to button. If you wish to use fastn $on-click$
event then don’t add this property.size
optional
)It’s used to define button size. It’s optional
property and default value is medium
, there are only three(3) sizes of button(small
, medium
and large
), it uses below tokens from fastn typography according to its value:
small
- uses $inherited.types.button-small
medium
- uses $inherited.types.button-medium
large
- uses $inherited.types.button-large
fastn-button
?To use fastn button inside fastn projects try below methods as per requirement.