# SbFormField A wrapper component that provides consistent label, help text, and error display for form inputs. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Label | string? | null | Label text for the field | | HelpText | string? | null | Help text displayed below the input | | Required | bool | false | Whether to show required indicator | | Id | string? | null | ID to associate label with input | | Error | string? | null | Error message to display | | Class | string? | null | Additional CSS classes | | Style | string? | null | Inline styles | ## Templates / Slots (RenderFragments) | Slot | Type | Description | |------|------|-------------| | ChildContent | RenderFragment | The form input to wrap | | LabelTemplate | RenderFragment | Custom label content (overrides Label) | | HelpTemplate | RenderFragment | Custom help content (overrides HelpText) | ### Template Usage Examples #### Custom LabelTemplate ```razor Email Required ``` #### Custom HelpTemplate ```razor ``` ## CSS Classes - `sb-form-field` - Base class - `sb-form-field__label` - Label element - `sb-form-field__required` - Required asterisk - `sb-form-field__input` - Input wrapper - `sb-form-field__help` - Help text - `sb-form-field__error` - Error message - `sb-form-field--error` - Error state ## Accessibility - Label associated with input via `for` attribute when Id is provided - Help text can be linked via aria-describedby - Error messages displayed with appropriate styling ## Examples ### Basic Usage ```razor ``` ### Required Field ```razor ``` ### With Error ```razor ``` ### With ID Association ```razor ``` ### Wrapping Other Components ```razor ```