UNPKG

react-kube

Version:

Kube CSS in React Components

30 lines (24 loc) 686 B
import React from "react"; import classNames from "classnames"; class Label extends React.Component { render() { let styles = classNames({ "label": true, "label-outline": this.props.outline }); styles += this.props.color ? " label-" + this.props.color : ""; return ( <span className={classNames(this.props.className, styles)} style={this.props.style}> {this.props.children} </span> ); } } Label.propTypes = { children: React.PropTypes.node, className: React.PropTypes.string, color: React.PropTypes.oneOf(["black", "blue", "red", "yellow", "green", "white"]), outline: React.PropTypes.bool, style: React.PropTypes.object }; module.exports = Label;