From 0317387105992ab9ebdd59c3c8962cdaa970f1f1 Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:50 +0530 Subject: [PATCH] feat: add input with a leading icon --- app/components/ui/icon-input.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 app/components/ui/icon-input.tsx diff --git a/app/components/ui/icon-input.tsx b/app/components/ui/icon-input.tsx new file mode 100644 index 0000000..331ef2b --- /dev/null +++ b/app/components/ui/icon-input.tsx @@ -0,0 +1,22 @@ +import type { ReactNode } from 'react'; +import type { LucideIcon } from 'lucide-react'; +import { Input, type InputProps } from '~/components/ui/input'; +import { cn } from '~/lib/utils'; + +interface IconInputProps extends InputProps { + icon: LucideIcon; + trailing?: ReactNode; +} + +export function IconInput({ icon: Icon, trailing, className, ...props }: IconInputProps) { + return ( +
+ + + {trailing &&
{trailing}
} +
+ ); +}