Morphiq

Docs / Get Started / Installation

Installation

Components install with the shadcn CLI. A free component needs no account and no key, so it is one command. A Pro component needs your Morphiq key, set up once per project.

Before you start

The CLI reads your project before it reaches any registry, so two files have to exist or it stops with Invalid configuration:

  • components.json — run npx shadcn@latest init -d if you do not have one
  • jsconfig.json or tsconfig.json declaring the @/* path alias

Free components

There is nothing to set up. Each component is a short name:

npx shadcn@latest add @morphiq/ascii-field
npx shadcn@latest add @morphiq/dock

The CLI finds the @morphiq namespace on its own. If yours says it does not know it, update the CLI, or add the namespace to components.json:

{
  "registries": {
    "@morphiq": "https://morphiq.prathampatel.design/r/{name}.json"
  }
}

Pro components

A Pro component needs Pro on your account, and the CLI proves it with a key. Sign in with your email (there is no password: you are emailed a code to type in), get Pro, then make a key on your account page. It is shown once, so copy it somewhere safe. Making a new one replaces the old one at once.

Put the key in an environment variable, and point the @morphiq namespace at the registry with the key as a header. Keeping the key in the environment keeps it out of git.

MORPHIQ_KEY=mq_your_key_here
{
  "registries": {
    "@morphiq": {
      "url": "https://morphiq.prathampatel.design/r/{name}.json",
      "headers": { "Authorization": "Bearer ${MORPHIQ_KEY}" }
    }
  }
}

Then install a Pro component with the same command as a free one. With the key in place, free components install exactly as before: the registry does not read the key for them.

A Pro component is refused with a message saying so until your account has Pro. A missing or replaced key is refused too. Nothing is installed in either case.

On a build server, keep the key in the CI system’s secret store and expose it as MORPHIQ_KEY for the install step. In a Dockerfile, never set it with ARG or ENV: both stay readable in the image’s layers. Use a build secret instead. Either way, keep .env.local out of git.

Look before you install

npx shadcn@latest list @morphiq
npx shadcn@latest view @morphiq/ascii-field

What lands in your project

Each component arrives as a self-contained folder under whatever your components.json alias points at. Nothing else in your project is touched, and nothing is left pointing back at us.

src/
└─ components/
   ├─ prism-glass/
   │  ├─ index.js          the import target
   │  ├─ PrismGlass.jsx    the component
   │  ├─ shader.js         GLSL: refraction, dispersion, frost, rim light
   │  └─ sdf.js            shape masks
   └─ ascii-field/
      ├─ index.js
      ├─ AsciiField.jsx
      └─ AsciiField.css

Keeping each component in its own folder is what lets its files import each other by name. It also keeps generic names like shader.js out of your components root, where they would collide with your own.

Check it worked

Build once after installing. A component that renders in isolation can still be missing a package, and the CLI reports success either way — it installs what a registry declares, so an under-declared entry produces files that will not compile.

If a build fails on a missing package straight after installing, that is our bug and not yours. Open an issue with the resolve error and we will fix the entry.

Using them

Each component installs into its own folder with an index, so the folder name alone is the import. Both of these resolve to the same file:

import AsciiField from '@/components/ascii-field'   // from anywhere
import AsciiField from './ascii-field'              // from a file beside it

The alias works wherever you import from. The relative form is shorter but depends on where your own file sits — it resolves when that file lives in the same components folder the CLI installed into.

import AsciiField from '@/components/ascii-field'

<AsciiField
  radius={51}
  speed={16}
  opacity={0.23}
  spacing={2.3}
  color="#ffffff"
  background="#071228"
/>

ASCII Field pulls in gsap and @gsap/react. The CLI installs whatever a component needs when you add it.

Dialling one in

Every prop on these pages is live. Open a component in the sidebar, set it up under Customize until it looks the way you want, then copy the snippet under Your settings — it carries every value, so what you paste is exactly what you saw. That snippet and the Code tab are open for every free component, signed in or not; a Pro component opens them once your account has Pro.