Skip to content

Commit a9674c2

Browse files
authored
fix(Badge): ability to customize mods (#402)
1 parent 4ad8c21 commit a9674c2

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/twenty-ghosts-taste.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Add ability to customize mods for the Badge component.

pnpm-lock.yaml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/content/Badge/Badge.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface CubeBadgeProps extends BaseProps, ContainerStyleProps {
4343
}
4444

4545
export const Badge = forwardRef(function Badge(allProps: CubeBadgeProps, ref) {
46-
let { type, children, ...props } = allProps;
46+
let { type, children, mods, ...props } = allProps;
4747

4848
const styles = extractStyles(props, CONTAINER_STYLES);
4949

@@ -54,6 +54,7 @@ export const Badge = forwardRef(function Badge(allProps: CubeBadgeProps, ref) {
5454
data-type={type}
5555
mods={{
5656
long: typeof children !== 'string' || children.length > 1,
57+
...mods,
5758
}}
5859
styles={styles}
5960
>

0 commit comments

Comments
 (0)