diff options
Diffstat (limited to 'packages/forms/src/label/index.tsx')
-rw-r--r-- | packages/forms/src/label/index.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/forms/src/label/index.tsx b/packages/forms/src/label/index.tsx index 590270a06..1b33ba22c 100644 --- a/packages/forms/src/label/index.tsx +++ b/packages/forms/src/label/index.tsx | |||
@@ -9,6 +9,7 @@ import styles from './styles'; | |||
9 | 9 | ||
10 | interface ILabel extends IFormField, React.LabelHTMLAttributes<HTMLLabelElement> { | 10 | interface ILabel extends IFormField, React.LabelHTMLAttributes<HTMLLabelElement> { |
11 | classes: Classes; | 11 | classes: Classes; |
12 | isRequired: boolean; | ||
12 | } | 13 | } |
13 | 14 | ||
14 | class LabelComponent extends Component<ILabel> { | 15 | class LabelComponent extends Component<ILabel> { |
@@ -24,6 +25,7 @@ class LabelComponent extends Component<ILabel> { | |||
24 | className, | 25 | className, |
25 | children, | 26 | children, |
26 | htmlFor, | 27 | htmlFor, |
28 | isRequired, | ||
27 | } = this.props; | 29 | } = this.props; |
28 | 30 | ||
29 | if (!showLabel) return children; | 31 | if (!showLabel) return children; |
@@ -36,7 +38,7 @@ class LabelComponent extends Component<ILabel> { | |||
36 | htmlFor={htmlFor} | 38 | htmlFor={htmlFor} |
37 | > | 39 | > |
38 | {showLabel && ( | 40 | {showLabel && ( |
39 | <span className={classes.label}>{title}</span> | 41 | <span className={classes.label}>{title}{isRequired && ' *'}</span> |
40 | )} | 42 | )} |
41 | <div className={classes.content}> | 43 | <div className={classes.content}> |
42 | {children} | 44 | {children} |