Skip to content

COMPONENT / glitch-button

Glitch Button_

Outlined button whose label splits into RGB slices on hover, in short bursts. Requires @cybr/tokens and @cybr/effects.

Install

  1. 1. Map the @cybr namespace, once per project. Add this inside your components.json, or into its existing "registries" object. No components.json yet? Run npx shadcn@latest init first to create one.

    "registries": { "@cybr": "https://cybr-ui.com/r/{name}.json" }
  2. 2. Add components:

    $ npx shadcn@latest add @cybr/glitch-button

If shadcn reports Unknown registry "@cybr", step 1 is missing from that project's components.json.

Preview

Props

Component props
PropTypeDefaultDescription
type"button" | "submit" | "reset""button"Native button type. Defaults to button so it never submits a form by accident.
childrenReactNode—Label text. It is rendered once visibly and twice more as aria-hidden slice copies, so keep it to plain text or inline elements.
classNamestring—Extra classes, merged after the defaults with cn().
disabledbooleanfalseNative disabled. Shows the dashed offline style and never glitches.
...propsComponentProps<"button">—Every other native <button> attribute, ref and event handler is forwarded.

Usage

Needs both stylesheets from @cybr/tokens and @cybr/effects. After the install, import them in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
@import "../styles/cybr-effects.css";
import { GlitchButton } from "@/components/ui/glitch-button";

export function Action() {
  return <GlitchButton onClick={() => console.log("connect")}>Jack in</GlitchButton>;
}

States

Accessibility