# Dot Grid

> A static grid pattern made of circles, diamonds, squares, or triangles with adjustable colors, spacing, and size. Ported from Paper Shaders (Apache-2.0).

<demo-paper-dot-grid>



</demo-paper-dot-grid>

## Installation

```bash
npx shadcn-vue@latest add "https://nxui.geoql.in/r/paper-dot-grid.json"
```

## Usage

```vue
<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>
```

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        color-back
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        '#000000'
      </code>
    </td>
    
    <td>
      Background color behind the shapes
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        color-fill
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        '#ffffff'
      </code>
    </td>
    
    <td>
      Shape fill color
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        color-stroke
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        '#ffaa00'
      </code>
    </td>
    
    <td>
      Shape stroke color
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        size
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        2
      </code>
    </td>
    
    <td>
      Base size of each shape in pixels (1 to 100)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        gap-x
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        32
      </code>
    </td>
    
    <td>
      Pattern horizontal spacing in pixels (2 to 500)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        gap-y
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        32
      </code>
    </td>
    
    <td>
      Pattern vertical spacing in pixels (2 to 500)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stroke-width
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Outline stroke width in pixels (0 to 50)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        size-range
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Random variation in shape size, 0 = uniform (0 to 1)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        opacity-range
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Random variation in shape opacity, 0 = opaque (0 to 1)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        shape
      </code>
    </td>
    
    <td>
      <code>
        'circle' | 'diamond' | 'square' | 'triangle'
      </code>
    </td>
    
    <td>
      <code>
        'circle'
      </code>
    </td>
    
    <td>
      Shape type rendered in each grid cell
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        speed
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Animation speed multiplier (0 freezes)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        frame
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Initial/seek frame for deterministic rendering
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        fit
      </code>
    </td>
    
    <td>
      <code>
        'none' | 'contain' | 'cover'
      </code>
    </td>
    
    <td>
      <code>
        'none'
      </code>
    </td>
    
    <td>
      How the graphic fits the canvas
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        scale
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        1
      </code>
    </td>
    
    <td>
      Overall zoom level (0.01 to 4)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        rotation
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Overall rotation in degrees (0 to 360)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        origin-x
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0.5
      </code>
    </td>
    
    <td>
      Horizontal origin for world positioning (0 to 1)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        origin-y
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0.5
      </code>
    </td>
    
    <td>
      Vertical origin for world positioning (0 to 1)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        offset-x
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Horizontal offset of the graphics center (-1 to 1)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        offset-y
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Vertical offset of the graphics center (-1 to 1)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        world-width
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Virtual world width before canvas fitting
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        world-height
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        0
      </code>
    </td>
    
    <td>
      Virtual world height before canvas fitting
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        class
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Additional CSS classes
    </td>
  </tr>
</tbody>
</table>

## Attribution

Powered by [Paper Shaders](https://github.com/paper-design/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.
