Isaiah

BJORK Slice shift

Component

About

Slice shift is a production-ready text component from BJORK UI, packaged for shadcn registries.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds BJORK Slice shift to your project and fits it to your theme.

Code

How BJORK Slice shift is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";
import { ThemeProvider as BjorkDemoThemeProvider } from "next-themes";
import { useState } from "react";
import { SliceShift, type SliceShiftTrigger } from "@/components/ui/bjork-slice-shift";

const modes = ["hover", "scroll", "loop", "words"] as const;

const sliceCounts = [5, 7, 11] as const;

const WORDS = ["Shear", "Shift", "Register", "Slice"];
function SourceDemo(){
const isPreview = false;
const previewTheme = null;
const tone = previewTheme === "light" || previewTheme === "dark" ? previewTheme : undefined;
const [mode, setMode] = useState<(typeof modes)[number]>("hover");
const [slices, setSlices] = useState<(typeof sliceCounts)[number]>(7);
const words = mode === "words";
const trigger: SliceShiftTrigger = words ? "loop" : mode;
const reset = () => {
    setMode("hover");
    setSlices(7);
  };
return <>

      <div className="flex w-[860px] max-w-full min-w-0 flex-col items-center gap-8">
        <div className="w-full min-w-0 px-2">
          <SliceShift
            key={`${mode}-${slices}`}
            text="Registration"
            words={words ? WORDS : undefined}
            trigger={trigger}
            slices={isPreview ? 6 : slices}
            tone={tone}
            fontSize={isPreview ? 168 : 136}
            freezeAt={isPreview ? 0 : undefined}
          />
        </div>
        {!isPreview ? (
          <p className="text-center text-[12px] text-current opacity-50">
            {mode === "hover"
              ? "Sweep the pointer across the word."
              : mode === "scroll"
                ? "Scroll the page."
                : mode === "loop"
                  ? "Pulses every 2.6s."
                  : "Cycles every 2.6s."}
          </p>
        ) : null}
      </div>
    
</>;
}
export default function BjorkRegistryPreview(){return <BjorkDemoThemeProvider attribute="class" defaultTheme="dark" enableSystem={false} storageKey="bjork-review-demo-theme"><div data-component-demo className="dark flex min-h-screen w-full items-center justify-center bg-[var(--bjork-bg)] p-8 text-[var(--bjork-text)]"><div className="w-full max-w-[850px]"><SourceDemo/></div></div></BjorkDemoThemeProvider>}

Dependencies

More by Isaiah

View all
  • Agent Plan

    Agent Plan

    2.2K
  • Video Scroll Hero

    Video Scroll Hero

    1.4K
  • Voice Powered Orb

    Voice Powered Orb

    1.3K
  • Reveal Text

    Reveal Text

    1.1K
  • Leads Data Table

    Leads Data Table

    935
  • Portfolio Gallery

    Portfolio Gallery

    922
  • Message Dock

    Message Dock

    833
  • Ruler Carousel

    Ruler Carousel

    617