Badges

Documentation and examples for badges, our small count and labeling component.

Example

Badges scale to match the size of the immediate parent element by using relative font sizing and em units.

Example heading New

Example heading New

Example heading New

Example heading New

Example heading New
Example heading New
<h1>Example heading @Html.LLG().Badge().Text("New").Color(BootstrapColor.Secondary)</h1>
<h2>Example heading @Html.LLG().Badge().Text("New").Color(BootstrapColor.Secondary)</h2>
<h3>Example heading @Html.LLG().Badge().Text("New").Color(BootstrapColor.Secondary)</h3>
<h4>Example heading @Html.LLG().Badge().Text("New").Color(BootstrapColor.Secondary)</h4>
<h5>Example heading @Html.LLG().Badge().Text("New").Color(BootstrapColor.Secondary)</h5>
<h6>Example heading @Html.LLG().Badge().Text("New").Color(BootstrapColor.Secondary)</h6>

Badges can be used as part of links or buttons to provide a counter.

<button type="button" class="btn btn-primary">
  Notifications @Html.LLG().Badge().Text("4").Color(BootstrapColor.Light)
</button>

Contextual variations

Add any of the below mentioned modifier classes to change the appearance of a badge.

Primary Secondary Success Danger Warning Info Light Dark
@Html.LLG().Button("Primary").Color(BootstrapColor.Primary)
@Html.LLG().Badge("Danger").Color(BootstrapColor.Danger)
@Html.LLG().Badge("Dark").Color(BootstrapColor.Dark)
@Html.LLG().Badge("Info").Color(BootstrapColor.Info) 
@Html.LLG().Badge("Light").Color(BootstrapColor.Light) 
@Html.LLG().Badge("Secondary").Color(BootstrapColor.Secondary) 
@Html.LLG().Badge("Success").Color(BootstrapColor.Success) 
@Html.LLG().Badge("Warning").Color(BootstrapColor.Warning) 
Conveying meaning to assistive technologies

Using color to add meaning 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 (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .sr-only class.

Pill badges

Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding). Useful if you miss the badges from v3.

Primary Secondary Success Danger Warning Info Light Dark
@Html.LLG().Badge("Primary").Color(BootstrapColor.Primary).Pill()
@Html.LLG().Badge("Danger").Color(BootstrapColor.Danger).Pill()
@Html.LLG().Badge("Dark").Color(BootstrapColor.Dark).Pill()
@Html.LLG().Badge("Info").Color(BootstrapColor.Info).Pill() 
@Html.LLG().Badge("Light").Color(BootstrapColor.Light).Pill() 
@Html.LLG().Badge("Secondary").Color(BootstrapColor.Secondary).Pill() 
@Html.LLG().Badge("Success").Color(BootstrapColor.Success).Pill() 
@Html.LLG().Badge("Warning").Color(BootstrapColor.Warning).Pill() 

Raiting

Use @Html.LLG().Rating(RatingRate rate) method to create raiting





 @Html.LLG().Rating(RatingRate.One)
 @Html.LLG().Rating(RatingRate.Two)
 @Html.LLG().Rating(RatingRate.Three)
 @Html.LLG().Rating(RatingRate.Four)
 @Html.LLG().Rating(RatingRate.Five)   

Methods

Alerts are available for any length of text, as well as an optional dismiss button

Method Description

.Method(bool value)

Comming soon.