Skip to content

Commit beb514e

Browse files
committed
Enable custom classname for text input component
1 parent 953b2bb commit beb514e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/components/form/TextInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ interface TextInputProps<TFieldValues extends FieldValues> {
1212
label: string;
1313
name: FieldPath<TFieldValues>;
1414
placeholder: string;
15+
className?: string;
1516
}
1617

1718
export function TextInput<TFieldValues extends FieldValues>({
1819
label,
1920
name,
2021
placeholder,
22+
className,
2123
}: TextInputProps<TFieldValues>) {
2224
const form = useFormContext();
2325

@@ -29,7 +31,7 @@ export function TextInput<TFieldValues extends FieldValues>({
2931
<FormItem className="flex-1">
3032
<FormLabel>{label}</FormLabel>
3133
<FormControl>
32-
<Input placeholder={placeholder} {...field} />
34+
<Input className={className} placeholder={placeholder} {...field} />
3335
</FormControl>
3436
<FormMessage />
3537
</FormItem>

0 commit comments

Comments
 (0)