Dot Pattern Component
This component generates a scalable dot pattern background that automatically adapts to dark and light modes, enhancing the visual design of your application. Using the DotPattern
component in your project is straightforward and customizable.
Usage
To use the DotPattern
component in your project, simply import it as shown below:
Source Code
You can create the DotPattern
component in @/app/components/DotPattern.tsx
using the following structure:
Props
Prop Name | Type | Default | Description |
---|---|---|---|
width | number | 16 | The width of the repeating pattern unit in the SVG. |
height | number | 16 | The height of the repeating pattern unit in the SVG. |
x | number | 0 | The x-coordinate for the starting point of the pattern. |
y | number | 0 | The y-coordinate for the starting point of the pattern. |
cx | number | 1 | The x-coordinate of the center of the circle in the pattern. |
cy | number | 1 | The y-coordinate of the center of the circle in the pattern. |
cr | number | 1 | The radius of the circle in the pattern. |
className | string | None | Additional CSS classes to apply to the SVG for custom styling. |
...props | any | None | Additional SVG properties that can be passed for further control. |