Skip to main content

Textarea

<sc-textarea></sc-textarea>

This component let users create textarea.

Component Codex

Properties

PropertyDescriptionTypeDefault
autocapitalizeThe textarea's autocapitalize attribute."characters" | "none" | "off" | "on" | "sentences" | "words"
autocompleteThe textarea's autocomplete attribute.string
autocorrectThe textarea's autocorrect attribute.string
autofocusThe textarea's autofocus attribute.boolean
disabledDisables the textarea.booleanfalse
enterkeyhintThe input's enterkeyhint attribute. This can be used to customize the label or icon of the Enter key on virtual keyboards."done" | "enter" | "go" | "next" | "previous" | "search" | "send"
filledDraws a filled textarea.booleanfalse
helpThe textarea's help text. Alternatively, you can use the help-text slot.string''
inputmodeThe textarea's inputmode attribute."decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url"
invalidThis will be true when the control is in an invalid state. Validity is determined by props such as `type`, `required`, `minlength`, and `maxlength` using the browser's constraint validation API.booleanfalse
labelThe textarea's label. Alternatively, you can use the label slot.string''
maxlengthThe maximum length of input that will be considered valid.number
minlengthThe minimum length of input that will be considered valid.number
nameThe textarea's name attribute.string
placeholderThe textarea's placeholder text.string
readonlyMakes the textarea readonly.booleanfalse
requiredMakes the textarea a required field.booleanfalse
resizeControls how the textarea can be resized."auto" | "none" | "vertical"'vertical'
rowsThe number of rows to display by default.number4
showLabelShould we show the labelbooleantrue
sizeThe textarea's size."large" | "medium" | "small"'medium'
spellcheckEnables spell checking on the textarea.boolean
valueThe textarea's value attribute.string''

Events

EventDescriptionType
scBlurCustomEvent<void>
scChangeCustomEvent<void>
scFocusCustomEvent<void>
scInputCustomEvent<void>

Methods

reportValidity() => Promise<boolean>

Checks for validity and shows the browser's validation message if the control is invalid.

triggerFocus(options?: FocusOptions) => Promise<void>

Sets focus on the input.

Shadow Parts

PartDescription
baseThe elements base wrapper.
form-controlThe form control wrapper.
form-control-input
help-textHelp text that describes how to use the input.
inputThe html input element.
labelThe input label.
textarea