TextAreaComponent

open class TextAreaComponent(valueStore: Store<String>? = null) : Component<TextArea> , EventProperties<HTMLTextAreaElement> , ElementProperties<TextArea> , InputFormProperties, SeverityProperties, TooltipProperties

This class handles the configuration of a textarea element.

Possible values to set are( default *) :

  • size : small | normal * | large

  • resizeBehavior : none | vertical *| horizontal

  • placeholder : String | Flow

  • disable : Boolean | Flow

  • value -> maybe you want to set an initial value instead of a placeholder

  • events -> access the DOM events of the underlying HTML element

  • element -> basic properties of the textarea html element; use with caution!

  • the base options of the HTML input element can be set. Attributes

Example usage

// Basic usage
textArea(value = dataStore) {
placeholder { "My placeholder" } // render a placeholder text for empty textarea
}

// Styling and options
textArea({ // use the styling parameter
background {
color { dark }
}
color { light }
radius { "1rem" }}, store = dataStore) {
disable(true) // textarea is disabled
resizeBehavior { none } // resizing is not possible
size { large } // render a large textarea
}

// disabled
textArea {
value { dataStore.data } // value depends on value in store
disable(true) // editing is disabled, but resizing still works
}

// all state management can also be done manually if needed:
val someStore = storeOf("some initial text")
textArea {
value(someStore.data)
events {
changes.values() handledBy someStore.update
}
}

Constructors

Link copied to clipboard
fun TextAreaComponent(valueStore: Store<String>? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun enabled(value: Boolean)
open override fun enabled(value: Flow<Boolean>)
Link copied to clipboard
open override fun render(    context: RenderContext,     styling: BoxParams.() -> Unit,     baseClass: StyleClass,     id: String?,     prefix: String): TextArea

Central method that should do the actual rendering of a component.

Link copied to clipboard
open override fun severity(value: SeverityProperties.SeverityContext.() -> Severity)

Property to manage the severity value of the component.

Link copied to clipboard
open override fun severityClassOf(severityStyle: SeverityStyles): Flow<StyleClass>

This function manages the task to map a value of the Severity enumeration to a corresponding style defined within the SeverityStyles interface. The severity itself is taken from the severity property, so only the styling interface's implementation has to be injected:

Link copied to clipboard
open override fun tooltip(vararg text: String, build: TooltipComponent.() -> Unit)
open override fun tooltip(    styling: BasicParams.() -> Unit,     text: String?,     baseClass: StyleClass,     id: String,     prefix: String,     build: TooltipComponent.() -> Unit)

Properties

Link copied to clipboard
open override val disabled: DynamicComponentProperty<Boolean>
Link copied to clipboard
open override val element: ComponentProperty<TextArea.() -> Unit>

This property enables the client to access the deeper features of an element even though the component itself does not offer an appropriate functionality. A client should use this with caution, as it might massively change the default behaviour of the component!

Link copied to clipboard
open override val events: ComponentProperty<EventContext<HTMLTextAreaElement>.() -> Unit>

This property enables the client to access all events offered by the underlying HTML element.

Link copied to clipboard
val placeholder: DynamicComponentProperty<String>
Link copied to clipboard
open override val readonly: DynamicComponentProperty<Boolean>
Link copied to clipboard
open override val renderTooltip: ComponentProperty<Tag<HTMLElement>.() -> Unit>
Link copied to clipboard
val resizeBehavior: ComponentProperty<TextAreaResize.() -> Style<BasicParams>>
Link copied to clipboard
open override val severity: NullableDynamicComponentProperty<Severity?>
Link copied to clipboard
val size: ComponentProperty<FormSizesStyles.() -> Style<BasicParams>>
Link copied to clipboard
val value: DynamicComponentProperty<String>
Link copied to clipboard
val variant: ComponentProperty<TextAreaVariants.() -> Style<BasicParams>>