Particle Logo
NewCustomize
Logo size0.78
Auto
Color
Gap5.0px
Dot size0.60
Dot
Gather
Radius60px
Force1.00×
Speed1.0×
Size320px
Installation
npx shadcn@latest add https://uibrik.com/r/particle-logo.jsonAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/particle-logo/particle-logo.tsx"use client"; // A logo made of dots. They drift in from across the frame and gather into // the logo the first time it scrolls into view, part around the pointer like // sand and spring back when it leaves, and a press scatters them outward // before they find their way home. An image logo keeps its own colours. // Drawn on a 2D canvas in a handful of batched paths; the loop stops as soon // as every dot is at rest, sleeps off screen, and reduced motion skips straight // to the finished logo. import { useEffect, useRef, type CSSProperties, type HTMLAttributes, type PointerEvent } from "react"; import { cn } from "@/lib/utils"; import { MARK, loadImage, lowEnd, paintLogo, useDarkLook, type LogoTheme } from "../_logo/logo-kit"; export type ParticleLogoShape = "dot" | "square"; export type ParticleLogoEntrance = "gather" | "fade" | "none"; export type ParticleLogoProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & { /** Width of the frame in px; it shrinks to fit its container. */ size?: number; /** Your own logo as an SVG path `d`, drawn on a 24 × 24 grid. Defaults to the uibrik mark. */ logoPath?: string; /** Your own logo as an image URL (same-origin or CORS-enabled). Dots take its colours. */ logoSrc?: string;
Adds the files to
components/uibrik/particle-logo. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/particle-logo.Usage
import { ParticleLogo } from "@/components/uibrik/particle-logo/particle-logo";<ParticleLogo logoScale={0.78} theme="auto" color="#f4f4f5" gap={5} dotSize={0.6} shape="dot" entrance="gather" radius={60} force={1} scatter speed={1} size={320} label="Logo" // logoPath="…" // logoSrc="…"/>Props
ParticleLogo- logoScale
- Type number
- 0.78
- Logo size, as a share of the frame.
- theme
- Type "auto" | "dark" | "light"
- "auto"
- Light or dark dots when color isn't set. Auto follows the page.
- color
- Type string
- "#f4f4f5"
- Colour of the dots. Left at its default, the theme picks it.
- gap
- Type number
- 5
- Space between dots. Widened automatically on low-end devices.
- dotSize
- Type number
- 0.6
- Size of each dot, as a share of the gap.
- shape
- Type "dot" | "square"
- "dot"
- Round dots or square ones.
- entrance
- Type "gather" | "fade" | "none"
- "gather"
- How the dots arrive the first time it scrolls into view.
- radius
- Type number
- 60
- How far round the pointer the dots part. 0 turns it off.
- force
- Type number
- 1
- How hard the pointer pushes them.
- scatter
- Type boolean
- true
- A press scatters the dots outward.
- speed
- Type number
- 1
- How quickly the dots spring home.
- size
- Type number
- 320
- Width of the frame; it shrinks to fit its container.
- logoPath
- Type string
- –
- Your own logo as an SVG path d on a 24 × 24 grid. Defaults to the uibrik mark.
- logoSrc
- Type string
- –
- Your own logo as an image URL (same-origin or CORS-enabled). Dots take its colours. Overrides logoPath.
- label
- Type string
- "Logo"
- Read out to screen readers.
- className
- Type string
- –
- Classes for the frame.