• 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

Img

Image component.


Usage

Example


Script


  return (
    <CImg
      src="https://picsum.photos/1024/480/?image=54"
      fluid
      className="mb-2"
    />
  )
  


# Features

  • Easy styling
  • Show coloured or transparent blank image (svg) if source of image is not defined. Component can be used as blank svg image permanently or until source of image is passed

# Img API

NameRequiredTypeDefault Value
tagany
main HTML tag name
className(string | any[])
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag
srcstring
src prop
width(number | string)
width of the image
height(number | string)
height of the image
blockboolean
sets display value of element to block
fluidboolean
sets fluid mode
fluidGrowboolean
sets minimum width to w-100
shapestring
image shape css class, example available classes: 'rounded': slightly rounded corners, 'rounded-top': top corners rounded, 'rounded-right': right corners rounded, 'rounded-bottom': bottom corners rounded, 'rounded-left': left corners rounded, 'rounded-circle': circle/oval
thumbnailboolean
sets thumbnail mode
align(left | right | center)
horizontal alignment
placeholderColorstringtransparent
background color

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