Sha256: 731041ec60c84e28e959afc546639941dea4a8e414a6b148d2400ca78e2d90f6
Contents?: true
Size: 1.06 KB
Versions: 27
Compression:
Stored size: 1.06 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props' import { spacing } from '../utilities/spacing.js' type TitleProps = { aria?: object, className?: String, children?: Array<React.ReactNode> | React.ReactNode, dark?: Boolean, data?: object, id?: String, size?: 1 | 2 | 3 | 4, tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div", text?: String, } const Title = (props: TitleProps) => { const { aria = {}, children, className, dark = false, data = {}, id, size = 3, tag = 'h3', text } = props const themeStyle = dark === true ? '_dark' : '' const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const classes = classnames(buildCss('pb_title_kit', size, themeStyle), className, spacing(props)) const Tag = `${tag}` return ( <Tag {...ariaProps} {...dataProps} className={classes} id={id} > {text || children} </Tag> ) } export default Title
Version data entries
27 entries across 27 versions & 1 rubygems