Bootstrap Buttons

Use MDB’s custom button styles for actions in forms, dialogs, and more. Includes support for a handful of contextual variations, sizes, states, and more.

All the visually attractive and highly functional buttons we provided you with are fully customizable and easily adjustable to your needs.

Each of them contains characteristic Material Design elements, such as shadows, living colors or subtle animation on hovering.


Basic buttons

MDB includes 7 predefined button styles, each serving its own semantic purpose.

                                    
<!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
<btn color="primary">Primary</btn>

<!-- Default button -->
<btn color="default">Default</btn>

<!-- Secondary button -->
<btn color="secondary">Secondary</btn>

<!-- Indicates a successful or positive action -->
<btn color="success">Success</btn>

<!-- Contextual button for informational alert messages -->
<btn color="info">Info</btn>

<!-- Indicates caution should be taken with this action -->
<btn color="warning">Warning</btn>

<!-- Indicates a dangerous or potentially negative action -->
<btn color="danger">Danger</btn>
                                

Conveying meaning to assistive technologies

Using color to add meaning to a button only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (the visible text of the button), or is included through alternative means, such as additional text hidden with the .sr-only class.


Additional buttons

                                    
<!--Elegant-->
<btn color="elegant">Elegant</btn>

<!--Unique-->
<btn color="unique">Unique</btn>

<!--Pink-->
<btn color="pink">Pink</btn>

<!--Purple-->
<btn color="purple">Purple</btn>

<!--Deep-purple-->
<btn color="deep-purple">Deep-purple</btn>

<!--Indigo-->
<btn color="indigo">Indigo</btn>

<!--Light blue-->
<btn color="light-blue">Light blue</btn>

<!--Cyan-->
<btn color="cyan">Cyan</btn>

<!--Dark-green-->
<btn color="dark-green">Dark-green</btn>

<!--Light-green-->
<btn color="light-green">Light-green</btn>

<!--Yellow-->
<btn color="yellow">Yellow</btn>

<!--Amber-->
<btn color="amber">Amber</btn>

<!--Deep-orange-->
<btn color="deep-orange">Deep-orange</btn>

<!--Brown-->
<btn color="brown">Brown</btn>

<!--Blue-grey-->
<btn color="blue-grey">Blue-grey</btn>

<!--MDB-->
<btn color="mdb-color">MDB</btn>
                                

Gradient buttons MDB Pro component


<btn gradient="peach" rounded>Peach gradient button</btn>
<btn gradient="purple" rounded>Purple gradient button</btn>
<btn gradient="blue" rounded>Blue gradient button</btn>
<btn gradient="aqua" rounded>Aqua gradient button</btn>
            

Outline buttons

In need of a button, but not the hefty background colors they bring? Replace the default modifier classes with the outline ones to remove all background images and colors on any button.

                
<btn outline="primary">Primary</btn>
<btn outline="default">Default</btn>
<btn outline="secondary">Secondary</btn>
<btn outline="success">Success</btn>
<btn outline="info">Info</btn>
<btn outline="warning">Warning</btn>
<btn outline="danger">Danger</btn>
                
            

Rounded buttons MDB Pro component


<btn color="primary" rounded>Primary rounded button</btn>
<btn color="default" rounded>Default rounded button</btn>
<btn color="secondary" rounded>Secondary rounded button</btn>
<btn color="success" rounded>Success rounded button</btn>
<btn color="info" rounded>Info rounded button</btn>
<btn color="warning" rounded>Warning rounded button</btn>
<btn color="danger" rounded>Danger rounded button</btn>
            

Rounded outline buttons MDB Pro component


<btn outline="primary" darkWaves rounded>Primary outline button</btn>
<btn outline="default" darkWaves rounded>Default outline button</btn>
<btn outline="secondary" darkWaves rounded>Secondary outline button</btn>
<btn outline="success" darkWaves rounded>Success outline button</btn>
<btn outline="info" darkWaves rounded>Info outline button</btn>
<btn outline="warning" darkWaves rounded>Warning outline button</btn>
<btn outline="danger" darkWaves rounded>Danger outline button</btn>
            

Floating buttons MDB Pro component


<btn tag="a" gradient="purple" floating size="lg"><fa icon="bolt"/></btn>
<btn tag="a" gradient="peach" floating><fa icon="leaf"/></btn>
<btn tag="a" gradient="blue" floating size="sm"><fa icon="star"/></btn>
            

See the full list of available icons and colors for your buttons.


Fixed buttons MDB Pro component

See the live example of fixed button in the bottom right corner of this page.


<template>
    <btn-fixed @mouseenter.native="hover" @mouseleave.native="hoverOut" icon="pencil" size="lg" :bottom="30" :right="25">
        <btn-fixed-item :show="show" color="red" icon="star"/>
        <btn-fixed-item :show="show" color="yellow" icon="user"/>
        <btn-fixed-item :show="show" color="green" icon="envelope"/>
        <btn-fixed-item :show="show" color="blue" icon="shopping-cart"/>
    </btn-fixed>
</template>

<script>
import { Btn, BtnFixed, BtnFixedItem } from 'mdbvue';

export default {
    data() {
        return {
            show: false
        };
    },
    name: 'ButtonPage',
    components: {
        Btn,
        BtnFixed,
        BtnFixedItem
        },
    methods: {
        hover() {
            this.show = true;
        },
        hoverOut() {
            this.show = false;
        },
    }
};
</script>
            

