card/CCardBody.tsx

coreui-react · packages/coreui-react/src/components/card/CCardBody.tsx · typescript · MIT
ui

Provides a styled container for the content within a card component to ensure consistent padding and layout.

// Source: https://github.com/coreui/coreui-react | License: MIT | Copyright 2026 creativeLabs Łukasz Holeczek
// Provided via justclaw.it.com; keep this notice with the code.
import React, { forwardRef, HTMLAttributes } from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'

export interface CCardBodyProps extends HTMLAttributes<HTMLDivElement> {
  /**
   * A string of all className you want applied to the base component.
   */
  className?: string
}

export const CCardBody = forwardRef<HTMLDivElement, CCardBodyProps>(
  ({ children, className, ...rest }, ref) => {
    return (
      <div className={classNames('card-body', className)} {...rest} ref={ref}>
        {children}
      </div>
    )
  }
)

CCardBody.propTypes = {
  children: PropTypes.node,
  classNa

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key