{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "input-with-left-right-buttons", "type": "registry:component", "title": "Input with Left and Right Buttons", "description": "A component for inputting text with buttons on both sides", "dependencies": [ "lucide-react" ], "registryDependencies": [ "input", "button", "label" ], "files": [ { "path": "registry/default/components/input/input-with-left-right-buttons.tsx", "content": "'use client'\r\n\r\nimport { Button } from '@/registry/default/ui/button'\r\nimport { Input } from '@/registry/default/ui/input'\r\nimport { Label } from '@/registry/default/ui/label'\r\nimport { MinusIcon, PlusIcon } from 'lucide-react'\r\nimport React, { useId } from 'react'\r\n\r\nexport default function InputWithLeftRightButtons() {\r\n const id = useId()\r\n const [count, setCount] = React.useState(99)\r\n\r\n return (\r\n
\r\n \r\n\r\n
\r\n setCount((prev) => Math.max(prev - 1, 0))}\r\n >\r\n \r\n \r\n {\r\n const value = parseInt(e.target.value)\r\n if (!isNaN(value)) {\r\n setCount(value)\r\n }\r\n }}\r\n />\r\n setCount((prev) => prev + 1)}\r\n >\r\n \r\n \r\n
\r\n
\r\n )\r\n}\r\n", "type": "registry:component", "target": "components/input-with-left-right-buttons.tsx" } ] }