Shake Demo
8starlabs-ui/shake-demoFreeExample
A shake demo component
Install it
npx shadcn@latest add https://ui.8starlabs.com/r/shake-demo.jsonSource
1"use client";23import { useState } from "react";4import Shake from "../blocks/shake";56export default function ShakeDemo() {7 const [code, setCode] = useState("");8 const [errors, setErrors] = useState(0);910 return (11 <form12 onSubmit={(e) => {13 e.preventDefault();14 if (code !== "1234") {15 setErrors((n) => n + 1);16 setCode("");17 }18 }}19 >20 <Shake signal={errors} className="flex flex-col items-center gap-3">21 <input22 value={code}23 onChange={(e) => setCode(e.target.value)}24 inputMode="numeric"25 placeholder="Enter 1234"26 className="h-10 w-40 rounded-md border bg-background px-3 text-center text-sm tracking-[0.3em] outline-none focus-visible:ring-2 focus-visible:ring-ring"27 />28 <button29 type="submit"30 className="h-9 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90"31 >32 Verify33 </button>34 </Shake>35 </form>36 );37}
Files it writes
More from 8starlabs-ui
All 74 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Buttonbutton-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-countdown-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-showdays-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-size-demo | 8starlabs-ui | Examples | Free | no deps | |
| Flip clockflip-clock-variants-demo | 8starlabs-ui | Examples | Free | no deps | |
| Heatmapheatmap-custom-colors-demo | 8starlabs-ui | Examples | Free | no deps | |
| Heatmapheatmap-custom-display-demo | 8starlabs-ui | Examples | Free | no deps |
