Sha256: 23b55d74aee17ed86d15f686b5c898208a5403478996735df40fdd86afbcc614

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

/* @flow */

import React from 'react'
import classnames from 'classnames'
import { buildCss } from '../utilities/props'

type CaptionProps = {
  className?: String,
  children: Array<React.ReactNode> | React.ReactNode,
  dark?: Boolean,
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl',
  tag: String,
  text: String,
}

const Caption = ({
  className,
  children,
  dark = false,
  size = 'md',
  tag = 'div',
  text,
}: CaptionProps) => {
  const Tag = `${tag}`

  const css = classnames(className, buildCss('pb_caption_kit', size, {
    'dark': dark,
  }))

  return (
    <Tag className={css}>
      {text || children}
    </Tag>
  )
}

export default Caption

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
playbook_ui-3.2.0 app/pb_kits/playbook/pb_caption/_caption.jsx