Gradient React Component

Create gradients easily
npm install gradient-react
Created by Federico Minatta

Usage

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 import { GradientCircle, GradientContent, GradientContain, } from 'gradient-react'; const MyComponent = () => ( <GradientContain styles={{ width: '500px', maxWidth: '100%' }}> <GradientCircle color1='#01ccc9' color2='#01a7cc' blur='70' width='250px' height='250px' /> <GradientCircle color1='#eb0ea1' blur='50' color2='#cc0101' width='300px' height='300px' /> <GradientContent> <h3>Title</h3> <p>Description</p> </GradientContent> </GradientContain> );

Title

Description

Components

Gradient Circle

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import { GradientCircle } from 'gradient-react'; const MyComponent = () => ( <GradientCircle color1="#7701cc" color2="#01a7cc" width="350px" height="350px" styles={{ left: '130px', top: '300px', }} /> );
PropertyDescriptionDefault Value
color1The color of the circle's center '#ED0101'
color2The color of the circle's outer edge'#CC2A01'
widthThe width of the circle'200px'
heightThe height of the circle'200px'
blurThe intensity of the circle's blur'80'
stylesCSS styles applied to the container{}

Gradient Content

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import { GradientContent } from 'gradient-react'; const MyComponent = () => ( <GradientContent styles={{ display: 'flex', flexDirection: 'column', alignContent: 'center', justifyContent: 'center', width: '100%', }} > <h2>Section Title</h2> <p>Generic text</p> </GradientContent> );
PropertyDescriptionDefault Value
stylesCSS styles applied to the container{}

Gradient Contain

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 import { GradientContain, GradientCircle, GradientContent } from 'gradient-react'; const MyComponent = () => ( <GradientContain styles={{ margin: '100px', padding: '20px' }}> <GradientCircle color1="#7701cc" color2="#01a7cc" width="350px" height="350px" /> <GradientCircle color1="#eb540e" blur="50" color2="#cc0101" width="450px" height="450px" /> <GradientContent> <h2>Section Title</h2> <p>Generic text</p> </GradientContent> </GradientContain> );
PropertyDescriptionDefault Value
stylesCSS styles applied to the container{}