@@ -15,7 +15,7 @@ import {
15
15
CRow ,
16
16
CTabContent ,
17
17
CTabPane } from ' @coreui/react/src/index'
18
- import CIcon from ' @coreui/icons-react'
18
+ import { CIcon , CIconSvg } from ' @coreui/icons-react/src/index '
19
19
import { cilList , cilShieldAlt } from ' @coreui/icons'
20
20
import * as icon from ' @coreui/icons' ;
21
21
@@ -44,8 +44,8 @@ Import react icons using one of these two options:
44
44
To use a single react icon, import the ` <CIcon> ` component and the desired icon(s) from the ` @coreui/icons ` library. Then, include the ` <CIcon> ` component in your code and specify the icon prop with the imported icon variable. Additionally, you can set the desired size for the icon using the ` size ` prop.
45
45
46
46
<Example >
47
- <CIcon icon = { cilList } size = " xl" />
48
- <CIcon icon = { cilShieldAlt } size = " xl" />
47
+ <CIcon icon = { cilList } size = " xl" />
48
+ <CIcon icon = { cilShieldAlt } size = " xl" />
49
49
</Example >
50
50
51
51
``` jsx
@@ -108,13 +108,68 @@ Set heights of react icons using size property like size="lg" and size="sm".
108
108
109
109
``` jsx preview
110
110
< CIcon icon= {cilList} size= " sm" / >
111
- < CIcon icon= {cilList} size = " md " / >
111
+ < CIcon icon= {cilList} / >
112
112
< CIcon icon= {cilList} size= " lg" / >
113
113
< CIcon icon= {cilList} size= " xl" / >
114
114
< CIcon icon= {cilList} size= " xxl" / >
115
115
< CIcon icon= {cilList} size= " 3xl" / >
116
116
```
117
117
118
+ ### Custom SVG Icons
119
+
120
+ The ` <CIconSvg ` > component allows you to add custom SVG icons to your application. In case you want to use custom SVG icons, this component provides the flexibility to include bespoke SVG graphics that align with your design requirements.
121
+
122
+ <Example >
123
+ <CIconSvg size = " 4xl" >
124
+ <svg
125
+ viewBox = " 0 0 102 116"
126
+ version = " 1.1"
127
+ xmlns = " http://www.w3.org/2000/svg"
128
+ xmlnsXlink = " http://www.w3.org/1999/xlink"
129
+ >
130
+ <g stroke = " none" strokeWidth = { 1 } fill = " none" fillRule = " evenodd" >
131
+ <g fill = " #3C4B64" fillRule = " nonzero" >
132
+ <path
133
+ d = " M96,25.091 L57,2.5743 C53.2871871,0.430706461 48.7128129,0.430706461 45,2.5743 L6,25.091 C2.292246,27.239646 0.00690676667,31.1979678 0,35.4833 L0,80.5167 C0.00688629146,84.8020377 2.29223099,88.760369 6,90.909 L45,113.4256 C48.7127742,115.569338 53.2872258,115.569338 57,113.4256 L96,90.909 C99.707769,88.760369 101.993114,84.8020377 102,80.5167 L102,35.4833 C101.993093,31.1979678 99.707754,27.239646 96,25.091 Z M94,80.5167 C94,81.9457261 93.2375729,83.266187 92,83.9807 L53,106.4974 C51.7623957,107.211931 50.2376043,107.211931 49,106.4974 L10,83.9807 C8.76242713,83.266187 8,81.9457261 8,80.5167 L8,35.4833 C8,34.0542382 8.76239619,32.7337309 10,32.0192 L49,9.5025 C50.2376043,8.78796882 51.7623957,8.78796882 53,9.5025 L92,32.0192 C93.2376038,32.7337309 94,34.0542382 94,35.4833 L94,80.5167 Z"
134
+ id = " Shape"
135
+ />
136
+ <path
137
+ d = " M74.0216,71.0379 L71.1556,71.0379 C70.4827717,71.0379163 69.8208181,71.2076524 69.231,71.5314 L51.95,81.0167 L32,69.4981 L32,46.5206 L51.95,35.002 L69.2394,44.457 C69.8278903,44.7788245 70.4878603,44.9474965 71.1586,44.9475 L74.0218,44.9475 C75.1263695,44.9475 76.0218,44.0520695 76.0218,42.9475 L76.0218,40.2357 C76.0218,39.5046907 75.6230914,38.8318844 74.9818,38.481 L55.793,27.9854 C53.3404536,26.651551 50.3714915,26.6856213 47.9502,28.0754 L28,39.5929 C25.5282949,41.025705 24.0048155,43.6646378 24,46.5216 L24,69.4976 C24,72.3557593 25.5247614,74.9968204 28,76.4259 L47.95,87.9444 C50.3719491,89.3331078 53.3408366,89.3663802 55.7933,88.0323 L74.9833,77.5012 C75.623333,77.1499602 76.021125,76.4778764 76.0211,75.7478 L76.0211,73.0378 C76.0210448,71.9334648 75.1259352,71.0381761 74.0216,71.0379 L74.0216,71.0379 Z"
138
+ id = " Path"
139
+ />
140
+ </g >
141
+ </g >
142
+ </svg >
143
+ </CIconSvg >
144
+ </Example >
145
+
146
+ ``` jsx
147
+ import { CIconSvg } from ' @coreui/icons-react' ;
148
+
149
+ ...
150
+ < CIconSvg size= " 4xl" >
151
+ < svg
152
+ viewBox= " 0 0 102 116"
153
+ version= " 1.1"
154
+ xmlns= " http://www.w3.org/2000/svg"
155
+ xmlnsXlink= " http://www.w3.org/1999/xlink"
156
+ >
157
+ < g stroke= " none" strokeWidth= {1 } fill= " none" fillRule= " evenodd" >
158
+ < g fill= " #3C4B64" fillRule= " nonzero" >
159
+ < path
160
+ d= " M96,25.091 L57,2.5743 C53.2871871,0.430706461 48.7128129,0.430706461 45,2.5743 L6,25.091 C2.292246,27.239646 0.00690676667,31.1979678 0,35.4833 L0,80.5167 C0.00688629146,84.8020377 2.29223099,88.760369 6,90.909 L45,113.4256 C48.7127742,115.569338 53.2872258,115.569338 57,113.4256 L96,90.909 C99.707769,88.760369 101.993114,84.8020377 102,80.5167 L102,35.4833 C101.993093,31.1979678 99.707754,27.239646 96,25.091 Z M94,80.5167 C94,81.9457261 93.2375729,83.266187 92,83.9807 L53,106.4974 C51.7623957,107.211931 50.2376043,107.211931 49,106.4974 L10,83.9807 C8.76242713,83.266187 8,81.9457261 8,80.5167 L8,35.4833 C8,34.0542382 8.76239619,32.7337309 10,32.0192 L49,9.5025 C50.2376043,8.78796882 51.7623957,8.78796882 53,9.5025 L92,32.0192 C93.2376038,32.7337309 94,34.0542382 94,35.4833 L94,80.5167 Z"
161
+ id= " Shape"
162
+ / >
163
+ < path
164
+ d= " M74.0216,71.0379 L71.1556,71.0379 C70.4827717,71.0379163 69.8208181,71.2076524 69.231,71.5314 L51.95,81.0167 L32,69.4981 L32,46.5206 L51.95,35.002 L69.2394,44.457 C69.8278903,44.7788245 70.4878603,44.9474965 71.1586,44.9475 L74.0218,44.9475 C75.1263695,44.9475 76.0218,44.0520695 76.0218,42.9475 L76.0218,40.2357 C76.0218,39.5046907 75.6230914,38.8318844 74.9818,38.481 L55.793,27.9854 C53.3404536,26.651551 50.3714915,26.6856213 47.9502,28.0754 L28,39.5929 C25.5282949,41.025705 24.0048155,43.6646378 24,46.5216 L24,69.4976 C24,72.3557593 25.5247614,74.9968204 28,76.4259 L47.95,87.9444 C50.3719491,89.3331078 53.3408366,89.3663802 55.7933,88.0323 L74.9833,77.5012 C75.623333,77.1499602 76.021125,76.4778764 76.0211,75.7478 L76.0211,73.0378 C76.0210448,71.9334648 75.1259352,71.0381761 74.0216,71.0379 L74.0216,71.0379 Z"
165
+ id= " Path"
166
+ / >
167
+ < / g>
168
+ < / g>
169
+ < / svg>
170
+ < / CIconSvg>
171
+ ...
172
+ ```
118
173
119
174
## Accessibility
120
175
@@ -317,4 +372,8 @@ So if you need more icons our PRO package will be a great choice for you.
317
372
318
373
### CIcon
319
374
320
- ` markdown:CIcon.api.mdx `
375
+ ` markdown:CIcon.api.mdx `
376
+
377
+ ### CIconSvg
378
+
379
+ ` markdown:CIconSvg.api.mdx `
0 commit comments