Skip to content

COMPONENT / hazard-button

Hazard Button_

Destructive-action button framed in hazard stripes that march on hover. 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/hazard-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, shown on the dark inner plate.
classNamestring—Extra classes, merged after the defaults with cn().
disabledbooleanfalseNative disabled. Replaces the stripes with the dashed offline style.
...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 { HazardButton } from "@/components/ui/hazard-button";

export function Action() {
  return <HazardButton onClick={() => confirmPurge()}>Purge cache</HazardButton>;
}

States

Accessibility