Field
Form field with label and hints.
import { Input } from "@/components/ui/input";import { Field, FieldHint, FieldLabel,} from "@/registry/new-york/items/manpowerhub-field/components/field";export function ManpowerhubFieldBasic() { return ( <div className="w-full max-w-sm p-4"> <Field> <FieldLabel>First Name</FieldLabel> <Input placeholder="Ahmed" /> <FieldHint>As shown on passport</FieldHint> </Field> </div> );}Installation
Section titled “Installation”This installation provides support for all official Shadcn icon libraries. The component is otherwise identical to the non-experimental installation.
Icon support is experimental and may not be fully stable since it uses internal Shadcn APIs.
This component relies on other items which must be installed first.
Copy and paste the following code into your project.
components/ui/field.tsx
import * as React from "react";
import { cn } from "@/lib/utils";import { Label } from "@/components/ui/label";
function Field({ className, ...props }: React.ComponentProps<"div">) { return ( <div data-slot="field" className={cn("flex flex-col gap-1.5", className)} {...props} /> );}
function FieldLabel({ className, ...props}: React.ComponentProps<typeof Label>) { return ( <Label data-slot="field-label" className={cn("text-xs font-medium text-[var(--text-2)]", className)} {...props} /> );}
function FieldHint({ className, ...props }: React.ComponentProps<"p">) { return ( <p data-slot="field-hint" className={cn("text-[11.5px] text-[var(--text-3)]", className)} {...props} /> );}
function FieldError({ className, ...props }: React.ComponentProps<"p">) { return ( <p data-slot="field-error" className={cn("text-[11.5px] text-[var(--red)]", className)} {...props} /> );}
export { Field, FieldLabel, FieldHint, FieldError };Update the import paths to match your project setup.
Install the ManpowerHub theme first, then add this field:
npx shadcn@latest add @woxcn/manpowerhub-field