• 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

Button Components

Versatile button component.




Button


Usage

Example

Sizes:
Styles:

Script


  return (
    <>
      Sizes:
      {['sm', '', 'lg'].map((size, rowKey)=>{
        return (
          <CRow key={rowKey + 'sizes'} className="d-flex justify-content-between">
            {
              ['success', 'primary', 'info', 'warning', 'danger'].map((color, key)=>{
                return (
                  <CButton
                  key={color + size}
                  color={color}
                  size={size}
                  className="m-2"
                >
                  {color}
                </CButton>
              )})
            }
          </CRow>
        )})}
        Styles:
        {[{ shape: 'square' }, { shape: 'pill' }, { variant: 'ghost' }, { variant: 'outline' }].map((style, rowKey)=>{
          return (
            <CRow key={rowKey + 'sizes'} className="d-flex justify-content-between">
              {
                ['success', 'primary', 'info', 'warning', 'danger'].map((color, key)=>{
                  return (
                    <CButton
                    key={key}
                    color={color}
                    {...style}
                    className="m-2"
                  >
                    {color}
                  </CButton>
                )})
              }
            </CRow>
          )})}
    </>
  )
  


# Button API

NameRequiredTypeDefault Value
taganybutton
main HTML tag name
classNamestring
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag
activeboolean
active state
blockboolean
applies the block style.
shapestring
shape of the button; vailable shapes: 'square', 'pill'.
variant(ghost | outline)
additional variant of the button; available variants: 'ghost', 'outline'.
colorstring
sets the background color.
disabledboolean
disabled button
onClickFunction
onClick event user action
sizestring
sets size of button; available sizes: 'sm', 'lg'
pressedboolean
button pressed state



ButtonGroup


Usage

Example


Script


  return (
    <>
      <CButtonGroup>
        <CButton color="success">Button</CButton>
        <CButton color="info">Button</CButton>
        <CButton color="primary">Button</CButton>
      </CButtonGroup>
    </>
  )
  


Wrapper component for button groups.

# ButtonGroup API

NameRequiredTypeDefault Value
classNamestring
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag
size(sm | lg)
size of buttons
verticalboolean
vertical type of group



ButtonToolbar


Usage

Example

Standard toolbar:

Justified toolbar:

Script


  return (
    <>
      Standard toolbar:
      <CButtonToolbar>
        <CButton color="success">Button</CButton>
        <CButton color="info">Button</CButton>
        <CButton color="primary">Button</CButton>
      </CButtonToolbar>
      <br />
      Justified toolbar:
      <CButtonToolbar justify="between">
        <CButton color="success">Button</CButton>
        <CButton color="info">Button</CButton>
        <CButton color="primary">Button</CButton>
      </CButtonToolbar>
    </>
  )
  


Simple button toolbar component.

# ButtonToolbar API

NameRequiredTypeDefault Value
classNamestring
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag
rolestring
role attribute (toolbar by default)
justify(start | end | between | center)
justify-content-* class



ButtonClose


Usage

Example


Script


  return (
    <CRow>
      <CCol cols="1">
        <CButtonClose/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="bg-primary close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="bg-info close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="bg-success close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="bg-warning close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="bg-danger close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="text-primary close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="text-info close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="text-success close"/>
      </CCol>
      <CCol cols="1">
        <CButtonClose buttonClass="text-danger close"/>
      </CCol>

      <CCol cols="2">
        <CButtonClose buttonClasses="text-white close bg-primary p-1">
          Close
        </CButtonClose>
      </CCol>
    </CRow>
  )
  


# ButtonClose API

NameRequiredTypeDefault Value
childrenany
children components
classNamestring
user classes for the main HTML tag
buttonClassstringclose
innerRef(object | Function | string)
ref to the main tag

  • Components
    • Usage
      • Features
      • API
    • Related
      • -Button
      • CButton
      • CButtonGroup
      • CButtonToolbar
      • CButtonClose
CoreUI © 2020 creativeLabs.core-logo