Skip to content

AisButton ​

Branded button component

Props ​

Type ​

The type prop sets the HTML type attribute. Accepted values are: button, submit, and reset. The default value is button.

Variant ​

The variant prop accepts the standard variants and dictates the button styles. The variants are: primary, secondary, default, plain, info, success, warning, and danger. The default value is primary. The variants are shown here using the hover and pressed effects.

Default
Primary
Secondary
Plain
Info
Success
Warning
Danger

Outline ​

The outline prop can be combined with variant to provide an alternate set of button styles. outline is a boolean prop that can be added without a value. outline variants use a lighter background with a visible border.

Default
Primary
Secondary
Plain
Info
Success
Warning
Danger

Alternate ​

The alternate prop has been deprecated and has been replaced by outline. Please update your usages as alternate will be removed.

Size ​

Thesize prop controls the button size. The accepted values are: xs, sm, md, lg, xl, and xxl. The default value is md and size xl matches UIDS SiteNow buttons. Forms should use md, lg, or xl leaving the extremes for more specialized interfaces. Buttons smaller than md should not use the font caps.

xxl
xl
lg
md
sm
xs

Font ​

The font prop sets the button's font. It will accept one of our three brand fonts: caps, serif, and sans. caps is the default value. (Link to Typography page.)

Featured, stand-alone buttons such as form controls and calls to action should use caps. Buttons displayed in groups or at smaller sizes should consider sans.

caps
serif
sans
caps
serif
sans

Disabled ​

The disabled prop is a boolean flag that will disable a button via the HTML disabled attribute.

Primary
Secondary
Default
Plain
Primary
Secondary
Default
Plain

Icon ​

The optional icon prop accepts either an object imported from the FontAwesome icon packs or a string specifying one of the preloaded, core components. Specifying a value will cause an icon to be displayed alongside the button's text. icon controls the standard location for button icons and should generally be preferred over iconRight.

arrow
asterisk
busy
new
edit
confirm
cancel
save
copy
delete
close
undo
redo
search
filter
info
success
required
error
warning
danger
unknown
person
user
users
group
menu
options
calendar
clock
money
heart
star
locked
unlocked
upload
download
left
right
up
down
first
last
caret-left
caret-right
caret-up
caret-down
file
file-pdf
file-csv
file-excel
file-word
file-powerpoint
file-image
file-video
file-upload
default
primary
secondary
bold
italic
strikethrough
list
list-ol
subscript
superscript

Icon Right ​

The optional iconRight prop accepts the same values as icon and will display an icon to the right of the button's text. iconRight is considered a building block for other components. Application developers should prefer the standard icon prop in most cases.

Arrow

Busy ​

Use the busy prop to indicate that the button is busy. When the component is busy, it will not accept additional clicks. This is commonly used when @click triggers an asynchronous action and must await a response.

Click to activate the busy state.

Arrow ​

The arrow prop is a boolean flag that activates an arrow icon to the right of the button text. This is a form promoted by UIDS for call-to-action buttons.

Arrow

Effects ​

AisButton accepts a number of boolean props that will enable interactive effects on the button. hover matches the UIDS hover animation. hover fast provides a faster version. press provides a click animation.

hover
hover fast
press
hover & press

Block ​

The block prop makes the button span the full width if its parent. block is a boolean prop that can be added without a value. The default value is false.

Rounded ​

The rounded prop controls the border radius of the button. The accepted values are: true, false, md, lg, and full. The default value is false.

UIDS uses non-rounded buttons. For brand consistency, this form should be preferred for featured, stand-alone buttons such as form controls and calls to action. Developers can play with rounded corners for secondary controls and buttons that need to fade into the background more.

rounded-sm
rounded
rounded-md
rounded-lg
rounded-xl
rounded-2xl
rounded-3xl
rounded-full

To (Route) ​

The to prop accepts a vue-router location definition. The button will route to location on click. The click event will not be emitted.

keepFocus ​

keepFocus is a boolean prop. When it is true, the button will keep focus after a click instead of calling blur(). When true, the button will have a focus ring after a click. This allows keyboard users to click multiple times. See the @click example to see it in action.

Events ​

@click ​

Bind to @click to handle the button's click event.

0

Methods ​

focus() ​

AisButton exposes a focus() method to programmatically focus the button element. The method can be invoked through a template ref specified on an AisButton component.