You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple, fun project for the sake of creating some cool-looking abstract shapes with little grainy gradients crafted by [@realvjy](https://x.com/realvjy). Coolshapes is a completely open-source set of 100+ abstract shapes crafted for any design and development projects. Free for both commercial and personal use. Licensed under MIT.
10
+
A simple, fun project for the sake of creating some cool-looking abstract shapes with little grainy gradients crafted
11
+
by [@realvjy](https://x.com/realvjy). Coolshapes is a completely open-source set of 100+ abstract shapes crafted for any
12
+
design and development projects. Free for both commercial and personal use. Licensed under MIT.
-[Accessing the shapes object](#renders-the-shapes-from-all-catagories)
26
+
-[Props](#props)
27
+
-[Categories](#categories)
28
+
-[Others](#others)
29
+
-[Classname and css](#classnames-and-css)
30
+
-[Builds](#builds)
31
+
-[Figma File](#figma-file)
32
+
-[Credits](#credits)
33
+
-[Contributing](#contributing)
34
+
-[Support \& Donation](#support--donation)
33
35
34
36
## Installation
35
37
@@ -45,7 +47,8 @@ yarn add coolshapes-react
45
47
46
48
## How to use
47
49
48
-
There are two types of components available in **Coolshapes**, which you can use: **Global component** and **Component with a category of shapes**. Then, you can pass additional [props](#props) to adjust the shapes and their properties available on Coolshapes SVG elements.
50
+
There are two types of components available in **Coolshapes**, which you can use: **Global component** and **Component
51
+
for each category of shapes**. and, you can pass additional [props](#props) to adjust the shapes.
49
52
50
53
#### Global component example
51
54
@@ -55,7 +58,7 @@ Just import the Global component `Coolshape` and it will work.
@@ -69,30 +72,29 @@ You can import the component for specific category - `Star`,`Ellipse`... etc - a
69
72
import { Star } from"coolshapes-react";
70
73
71
74
constApp= () => {
72
-
return<Star index={0} size={48}/>;
75
+
return<Star index={0} size={48}/>;
73
76
};
74
77
75
78
exportdefaultApp;
76
79
```
77
80
78
-
79
81
#### Generating random shapes
80
82
81
-
setting the `random`[prop](#props) to true or leaving the `index` or `type` prop empty would replace the shape with a random shape every time it renders.
83
+
setting the `random`[prop](#props) to true or leaving the `index` or `type` prop empty would replace the shape with a
|[`type`](#categories)|_String_| random | The category of shapes, if left empty it would randomly select a category. |
165
-
|`noise`|_Boolean_| true | Whether to add noise to the shape or not. |
166
-
|`index`|_Number_| random | The index of shape within the shape [category](#categories), it will randomly select a shape from the category if type prop given. Start from 0. |
167
-
|`random`|_Boolean_| false | If set true it would select a random component |
|[`type`](#categories)|_String_| random | The category of shapes, if left empty it will randomly select a category.|
168
+
|`noise`|_Boolean_| true | Whether to add noise to the shape or not. |
169
+
|`index`|_Number_| random | The index of shape within the shape [category](#categories), it would randomly select a shape from the category if type prop given. index starts from 0. |
170
+
|`random`|_Boolean_| false | If set true it will select a random component|
168
171
169
-
**Notes:**
170
-
Index starts from number 0, so if you want to retrive the first shape of any category, you would use the index number 0.
172
+
#### notes
173
+
> Index starts from number 0, so if you want to retrieve the first shape of any category, you would use the index number 0.
171
174
175
+
> The shapes are SVG components behind the hood, so it's also supports all the props that can be passed in a svg element.
172
176
### Categories
173
177
174
178
There are a total of **115** shapes available in Coolshapes under the following categories.
175
-
| name | count |
176
-
| ------------- | -------- |
177
-
|`star`| 13 |
178
-
|`triangle`| 14 |
179
-
|`moon`| 15 |
180
-
|`polygon`| 8 |
181
-
|`flower`| 16 |
182
-
|`rectangle`| 9 |
183
-
|`ellipse`| 12 |
184
-
|`wheel`| 7 |
185
-
|`misc`| 11 |
186
-
|`number`| 10 |
187
-
188
-
**Note:** When importing the components the name would be capitalized, but when passing as prop, the name would be lower case.
189
179
180
+
| name | count |
181
+
|-------------|-------|
182
+
|`star`| 13 |
183
+
|`triangle`| 14 |
184
+
|`moon`| 15 |
185
+
|`polygon`| 8 |
186
+
|`flower`| 16 |
187
+
|`rectangle`| 9 |
188
+
|`ellipse`| 12 |
189
+
|`wheel`| 7 |
190
+
|`misc`| 11 |
191
+
|`number`| 10 |
192
+
193
+
**Note:** While passing the category name in the component, the name will be in lower case.
190
194
191
195
### Others
192
196
193
-
#### Name & Class
194
-
All components have inbuilt name starting 1. But, index starts from 0.
195
-
*Example: `<Star index={0} />` when rendered it's component name and class name is `Star1`*
197
+
#### ClassNames and css
196
198
197
-
#### umd & es
198
-
There are `umd` and `es` included in bundled version of the module,
199
+
all the components have classname `coolshapes` assigned as default, but you can also pass custom classname of yours.
200
+
```jsx
201
+
import { Star } from'coolshapes-react';
202
+
203
+
exportconstShape= () => {
204
+
return(
205
+
<Star className={"myshape"}/>
206
+
)
207
+
}
208
+
```
209
+
```scss
210
+
// make the shapes size responsive similar to img elements.
211
+
.coolshapes{
212
+
width: 100%;
213
+
max-height: 48px;
214
+
}
215
+
```
216
+
#### Builds
217
+
218
+
We have given `umd`, `es` and `cjs` versions of the build.
0 commit comments