Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gradient-react

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gradient-react

create gradients easily

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by700%
Maintainers
0
Weekly downloads
 
Created
Source

gradient-react

Website

English

gradient-react is a React component library that simplifies the creation of gradient elements. It includes components like GradientCircle, GradientContent, and GradientContain to help you design attractive user interfaces with gradients easily.


Installation

npm install gradient-react

or you can use yarn

yarn add gradient-react

Usage Example

Example

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>
);

Components

GradientCircle

The GradientCircle component allows you to create circles with custom gradients.

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{}

GradientContent

GradientContent is used to wrap content within an area with a gradient background.

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{}

GradientContain

GradientContain is a container that can house multiple components with gradients.

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{}

Contributing

If you would like to contribute to this library, you're welcome!

Spanish

gradient-react es una librería de componentes React que facilita la creación de elementos con gradientes. Incluye componentes como GradientCircle, GradientContent y GradientContain para ayudarte a diseñar interfaces de usuario atractivas con gradientes de manera sencilla.


Instalación

npm install gradient-react

o puedes usar yarn

yarn add gradient-react

Ejemplo de uso

Example

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>Título de la sección</h2>
			<p>Texto genérico</p>
		</GradientContent>
	</GradientContain>
);

Componentes

GradientCircle El componente GradientCircle te permite crear círculos con gradientes personalizados.

import { GradientCircle } from 'gradient-react';
import { GradientCircle } from 'gradient-react';

const MyComponent = () => (
	<GradientCircle
		color1='#7701cc'
		color2='#01a7cc'
		width='350px'
		height='350px'
		styles={{
			left: '130px',
			top: '300px',
		}}
	/>
);
PropiedadDescripciónValor por Defecto
color1Color del centro del círculo'#ED0101'
color2Color del borde exterior del círculo'#CC2A01'
widthAncho del círculo'200px'
heightAltura del círculo'200px'
blurIntensidad del desenfoque del círculo'80'
stylesEstilos CSS aplicados al contenedor{}

GradientContent

GradientContent se utiliza para envolver contenido dentro de un área con un fondo de gradiente.

import { GradientContent } from 'gradient-react';

const MyComponent = () => (
	<GradientContent
		styles={{
			display: 'flex',
			flexDirection: 'column',
			alignContent: 'center',
			justifyContent: 'center',
			width: '100%',
		}}
	>
		<h2>Título de la sección</h2>
		<p>Texto genérico</p>
	</GradientContent>
);
PropiedadDescripciónValor por Defecto
stylesEstilos CSS aplicados al contenedor{}

GradientContain

GradientContain es un contenedor que puede albergar varios componentes con gradientes.

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>Título de la sección</h2>
			<p>Texto genérico</p>
		</GradientContent>
	</GradientContain>
);
PropiedadDescripciónValor por Defecto
stylesEstilos CSS aplicados al contenedor{}

Contribuir

Si quieres contribuir a esta librería, ¡te damos la bienvenida!



Keywords

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc