10000 feat(CBadge): add small size · JM066/coreui-react@944750e · GitHub
[go: up one dir, main page]

Skip to content

Commit 944750e

Browse files
committed
feat(CBadge): add small size
1 parent 995b9bd commit 944750e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/components/badge/CBadge.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,28 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
2727
* @type 'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string
2828
*/
2929
shape?: Shapes
30+
/**
31+
* Size the component small. [docs]
32+
*
33+
* @type 'sm'
34+
*/
35+
size?: 'sm'
3036
/**
3137
* Sets the text color of the component to one of CoreUI’s themed colors. [docs]
3238
*/
3339
textColor?: string
3440
}
3541
export const CBadge = forwardRef<HTMLDivElement | HTMLSpanElement, CBadgeProps>(
3642
(
37-
{ children, className, color, component: Component = 'span', shape, textColor, ...rest },
43+
{ children, className, color, component: Component = 'span', shape, size, textColor, ...rest },
3844
ref,
3945
) => {
4046
const _className = classNames(
4147
'badge',
4248
{
4349
[`bg-${color}`]: color,
4450
[`text-${textColor}`]: color,
51+
[`badge-${size}`]: size,
4552
},
4653
shape,
4754
className,

0 commit comments

Comments
 (0)
0