Docs/Fondos

Mesh Gradient

MIT

Flowing mesh gradient of soft drifting color swaths whose seams wrap through the palette

Cargando shader…

Ajústalo

5
2
0.35
0.3
0.5
0
1

Instalación

Terminal
npx shadcn@latest add https://<tu-dominio>/r/shader-mesh-gradient.json

Crea components/bastard/ShaderMeshGradient.tsx e instala shaders. Más opciones

Uso

Demo.tsx
1import ShaderMeshGradient from '@/components/bastard/ShaderMeshGradient';
2
3export default function Demo() {
4 return (
5 <ShaderMeshGradient
6 colorA="#1a0533"
7 colorB="#ffdf8e"
8 colorSpace="oklab"
9 count={5}
10 smoothness={2}
11 variation={0.35}
12 swirl={0.3}
13 drift={0.5}
14 wrapping={0}
15 speed={1}
16 />
17 );
18}

Props

PropTipoPor defectoDescripción
colorAstring"#1a0533"Color A
colorBstring"#ffdf8e"Color B
colorSpace'linear' | 'oklch' | 'oklab' | 'hsl' | 'hsv' | 'lch'"oklab"Color Space
countnumber5Points
smoothnessnumber2Smoothness
variationnumber0.35Variation
swirlnumber0.3Swirl
driftnumber0.5Drift
wrappingnumber0Wrapping
speednumber1Speed

Aquí aparecen las props ajustables. El componente acepta más: revisa el código fuente.

Créditos

Basado en Mesh Gradient · Shaders.com, adaptado para BSTRD UI.Licencia: MIT. Puedes usarlo, modificarlo y venderlo, conservando el aviso de copyright que va dentro del archivo.