Input Group
boldkit/input-groupFreeComponent
An input joined with leading/trailing addons in a single bordered field
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/input-group.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'34/**5 * A bordered container that joins an input with leading/trailing addons6 * (icons, text, or buttons) into a single neubrutalism field.7 */8const InputGroup = React.forwardRef<9 HTMLDivElement,10 React.HTMLAttributes<HTMLDivElement>11>(({ className, ...props }, ref) => (12 <div13 ref={ref}14 className={cn(15 'flex items-stretch border-3 border-foreground bg-background shadow-[4px_4px_0px_hsl(var(--shadow-color))] transition focus-within:translate-x-[2px] focus-within:translate-y-[2px] focus-within:shadow-none',16 className17 )}18 {...props}19 />20))21InputGroup.displayName = 'InputGroup'2223const InputGroupInput = React.forwardRef<24 HTMLInputElement,25 React.InputHTMLAttributes<HTMLInputElement>26>(({ className, ...props }, ref) => (27 <input28 ref={ref}29 className={cn(30 'w-full flex-1 bg-transparent px-3 py-2 text-sm font-medium outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',31 className32 )}33 {...props}34 />35))36InputGroupInput.displayName = 'InputGroupInput'3738export interface InputGroupAddonProps39 extends React.HTMLAttributes<HTMLDivElement> {40 position?: 'leading' | 'trailing'41}4243const InputGroupAddon = React.forwardRef<HTMLDivElement, InputGroupAddonProps>(44 ({ className, position = 'leading', ...props }, ref) => (45 <div46 ref={ref}47 className={cn(48 'flex items-center bg-muted px-3 text-sm font-bold uppercase tracking-wide text-muted-foreground [&_svg]:size-4 [&_svg]:shrink-0',49 position === 'leading' ? 'border-r-3 border-foreground' : 'border-l-3 border-foreground',50 className51 )}52 {...props}53 />54 )55)56InputGroupAddon.displayName = 'InputGroupAddon'5758export { InputGroup, InputGroupInput, InputGroupAddon }
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps |
