Angular Button

CoreUI includes a bunch of predefined buttons components, each serving its own semantic purpose. Buttons show what action will happen when the user clicks or touches it. CoreUI buttons are used to initialize operations, both in the background or foreground of an experience.

@for (state of states; track state; let i = $index) { {{ state.charAt(0).toUpperCase() + state.slice(1) }} @for (color of colors; track color; let i = $index) { } }
Angular Button with icons

You can combine button with our CoreUI Icons.

@for (state of states; track state; let i = $index) { {{ state.charAt(0).toUpperCase() + state.slice(1) }} @for (color of colors; track color; let i = $index) { } }
Angular Button Button components

The <button> component are designed for <button> , <a> or <input> elements (though some browsers may apply a slightly different rendering).

If you're using <button> component as <a> elements that are used to trigger functionality ex. collapsing content, these links should be given a role="button" to adequately communicate their meaning to assistive technologies such as screen readers.

Link
Angular Button outline

If you need a button, but without the strong background colors. Set variant="outline" prop to remove all background colors.

@for (state of states; track state; let i = $index) { {{ state.charAt(0).toUpperCase() + state.slice(1) }} @for (color of colors; track color; let i = $index) { } }
Angular Button ghost

If you need a ghost variant of button, set variant="ghost" prop to remove all background colors.

@for (state of states; track state; let i = $index) { {{ state.charAt(0).toUpperCase() + state.slice(1) }} @for (color of colors; track color; let i = $index) { } }
Angular Button Sizes

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


Angular Button Pill @for (color of colors; track color; let i = $index) { } Angular Button Square @for (color of colors; track color; let i = $index) { } Angular Button Disabled state

Add the disabled boolean prop to any <button> component to make buttons look inactive. Disabled button has pointer-events: none applied to, disabling hover and active states from triggering.

Disabled buttons using the <a> component act a little different:

<a>s don'tsupport the disabled attribute, so CoreUI has to add .disabled class to make buttons look inactive. CoreUI also has to add to the disabled button component aria-disabled="true" attribute to show the state of the component to assistive technologies.

Primary link Link
Angular Button Block buttons

Create buttons that span the full width of a parent—by using utilities.

Here we create a responsive variation, starting with vertically stacked buttons until the md breakpoint, where .d-md-block replaces the .d-grid class, thus nullifying the gap-2 utility. Resize your browser to see them change.

You can adjust the width of your block buttons with grid column width classes. For example, for a half-width "block button", use .col-6. Center it horizontally with .mx-auto, too.

Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we've taken our previous responsive example and added some flex utilities and a margin utility on the button to right align the buttons when they're no longer stacked.