Skip to content

Commit 3a92a93

Browse files
committed
update readme
1 parent 30d7ea9 commit 3a92a93

File tree

2 files changed

+63
-44
lines changed

2 files changed

+63
-44
lines changed

README.md

Lines changed: 60 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,33 @@
1+
[![Coolshapes](https://coolshap.es/react-preview.jpg)](https://coolshap.es)
12
# <p align=center>Coolshapes</p>
23
<p align="center">
34
<a href="https://github.com/realvjy/coolshapes-react/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/coolshapes-react" alt="license"></a>
45
<a href="https://www.npmjs.com/package/coolshapes-react"><img src="https://img.shields.io/npm/v/coolshapes-react" alt="npm package"></a>
56

67
</p>
78

8-
9-
### What & Why?
109
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.
1110

1211

13-
## Table of Contents
1412

15-
- [Usage](#usage)
16-
- [React](#react)
13+
### Table of Contents
14+
- [Installation](#installation)
15+
- [How to use](#how-to-use)
16+
- [Global Component](#how-to-use)
17+
- [Using Shape Category](#component-with-shape-category-example)
18+
- [Random functions](#using-random-shape-function)
19+
- [Other Methods](#other-method)
20+
- [Props](#props)
21+
- [Categories](#categories)
22+
- [Figma File](#figma-file)
1723
- [Contributing](#contributing)
18-
- [Community](#community)
19-
- [License](#license)
24+
- [License](https://github.com/realvjy/coolshapes-react?tab=MIT-1-ov-file)
2025
- [Credits](#credits)
21-
- [Sponsors](#sponsors)
22-
23-
## Usage
24-
25-
At its core, Coolshapes is a collection of [SVG](https://coolshap.es) files. This means that you can use this in all the same ways you can use SVGs (e.g. `img`, `background-image`, `inline`, `object`, `embed`, `iframe`).
26-
27-
The following are ways you can use Coolshapes.
28-
29-
3026

31-
# Coolshapes React
3227

33-
Implementation of the coolshapes icon library for react applications.
28+
## Installation
3429

3530

36-
## How to use
37-
38-
39-
Implementation of the coolshapes icon library for web applications.
40-
4131
```sh
4232
npm install coolshapes-react
4333
```
@@ -47,9 +37,13 @@ or
4737
```sh
4838
yarn add coolshapes-react
4939
```
50-
### Example
5140

52-
There's a global component and component for each category of shapes. You can pass additional props to adjust the shape. These components extend from SVG elements, so they support all the props available in a SVG element.
41+
## How to use
42+
43+
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.
44+
45+
#### Global component example
46+
Just import the Global component `Coolshape` and it will work.
5347

5448
```js
5549
import { Coolshape } from 'coolshapes-react';
@@ -61,7 +55,8 @@ const App = () => {
6155
export default App;
6256
```
6357

64-
You can import the component for specific category and simply pass the index of the shape.
58+
#### Component with shape category example
59+
You can import the component for specific category - `Star`,`Ellipse`... etc - and simply pass the index of the shape.
6560
```js
6661
import { Star } from 'coolshapes-react';
6762

@@ -71,7 +66,7 @@ const App = () => {
7166

7267
export default App;
7368
```
74-
#### Generating random shapes.
69+
#### Generating random shapes
7570
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.
7671
```js
7772
// renders a random shape from any category
@@ -84,7 +79,7 @@ const Component2 = () => {
8479
};
8580
```
8681

87-
Using random shape function.
82+
#### Using random shape function
8883
```js
8984
import { getRandomShape } from 'coolshapes-react';
9085
```
@@ -103,8 +98,8 @@ getRandomShape({onlyId: true, type:"star"}) // returns shape identifier that can
10398
// {shapeType: "star", index}
10499
```
105100

106-
#### others
107-
all the components are mapped from object that we have given you access to
101+
#### Other Methods
102+
All the components are mapped from object that we have given you access to
108103

109104
```js
110105
const shapes = {
@@ -114,7 +109,7 @@ const shapes = {
114109
}
115110
```
116111

117-
renders the shapes from all catagories
112+
#### Renders the shapes from all catagories
118113
```jsx
119114
import { shapes } from 'coolshapes-react'
120115

@@ -148,27 +143,38 @@ const StarComponent1 = starComponents[0]
148143
| `size` | _Number_ | 200 | The dimension of shape |
149144
| [`type`](#categories) | _String_ | random | The category of shapes, if left empty it would randomly select a category. |
150145
| `noise` | _Boolean_ | true | Whether to add noise to the shape or not. |
151-
| `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 |
146+
| `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. |
152147
| `random` | _Boolean_ | false | If set true it would select a random component |
153148

154-
Notes:
155-
- Index starts from number 0, so if you want to retrive the first shape of any category, you would use the index number 0.
149+
**Notes:**
150+
Index starts from number 0, so if you want to retrive the first shape of any category, you would use the index number 0.
156151

157152
### Categories
158-
159-
| type | shapes |
153+
There are a total of **115** shapes available in Coolshapes under the following categories.
154+
| name | count |
160155
| ------------- | -------- |
161-
| `star` | 12 |
156+
| `star` | 13 |
157+
| `triangle` | 14 |
158+
| `moon` | 15 |
159+
| `polygon` | 8 |
160+
| `flower` | 16 |
161+
| `rectangle` | 9 |
162162
| `ellipse` | 12 |
163+
| `wheel` | 7 |
164+
| `misc` | 11 |
165+
| `number` | 10 |
166+
167+
**Note:** If you're importing directly as component, the name must be in Title case. And the category type it will be lowercase.
168+
163169

164170

165-
### others
166-
we have have provide the `cjs`, `umd` and `es` build versions of the module,
171+
### Others
172+
There are `cjs`, `umd` and `es` included in bundled versions of the module,
167173

168174
#### cjs
169175

170176
```js
171-
const Coolshapes = reqiore("coolshapes-react")
177+
const Coolshapes = require("coolshapes-react")
172178
```
173179
using with react in the browser
174180

@@ -180,7 +186,7 @@ using with react in the browser
180186
<script src="https://unpkg.com/react@18/umd/react.development.js"></script>
181187
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
182188
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
183-
<script src="https://unpkg.com/coolshapes-react@0.0.5-alpha.1/dist/umd/coolshapes.js"></script>
189+
<script src="https://unpkg.com/coolshapes-react/dist/umd/coolshapes.js"></script>
184190
</head>
185191
<body>
186192
<div id="root"></div>
@@ -194,3 +200,16 @@ using with react in the browser
194200
</body>
195201
</html>
196202
```
203+
## Figma File
204+
Figma file coming soon on community
205+
206+
## Contributing
207+
Created by realvjy. You are always welcome to share your feedback on twitter or any social media platform.
208+
209+
If you want to contribute. Just create a [pull request](https://github.com/realvjy/coolshapes-react/pulls).
210+
211+
## Support & Donation
212+
213+
**Coffee fuels coding ☕️**
214+
215+
<a href="https://www.buymeacoffee.com/realvjy" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)