Skip to content

Commit 0bca042

Browse files
committed
add new props
1 parent 52d6c43 commit 0bca042

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

.changeset/gold-dingos-attend.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tokens-studio/icons': patch
3+
---
4+
5+
Added support for width, height, strokeWidth prop

src/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export interface SVGRProps {
22
title?: string;
33
titleId?: string;
4+
width?: number | string;
5+
height?: number | string;
6+
strokeWidth?: number;
47
}

svgr.config.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ module.exports = {
2626
},
2727
svgProps: {
2828
'aria-hidden': '{!title}',
29+
width: '{width ?? 16}',
30+
height: '{height ?? 16}',
31+
strokeWidth: '{strokeWidth ?? 1.5}',
32+
preserveAspectRatio: 'xMidYMid meet',
33+
viewBox: '0 0 16 16',
2934
},
3035
indexTemplate,
3136
};

0 commit comments

Comments
 (0)