Welcome Getting started Layout styles github-circle-black-transparent Source
Components
Badges
App bars
Bottom app bars Top app bars
Buttons
Common buttons FAB Icon buttons Segmented buttons
Cards Carousel Checkboxes Chips Date pickers Dialogs Forms Icons Lists Menus Navigation Progress indicators Pull to refresh Radios Search Selects
Sheets
Bottom sheets Side sheets
Sliders Snackbars Switches Tabs Text fields Time pickers Tooltips Utilities
home apps Buttons palette Two
Materially
github-circle-black-transparent

Badges

Badges convey dynamic information, such as counts or status. A badge can include labels or numbers
Material Design Guidelines: Badges

Example

inbox inbox inbox inbox
Label Label Label Label
<mc-icon-button>
  <!-- 0 === no value -->
  <mc-badge value="0"></mc-badge>
  <mc-icon>inbox</mc-icon>
</mc-icon-button>

<mc-icon-button>
  <mc-badge hide-value value="0"></mc-badge>
  <mc-icon>inbox</mc-icon>
</mc-icon-button>

<mc-icon-button>
  <mc-badge value="99"></mc-badge>
  <mc-icon>inbox</mc-icon>
</mc-icon-button>

<mc-icon-button>
  <mc-badge value="1000"></mc-badge>
  <mc-icon>inbox</mc-icon>
</mc-icon-button>

<mc-button>
  Label
  <mc-badge value="0"></mc-badge>
</mc-button>

<mc-button>
  Label
  <mc-badge hide-value value="1"></mc-badge>
</mc-button>

<mc-button>
  Label
  <mc-badge value="99"></mc-badge>
</mc-button>

<mc-button>
  Label
  <mc-badge value="1000"></mc-badge>
</mc-button>
            
// Update using value
document.querySelector('mc-badge').value = 99;

// Update using value. 1000 -> 999+
document.querySelector('mc-badge').value = 1000;
            

Style

CSS variables that allow you override default values
/* Optional variables for overriding */
  
--mc-badge-container-color: var(--mc-error);
--mc-badge-text-color: var(--mc-on-error);
            
menu home apps Get started