From 4b8aa493be1102ce9a107230e7179a5789e21576 Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Thu, 1 Nov 2018 15:05:46 -0700 Subject: [PATCH] [FormGroup] add contentClassName and style props (#3120) * add contentClassName prop * add style prop --- packages/core/src/components/forms/formGroup.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/core/src/components/forms/formGroup.tsx b/packages/core/src/components/forms/formGroup.tsx index ab0c752a28..9e02ea4398 100644 --- a/packages/core/src/components/forms/formGroup.tsx +++ b/packages/core/src/components/forms/formGroup.tsx @@ -10,6 +10,12 @@ import * as Classes from "../../common/classes"; import { DISPLAYNAME_PREFIX, IIntentProps, IProps } from "../../common/props"; export interface IFormGroupProps extends IIntentProps, IProps { + /** + * A space-delimited list of class names to pass along to the + * `Classes.FORM_CONTENT` element that contains `children`. + */ + contentClassName?: string; + /** * Whether form group should appear as non-interactive. * Remember that `input` elements must be disabled separately. @@ -39,21 +45,24 @@ export interface IFormGroupProps extends IIntentProps, IProps { * Optional secondary text that appears after the label. */ labelInfo?: React.ReactNode; + + /** CSS properties to apply to the root element. */ + style?: React.CSSProperties; } export class FormGroup extends React.PureComponent { public static displayName = `${DISPLAYNAME_PREFIX}.FormGroup`; public render() { - const { children, helperText, label, labelFor, labelInfo } = this.props; + const { children, contentClassName, helperText, label, labelFor, labelInfo, style } = this.props; return ( -
+
{label && ( )} -
+
{children} {helperText &&
{helperText}
}