@papernote/ui
Version:
A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive
35 lines • 1.09 kB
TypeScript
import React from 'react';
export interface FormControlProps {
/** Field label */
label?: string;
/** Required field indicator */
required?: boolean;
/** Error message */
error?: string;
/** Helper text (shown when no error) */
helperText?: string;
/** Form input element(s) */
children: React.ReactNode;
/** Custom className for container */
className?: string;
/** HTML id for the input (used for label association) */
htmlFor?: string;
}
/**
* FormControl wrapper component for consistent form field layout.
*
* Provides:
* - Label with required indicator
* - Error message display
* - Helper text
* - Consistent spacing
*
* @example
* ```tsx
* <FormControl label="Email" required error={errors.email} helperText="We'll never share your email">
* <Input {...register('email')} />
* </FormControl>
* ```
*/
export default function FormControl({ label, required, error, helperText, children, className, htmlFor, }: FormControlProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=FormControl.d.ts.map