Giter VIP home page Giter VIP logo

react-awesome-shapes's Introduction

preview

React Awesome Shapes

πŸŒ€ Insert Awesome Shapes into Your React Site with Ease.

NodeJS NPM code style: prettier
Netlify Status License Maintenance Website Price

Loved the project? Please consider donating to help it improve!

Consider following DevSense on YouTube.

If you want to discuss about something, then you can ask on official Discord Server.

⭐ Star us on GitHub β€” it helps!

Getting Started 🎬

The easiest way to use one of the shapes from Awesome Shapes is to install the NPM package and import the particular shape to use it.

Install NPM Package

npm install react-awesome-shapes

Import And Use

import { ShapeName } from "react-awesome-shapes";
...
function ShapeComponent(props) {
    return (
        ...
        <ShapeName {...passParametersToCustomise} />
        ...
    );
}

export default ShapeComponent;

The shapes are very easier to import and use wherever you want and in any web framework that uses NPM.
You can set different sizes of different variety of shapes by passing props.

Read the complete in detail documentation in the Usage section.

Usage

Currently, the package contains shapes: Circle, Donut, CircleGrid, Diamond, PolygonCard, Polygon, Star, Cross, Heart, SquareDonut, Arrow, Message.

All of the shapes currently present in the package are made responsive and the responsiveness is customisable too. To do that, one of the prop to each shape component is breakpoints which is an array of numbers. It represents the breakpoints in which you will define the responsiveness. By default, breakpoints are defined as [600, 900, 1200]. So, you can pass array of 4 elements for size prop which corresponds to <=600, 600<size<=900, 900<size<=1200, >1200. Similarly, you can pass other props in form of array if you want to define different sizes for different breakpoints. You can see list of props corresponding to each shape in the respective implementation file linked above with shape.

By default, all the shapes have position: absolute; so that you can define the coordinates to put the shapes to exact position. But you can change the position attribute in case you want.

Basic usage of the Shape in your react site is illustrated on the project website.

License πŸ“„

This project is licensed under the MIT License - see the LICENSE.md file for details. You can use this project for personal as well as commercial purposes. But if you think you have modified the project and built something really good, we will humbly request you to raise the pull request and share with the opensource community.

Contributing πŸ’‘

β€ŒAwesome Shapes is created with the help of what is available for free on the internet and hence it will always be available for free. This makes it an open source project and everyone are welcome to contribute to different aspects of the project.

You may want to contribute on adding new shapes, fixing bugs, improving/refactoring code etc.

If you can help us with these, please don't hesitate to open a pull request or an issue. If you want to know about how to create pull request, then please refer to this youtube playlist.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Ashutosh Hathidara

πŸ’» 🎨 πŸ“– πŸ€” 🚧 πŸ”¬

Sachin Chaurasiya

πŸ“– πŸ’» πŸ€” πŸ“¦

Mohit Khairnar

πŸ€” πŸ’» 🎨 πŸ“–

anaghaachakrapani

🎨 πŸ€”

Aman Sethi

πŸ’»

judy-n

πŸ’»

Julien Bertazzo Lambert

πŸ’»

OM GAWANDE

πŸ’» πŸ€”

Shailesh Parmar

πŸ’»

sskanishk

πŸ’»

Jude

πŸ“–

Bilal Essofyany

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

References πŸ‘πŸ»

Gatsby Themes by @LekoArts was the biggest inspiration for this project.

react-awesome-shapes's People

Contributors

allcontributors[bot] avatar amansethi00 avatar ashutosh1919 avatar essofyany avatar jlambertazzo avatar judesafo avatar judy-n avatar mohittk avatar sachin-chaurasiya avatar shaileshparmar11 avatar spyware007 avatar sskanishk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-awesome-shapes's Issues

Remove Triangle, Square and Hexagon

Since we now have Polygon as generalized shape, we can remove Triangle, Square and Hexagon since they are not adding much to the project.

Refactor folder structure and rename some files.

Currently, we have a basic folder structure and we are adding every component to the component folder. We need to separate common and layout components into separate folders.
Also, we need to rename some files and change the file extension according to what value the file contains.

Cross Shape

I can add a cross (X) shape.
Please Assign it to me!

Decouple Web app & Package

As of now, we have a single package.json file which is used both by NPM package and website. There are some heavy packages like react-live which are not used by NPM package but still contained in the final package build and thus increasing its size. We want to decouple both the things to make it lighter.

diamond to square

I am trying to use the diamond shape but it's converted into a square. Actually, I am using className prop on the component for adding some cool animations.
It stays for some time as a diamond and then it jumps back to square as shown in the image below!
Screenshot 2022-03-02 at 7 58 53 PM

Screenshot 2022-03-02 at 7 58 26 PM

Screenshot 2022-03-02 at 7 58 21 PM

Pass props to animate the shapes

We can create an directory of animations which will contains CSS animations which can be added to any shape by passing the appropriate props names to the shape component!

Message Shape

can add message box kind of shape.
pls assign to me!

Add CI to check for linting issues.

We have added a commit hook to catch and fix issues like

  • Code formatting
  • Code Smells
  • Unwanted codes

We should also add CI to check for linting issues on every PR and commit.

Polygon shape

We could include a general polygon shape where a sides=(3-10) prop would determine the number of sides. Based on that prop users would see
3-triangle
4-square
5-pentagon
...

Add engines node in the package.json

As our project is OpenSource and different people with different platforms will contribute to the project. they will have different npm and node versions. whenever they will install the dependencies package-lock.json will change because of different npm versions, we can prevent this behaviour by adding the engines node in the package.json file.

PS: This only advises the user to use the specified version for this project.

Heart Shape

I can add a heart shape
please assign it to me

Create seperate folder for constants

Creating a seperate folder called shapes/data which will contain all constants related files in that. For example polygonPaths.tsx used for Polygon should be in there. The PR for new Star shape is open and that also have clip-path. In future, we may get many such shape paths that we want to store and storing them in same dir is not good.

Requires an old version of Node

I'm trying to install the lib in my personal project but it seems require a very old node version:

error [email protected]: The engine "node" is incompatible with this module. Expected version "^16.14.0". Got "18.17.0"

Remove react-responsive

Currently react-responsive takes 26% of the total size of the package. If we can remove the package, it will greatly reduce the size of the package. The alternative of react-responsive will be to build custom JS code that will check the screen size where it is executing and will select the value from the breakpoint array.

Star Shape

I can add a star shape! Please assign it to me.

onHover the square background appears to change color

When I tried to use a simple color-changing effect on any shape the background container of the shape also changes color.
I am trying to make an effect on hover to change the color!

Screen.Recording.2022-03-24.at.3.05.53.PM.mov

Screenshot 2022-03-24 at 3 08 20 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.