Recipes

The finishes on this site are part of Velz. You do not need another package, a custom hook, or a copied effect. Each one is a single line in your project.

Brand credit

Nav defaults to author="Veyra" and brandTransition="swipe". Hover or focus the product name and it rolls up to by Veyra. The icon-only mark stays vertically centred with both states through an inline-flex wrapper with an 8px gap.

src/app.tsx
import { Nav } from '@veyra-labs/velz/ui'

<Nav brand={<a href="/">Velz</a>} />
<Nav brand="Velz" author="Acme" brandTransition="scramble" />
<Nav brand="Velz" author={null} />

Use "swipe" for the roll or "scramble" for a text reveal. Both faces share one destination, so the rolled-in credit is clickable too. Set brandHref when a custom brand node points somewhere other than home. author= removes the credit and the mark. Override brandMark with your own icon, or brandMark= to keep the roll without a mark.

Smooth scroll

Set it once in the Vite config. Velz owns the Lenis instance, the anchor links, and the cleanup. Reduced motion turns smoothing off for you.

vite.config.ts
import { defineConfig } from 'vite'
import { velz } from '@veyra-labs/velz/vite'

export default defineConfig({
  plugins: [
    velz({ smoothScroll: { duration: 1.2, wheelMultiplier: 0.9 } }),
  ],
})

Use smoothScroll: true for the default feel, or { lerp: 0.08 } when you want a shorter glide. Use one scroll feel per site.

Depth field

Put one FieldScene at the top of a page. It is the single signature scroll moment: points move from a scattered field to a lattice, then settle into a mark. It is canvas 2D, so there is no WebGL dependency.

src/pages/index.tsx
import { FieldScene } from '@veyra-labs/velz/motion'

export default function Home() {
  return (
    <>
      <FieldScene />
      {/* the rest of the page */}
    </>
  )
}

Tune it with count, seed, damping, or scroll={false} for a still field. Override --velz-field-line, --velz-field-dot, and --velz-field-mark to match your palette.

Blur

Use glass on Nav for the floating pill, or on Section for a full-width translucent band. The blur needs a visible wash behind it, and both tokens are already in the system.

src/app.tsx
import { Nav, Section, Container } from '@veyra-labs/velz/ui'

export default function Home() {
  return (
    <>
      <Nav brand={<a href="/">Velz</a>} glass />
      <Section tone="muted" glass>
        <Container>A quiet band, not a card.</Container>
      </Section>
    </>
  )
}

Keep blur on bands and controls. Do not stack a blurred card inside a blurred band.

Copyable code

Add copy to any CodeBlock, or place a CopyButton on its own. Both are 44 by 44, name themselves for screen readers, and show a short Copied state.

src/pages/start.tsx
import { CodeBlock, CopyButton } from '@veyra-labs/velz/ui'

<CodeBlock file="terminal" code="npm install" copy />
<CopyButton value="npm install" label="Copy install command" />

One page, all four

Start a page with the scaffold, then add only the finishes it needs. The linter keeps the spacing, tone order, and motion budget honest.

terminal
velz scaffold page about --blocks hero-minimal,features-grid,faq-accordion
velz check --json