A static grid pattern made of circles, diamonds, squares, or triangles with adjustable colors, spacing, and size. Ported from Paper Shaders (Apache-2.0).
$ npx shadcn-vue@latest add "https://nxui.geoql.in/r/paper-dot-grid.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 PaperDotGrid from '~/components/ui/paper-dot-grid/PaperDotGrid.vue';
</script>
<template>
<div class="relative h-100 w-full overflow-hidden rounded-lg">
<PaperDotGrid
:color-back="'#000000'"
:color-fill="'#ffffff'"
:color-stroke="'#ffaa00'"
:size="2"
:gap-x="32"
:gap-y="32"
:shape="'circle'"
/>
</div>
</template>
| Prop | Type | Default | Description |
|---|---|---|---|
color-back | string | '#000000' | Background color behind the shapes |
color-fill | string | '#ffffff' | Shape fill color |
color-stroke | string | '#ffaa00' | Shape stroke color |
size | number | 2 | Base size of each shape in pixels (1 to 100) |
gap-x | number | 32 | Pattern horizontal spacing in pixels (2 to 500) |
gap-y | number | 32 | Pattern vertical spacing in pixels (2 to 500) |
stroke-width | number | 0 | Outline stroke width in pixels (0 to 50) |
size-range | number | 0 | Random variation in shape size, 0 = uniform (0 to 1) |
opacity-range | number | 0 | Random variation in shape opacity, 0 = opaque (0 to 1) |
shape | 'circle' | 'diamond' | 'square' | 'triangle' | 'circle' | Shape type rendered in each grid cell |
speed | number | 0 | 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 | 1 | 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.