• Getting Started
  • Components
  • Github
  • Go pro
energyGetting started
  • Introduction
dComponents
  • Button Components
  • Grid Components
  • Input Components
  • Layout Components
  • Toast Components
  • Widget Components
  • Alert
  • Badge
  • Breadcrumb
  • Callout
  • Card
  • Carousel
  • Charts
  • Collapse
  • CreateElement
  • DataTable
  • Dropdown
  • ElementCover
  • Embed
  • Fade
  • Form
  • Icon
  • Img
  • Jumbotron
  • Link
  • ListGroup
  • Media
  • Modal
  • Nav
  • Navbar
  • Pagination
  • Popover
  • Progress
  • Spinner
  • Switch
  • Tabs
  • Toggler
  • Tooltip

Badge

React badges are small count and labeling components.


Usage

Example

Primary color badge success color badge warning color badge danger color badge secondary color badgeRaw badgePill badgeLink Badge

Script


  return (
    <>
      <CBadge color="primary"> Primary color badge</CBadge>
      <CBadge color="success"> success color badge</CBadge>
      <CBadge color="warning"> warning color badge</CBadge>
      <CBadge color="danger"> danger color badge</CBadge>
      <CBadge color="secondary"> secondary color badge</CBadge>
      <CBadge>Raw badge</CBadge>
      <CBadge color="primary" shape="pill">Pill badge</CBadge>
      <CBadge color="info" href="https://coreui.io/">
        Link Badge
      </CBadge>
    </>
  )
  


# Features

  • Styling determined by color property
  • Optional pill shape
  • If 'to' or 'href' prop is passed Badge gain behavior of link (is rendered as badge CLink) and gains all props and options of CLink component

# Badge API

NameRequiredTypeDefault Value
taganyspan
main HTML tag name
classNamestring
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag
colorstring
defines background color of the badge
shape(pill)
set to 'pill' for pill style badge

  • Components
    • Usage
      • Features
      • API
CoreUI © 2020 creativeLabs.core-logo