Carbon

Text Inputs

Text Inputs are blank text fields used solely within Modals to collect user input.

Text Inputs are blank text fields used solely within Modals to collect user input. They are created by extending the TextInput class, and adding a label and placeholder property.

src/components/text-input.ts
class TextInputHi extends TextInput {
	label = "Tell me about your life"
	customId = "life"
	style = TextInputStyle.Paragraph
}
 
class TextInputAge extends TextInput {
	label = "How old are you?"
	customId = "age"
	style = TextInputStyle.Short
}

Here we have 2 examples of text inputs, one in a large paragraph form, and one in a short form.

Last updated on

On this page

No Headings
Edit on GitHub