Button · Solid

A variant of Button - filled block, no border, high contrast.
Installation
Expand

npx @left4code/cosmic-ui-cli@latest add button-03
 
Expand

This writes the component and everything it imports, then installs the packages it needs. Run npx @left4code/cosmic-ui-cli@latest initfirst if you haven't already.

No state machine, no Frame - this is a plain styled button element, deliberately a different visual language from the default Button rather than another shape/color combination of it. Or copy and paste the code below by hand.

components/ui/button-03.tsx
Expand

import { twMerge } from "tailwind-merge";

function Button03({ className, children, ...props }: React.ComponentProps<"button">) {
  return (
    <button
      {...props}
      className={twMerge([
        "px-6 py-2.5 font-medium cursor-pointer border border-primary bg-primary text-primary-foreground transition-colors",
        "hover:bg-primary/90",
        "disabled:opacity-40 disabled:pointer-events-none",
        className,
      ])}
    >
      {children}
    </button>
  );
}

export { Button03 };
 
Expand

Update the import paths to match your project setup.

Usage
Expand

import { Button03 } from "@/components/ui/button-03";
 
Expand
Expand

<Button03>Get Started</Button03>
 
Expand
Powered by synthetic caffeine · Deployed by Left4code · Signal traceable on GitHub.