All components

Command Palette Button

Command Palette Button is a React and Tailwind CSS button component from Kokonut UI, licensed MIT. Copy it and paste it into your project.

Kokonut UI MIT buttons

What it is

Command Palette Button is a React and Tailwind CSS button component from Kokonut UI, licensed MIT. Copy it and paste it into your project.

How to use it

Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.

Open in the catalogue

Five free copies a month. No card.

Needs

npm i lucide-react

Licence

This component comes from Kokonut UI and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.

Command Palette Button

/components/kokonutui/command-button.tsx
import { Command } from "lucide-react";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";

/**
 * @author: @dorianbaffier
 * @description: Command Button
 * @version: 1.0.0
 * @date: 2025-06-26
 * @license: MIT
 * @website: https://kokonutui.com
 * @github: https://github.com/kokonut-labs/kokonutui
 */

export default function CommandButton({
  className,
  children,
  ...props
}: React.ButtonHTMLAttributes<HTMLButtonElement> & {
  children?: React.ReactNode;
}) {
  return (
    <Button
      {...props}
      className={cn(
        "relative p-2",
        "overflow-hidden rounded-lg",
        "bg-gradient-to-b from-zinc-50 to-zinc-100",
        "dark:from-zinc-800 dark:to-zinc-900",
        "border border-zinc-200 dark:border-zinc-800",
        "hover:border-zinc-300 dark:hover:border-zinc-700",
        "transition-all duration-300 ease-out",
        "group",
        "inline-flex items-center justify-center",
        "gap-2",
        className
      )}
    >
      <Command
        className={cn(
          "h-4 w-4",
          "text-zinc-600 dark:text-zinc-400",
          "transition-all duration-300",
          "group-hover:scale-110",
          "group-hover:rotate-[-4deg]",
          "group-active:scale-95"
        )}
      />
      <span className="text-sm text-zinc-600 dark:text-zinc-400">
        {children || "CMD + K"}
      </span>
      <span
        className={cn(
          "absolute inset-0",
          "bg-gradient-to-r from-indigo-500/0 via-indigo-500/10 to-indigo-500/0",
          "translate-x-[-100%]",
          "group-hover:translate-x-[100%]",
          "transition-transform duration-500",
          "ease-out"
        )}
      />
    </Button>
  );
}

Similar components