Skip to content

Button

Renders a <button type="button">, or an <a role="button"> when href is set.

variant sets the color. default is Tabler’s neutral button, a plain .btn:

appearance switches between a filled background, an outline border and a ghost button that only shows its background on hover. link looks like a link (btn-link) and ignores variant:

action is a quiet, square icon button for a card header or a table row (btn-action): it ignores variant and only shows a background on hover. Give it an aria-label, and group several in ButtonActions:

Put an icon before the label, with the icon class so Tabler spaces it. iconOnly removes the label padding: give the button an aria-label.

animateIcon animates the icon when the button is hovered:

pill rounds the corners fully, square removes the radius:

loading replaces the label with a spinner. disabled sets the disabled attribute on a <button>; on a link it adds the disabled class, aria-disabled="true" and tabindex="-1".

With href, the button renders an <a> and type is ignored. Without it, type sets the button type, button by default:

floating pins the button to the bottom corner of the viewport (btn-floating), for the main action of a page:

Confetti needs no component: tabler.js binds it to any element with data-bs-toggle="confetti", and attributes are forwarded to the button:

Prop Type Default Description
variant string 'primary' default (neutral) primary secondary success danger warning info dark light
appearance string 'filled' filled outline ghost link (btn-link) action (btn-action); link and action ignore variant
size string 'md' sm md lg xl
href string? null Renders <a href role="button"> instead of <button>
type string 'button' button submit reset, ignored for links
pill bool false Fully rounded corners (btn-pill)
square bool false No border radius (btn-square)
iconOnly bool false Icon-only button (btn-icon)
loading bool false Spinner instead of the label (btn-loading)
block bool false Full width (w-100)
disabled bool false disabled attribute on <button>; disabled class, aria-disabled and tabindex on <a>
floating bool false Pinned to the bottom corner of the viewport (btn-floating)
animateIcon string? null Animates the icon on hover: pulse rotate shake tada move-start (btn-animate-icon-*)

Other attributes go to the <button> or <a>. The children are the label.