BootstrapConfig
Configuration options for Bootstrap form fields.
These settings can be applied at two levels:
- Library-level: Via
- applies to all formswithBootstrapFields ({ ... }) - Form-level: Via
defaultPropsin form config - applies to a specific form
The cascade hierarchy is: Library-level → Form-level → Field-level
Properties
| Name | Type | Description |
|---|---|---|
| block | boolean | undefined | Whether buttons should be block-level by default @default false |
| floatingLabel | boolean | undefined | Whether to use floating labels by default for inputs @default false |
| outline | boolean | undefined | Whether buttons should be outlined by default @default false |
| size | "sm" | "lg" | undefined | Default size for form controls @default undefined |
| variant | "primary" | "secondary" | "success" | "warning" | "danger" | "light" | "dark" | "info" | "link" | undefined | Default variant for buttons @default 'primary' |
Example usage
// Library-level (in app config)
provideDynamicForms(withBootstrapFields ({ size: 'sm', floatingLabel: true }))
// Form-level (in form config)
const config: BsFormConfig = {
defaultProps: { size: 'lg' },
fields: [...]
};