MCPcopy Index your code
hub / github.com/reactstrap/reactstrap / Badge

Function Badge

src/Badge.js:26–52  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

24};
25
26function Badge(props) {
27 let {
28 className,
29 cssModule,
30 color = 'secondary',
31 innerRef,
32 pill = false,
33 tag: Tag = 'span',
34 ...attributes
35 } = props;
36
37 const classes = mapToCssModules(
38 classNames(
39 className,
40 'badge',
41 'bg-' + color,
42 pill ? 'rounded-pill' : false,
43 ),
44 cssModule,
45 );
46
47 if (attributes.href && Tag === 'span') {
48 Tag = 'a';
49 }
50
51 return <Tag {...attributes} className={classes} ref={innerRef} />;
52}
53
54Badge.propTypes = propTypes;
55

Callers

nothing calls this directly

Calls 1

mapToCssModulesFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…