Skip to content

Content & Dashboard

Code Block with Copy Button

Styled pre/code block with a filename bar and a copy button with a real success state, no syntax highlighter bundled.

SubscriptionIncluded with the Velocity Components subscription.
$velocityx add code-block-copy
Props & docs

Needs a licence key — subscribe here, then velocityx loginonce.

AstroReactTailwind CSSNew

Code Block with Copy Button

Code Block with Copy Button

Live preview of the Code Block with Copy Button component

supabase.ts
export function getSupabase() {
  if (!PUBLIC_SUPABASE_URL || !PUBLIC_SUPABASE_ANON_KEY) {
    return createStubClient(); // never throw — chrome must render with no env
  }
  return createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY);
}

The code ships with Velocity.

Every component's full source — copy-paste ready, yours to edit — comes with any Velocity package. Buy once, own the code forever.

Get Velocity X — from $1,250 See all packages →

Using the Code Block with Copy Button component

Every Velocity component is plain Astro or React markup styled with Tailwind utility classes. There is no proprietary runtime and no design-system wrapper to adopt — the component inherits whatever colour and type tokens your project already defines.

Browse all →