"Back to the top" button

"Back to the top" button is very useful with the long pages, especially on the mobile devices.

Click the button below to see the live example.

Live example

<btn-fixed @click.native.prevent="pageUp" color="blue" icon="arrow-up" size="lg" :bottom="30" :right="105"/>

methods: {
    pageUp() {
      window.scroll({top: 0, left: 0, behavior: 'smooth'});
    },
}
            

Flat button MDB Pro component

<btn flat size="lg" darkWaves>Click me</btn>

Buttons with icons

Note: To set the desired distance between icon and text use spacing utilities (for example .ml-1, .mr-2).

                
<btn color="primary"><fa icon="magic" class="mr-1"/> Left</btn>
<btn color="default">Right <fa icon="magic" class="ml-1"/></btn>
           

See the full list of available icons for your buttons.


Button tags

The .btn classes are designed to be used with the <button> element. However, you can also use these classes on <a> elements (though some browsers may apply a slightly different rendering).

When using button classes on <a> elements that are used to trigger in-page functionality (like collapsing content), rather than linking to new pages or sections within the current page, these links should be given a role="button" to appropriately convey their purpose to assistive technologies such as screen readers.

Link
                                    
<btn tag="a" role="button" color="primary" href="#">Link</btn>
<btn color="primary" type="submit">Button</btn>
                                

Sizes

Fancy larger or smaller buttons? Add size="lg" or size="sm" for additional sizes.

                                    
<btn size="lg" color="primary">Large button</btn>
<btn size="lg" color="default">Large button</btn>
                                
                            
<btn size="sm" color="primary">Small button</btn>
<btn size="sm" color="default">Small button</btn>
                            

Create block level buttons—those that span the full width of a parent—by adding block.

                            
<btn block color="default">Block level button</btn>
<btn block color="primary">Block level button</btn>
                            

Button states

Active state

btns will appear pressed (with a darker background, darker border, and inset shadow) when active. There’s no need to add a class to <btn>s as they use a pseudo-class. However, you can still force the same active appearance with active should you need to replicate the state programmatically.

Link active
                            
<btn active size="lg" color="primary">btn active</btn>
<btn tag="a" role="button" active size="lg" href="#">btn active</btn>
                            

Disabled state

Make buttons look inactive by adding the disabled boolean attribute to any <btn> element.

                            
<btn disabled size="lg" color="primary">Primary button</btn>
<btn disabled size="lg" color="default">Button</btn>
                            

Link functionality caveat

The .disabled class uses pointer-events: none to try to disable the link functionality of <a>s, but that CSS property is not yet standardized. In addition, even in browsers that do support pointer-events: none, keyboard navigation remains unaffected, meaning that sighted keyboard users and users of assistive technologies will still be able to activate these links. So to be safe, add a tabindex="-1" attribute on these links (to prevent them from receiving keyboard focus) and use custom JavaScript to disable their functionality.


Button plugin

Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

Toggle states


<template>
    <btn color="primary" @click.native="toggleActiveState" :active="active">Single Toggle</btn> 
</template>

<script>
import { Btn } from 'mdbvue';

export default {
    data() {
        return {
            active: false,
        };
    },
    name: 'ButtonPage',
    components: {
        Btn,
    },
    methods: {
        toggleActiveState() {
            this.active = !this.active;
        }
    }
};
</script>
            

Checkbox and radio buttons


<template>
    <btn-group>
        <btn color="primary" @click.native="toggleActiveState2" :active="active2">Checkbox 1 (pre-checked)</btn>
        <btn color="primary" @click.native="toggleActiveState3" :active="active3">Checkbox 2</btn>
        <btn color="primary" @click.native="toggleActiveState4" :active="active4">Checkbox 3</btn>
    </btn-group>
</template>

<script>
import { Btn, BtnGroup } from 'mdbvue';

export default {
    data() {
        return {
            active2: true,
            active3: false,
            active4: false
        };
    },
        name: 'ButtonPage',
        components: {
        Btn,
        BtnGroup
    },
    methods: {
        toggleActiveState() {
            this.active = !this.active;
        },
        toggleActiveState2() {
            this.active2 = !this.active2;
        },
        toggleActiveState3() {
            this.active3 = !this.active3;
        }
    }
};
</script>
            

<template>
    <btn-group>
        <btn color="primary" @click.native="toggleActiveState5" :active="active5">Radio 1 (preselected)</btn>
        <btn color="primary" @click.native="toggleActiveState6" :active="active6">Radio 2</btn>
        <btn color="primary" @click.native="toggleActiveState7" :active="active7">Radio 3</btn>
    </btn-group>
</template>

<script>
import { Btn, BtnGroup } from 'mdbvue';

export default {
  data() {
    return {
      active5: true,
      active6: false,
      active7: false
    };
  },
  name: 'ButtonPage',
  components: {
    Btn,
    BtnGroup
  },
  methods: {
    toggleActiveState5() {
      this.active5 = true;
      this.active6 = false;
      this.active7 = false;
    },
    toggleActiveState6() {
      this.active5 = false;
      this.active6 = true;
      this.active7 = false;
    },
    toggleActiveState7() {
      this.active5 = false;
      this.active6 = false;
      this.active7 = true;
    }
  }
};
</script>