Sign in


Sign up


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, subtle animation on hovering, or charming waves effect triggered by clicking.


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 -->
<Button color="primary">Primary</Button>

<!-- Default button -->
<Button>Default</Button>

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

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

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

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

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

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-->
<Button color="elegant">Elegant</Button>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

Buttons with icons

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

                                    
<Button color="primary"><Fa icon="magic" className="mr-1"/> Left</Button>
<Button >Right <Fa icon="magic" className="ml-1"/></Button>
                                

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
                                    
<Button color="primary" href="#">Link</Button>
<Button color="primary" type="submit">Button</Button>
                                

Sizes

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

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

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

                            
<Button block >Block level button</Button>
<Button block color="primary">Block level button</Button>
                            

Button states

Active state

Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. There’s no need to add a class to <button>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
                            
<Button active size="lg" color="primary">Button active</Button>
<Button active size="lg" href="#" >Button active</Button>
                            

Disabled state

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

                            
<Button disabled size="lg" color="primary">Primary button</Button>
<Button disabled size="lg" >Button</Button>
                            
Primary link Link
                            
<Button disabled size="lg" color="primary" href="#" >Primary link</Button>
<Button disabled size="lg" color="secondary" href="#" >Link</Button>
                            

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.