Skip to Content
Kokonut UI

BT-09Buttons

Pull Cord

A lamp switch you pull on a swinging cord, built with React and a rope simulation.

Install with
no extra packages

PROPay Button and more like it are in Kokonut UI Pro

Installation

Pull Cord is a free, open-source React component in the Kokonut UI Buttons collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/pull-cord.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/pull-cord

Usage

import PullCord from "@/components/kokonutui/pull-cord";

export default function Example() {
  return <PullCord />;
}

Props

checked
boolean

Controlled state.

defaultChecked
booleanDefault true

Initial state when uncontrolled.

onCheckedChange
(checked: boolean) => void
label
stringDefault "Desk lamp"

Accessible name of the switch.

className
string

Extra classes for the root element.

Dependencies

NeedsVersionComes from
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.