Skip to content

Quickstart ​

Get Catnip running in 5 minutes. Import both @signicat/catnip-components and @signicat/catnip-css — components need the CSS package for design tokens and appearance.

1. Install ​

npm (bundler or local static server) ​

Configure the Signicat GitLab registry, then:

bash
npm install @signicat/catnip-components @signicat/catnip-css

In a micro-frontend, the shell installs and imports these packages once. Child apps do not install them — they render catnip-* tags and call window.Catnip for i18n, config, and helpers.

CDN (no npm, no bundler) ​

Load CSS and the standalone bundle from Signicat’s CDN (URL patterns in Installation — CDN):

html
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://static.signicat.com/catnip/css/latest/styles.css">
  <link rel="stylesheet" href="https://static.signicat.com/catnip/components/latest/foucPrevention.min.css">
</head>
<body>
  <catnip-button>Click me</catnip-button>
  <catnip-spinner size="48" type="default"></catnip-spinner>
  <script src="https://static.signicat.com/catnip/components/latest/catnip-components.standalone.js" defer></script>
</body>
</html>

2. Import ​

Vanilla HTML (npm) ​

html
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="node_modules/@signicat/catnip-css/dist/styles.npm.css" />
  <script type="module" src="node_modules/@signicat/catnip-components/dist/catnip-components.es.js"></script>
</head>
<body>
  <catnip-button>Click me</catnip-button>
  <catnip-spinner size="48" type="default"></catnip-spinner>
</body>
</html>

Vue 3 ​

Tell the compiler catnip-* tags are custom elements. Vite (vite.config.ts):

ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => tag.startsWith("catnip-")
        }
      }
    })
  ]
});

Nuxt: the same isCustomElement under vue.compilerOptions in nuxt.config.ts. Full copy-paste, TypeScript, and editor setup: Installation — Vue compiler.

vue
<script setup>
import "@signicat/catnip-components";
import "@signicat/catnip-css";
</script>

<template>
  <catnip-button>Save</catnip-button>
  <catnip-icon name="user" size="24" />
</template>

For reactive / non-literal props use leading-dot camelCase (.modelValue, .disabled). Do not use v-model on catnip-* hosts. See Component API — Vue 3.

Bundler (Vite, webpack, etc.) ​

js
import "@signicat/catnip-components";
import "@signicat/catnip-css";

3. Use Components ​

html
<catnip-button appearance="primary">Primary</catnip-button>
<catnip-button appearance="secondary">Secondary</catnip-button>
<catnip-icon name="tick" size="32" />

4. TypeScript and editor hints ​

Add Catnip’s window.Catnip types in an env.d.ts:

ts
/// <reference types="@signicat/catnip-components" />

For tag and attribute completion in HTML / Vue templates, point VS Code or Cursor at the generated HTML custom data:

json
{
  "html.customData": ["./node_modules/@signicat/catnip-components/dist/html-custom-data.json"]
}

Machine API (no install): /custom-elements.json on this docs host. After npm install: @signicat/catnip-components/custom-elements.json.

Next Steps ​

Catnip Design System by Signicat