Voronoi cell diagram with configurable colors, glow, gap width, and organic distortion. Ported from Paper Shaders (Apache-2.0).
$ npx shadcn-vue@latest add "https://nxui.geoql.in/r/paper-voronoi.json"Keep in mind
This component is inspired by various open-source projects and patterns. Please verify licenses and implementation details before using in production.
<script setup lang="ts">
import PaperVoronoi from '~/components/ui/paper-voronoi/PaperVoronoi.vue';
</script>
<template>
<div class="relative h-100 w-full overflow-hidden rounded-lg">
<PaperVoronoi
:colors="['#ff8247', '#ffe53d']"
:distortion="0.4"
:glow="0.3"
:scale="0.5"
/>
</div>
</template>
| Prop | Type | Default | Description |
|---|---|---|---|
colors | string[] | ['#ff8247', '#ffe53d'] | Up to 5 colors used for cells and gradients |
steps-per-color | number | 3 | Step granularity within each color band (1 to 10) |
color-glow | string | '#ffffff' | Glow color blending into cell edges |
color-gap | string | '#2e0000' | Color of the gaps between cells |
distortion | number | 0.4 | Strength of organic distortion (0 to 1) |
gap | number | 0.04 | Width of the gap between cells (0 to 0.1) |
glow | number | 0 | Strength of the glow between cells (0 to 1) |
speed | number | 0.5 | Animation speed multiplier (0 freezes) |
frame | number | 0 | Initial/seek frame for deterministic rendering |
fit | 'none' | 'contain' | 'cover' | 'none' | How the graphic fits the canvas |
scale | number | 0.5 | Overall zoom level (0.01 to 4) |
rotation | number | 0 | Overall rotation in degrees (0 to 360) |
origin-x | number | 0.5 | Horizontal origin for world positioning (0 to 1) |
origin-y | number | 0.5 | Vertical origin for world positioning (0 to 1) |
offset-x | number | 0 | Horizontal offset of the graphics center (-1 to 1) |
offset-y | number | 0 | Vertical offset of the graphics center (-1 to 1) |
world-width | number | 0 | Virtual world width before canvas fitting |
world-height | number | 0 | Virtual world height before canvas fitting |
class | string | — | Additional CSS classes |
Powered by Paper Shaders
(© Lost Coast Labs, Inc., Apache-2.0) via the framework-agnostic
@paper-design/shaders package driven by a Vue 3 mount. This is an
unofficial community port; it is not maintained by Paper.