diff --git a/src/components.d.ts b/src/components.d.ts index e468f1579..a0e1636b2 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -766,6 +766,10 @@ export namespace Components { * The select's placeholder text. */ "placeholder": string; + /** + * The select's required attribute. + */ + "required": boolean; /** * The select's size. */ @@ -2132,6 +2136,10 @@ declare namespace LocalJSX { * The select's placeholder text. */ "placeholder"?: string; + /** + * The select's required attribute. + */ + "required"?: boolean; /** * The select's size. */ diff --git a/src/components/select/select.tsx b/src/components/select/select.tsx index fd31689e1..e77591d55 100644 --- a/src/components/select/select.tsx +++ b/src/components/select/select.tsx @@ -74,6 +74,9 @@ export class Select { /** The select's label. */ @Prop() label = ''; + /** The select's required attribute. */ + @Prop() required: boolean; + /** Set to true to indicate that the user input is valid. */ @Prop() valid = false; @@ -350,6 +353,7 @@ export class Select { size={this.size} valid={this.valid} invalid={this.invalid} + required={this.required} aria-labelledby={this.labelId} aria-describedby={this.helpTextId} onSlFocus={this.handleFocus}