InputFieldComponent

This class deals with the configuration and rendering of an input element.

The inputField can be configured for the following aspects:

  • the size of the element

  • some predefined styling variants

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

You can optionally pass in a store in order to set the value and react to updates automatically.

Example usages:

inputField(value = dataStore /* inject a store so all user inputs are automatically reflected! */) {
placeholder("Placeholder") // render a placeholder text for empty field
}

// all state management can also be done manually if needed:
val someStore = storeOf("")
inputField {
placeholder("Enter text")
value(someStore.data) // connect a flow to the component for setting its value
events {
changes.values() handledBy someStore.update // connect an handler for emitting the user input made
}
element {
// exposes the underlying HTML input element for direct access. Use with caution!
}
}

// apply predefined size and variant
inputField(value = dataStore) {
size { small } // render a smaller input
variant { filled } // fill the background with ``light`` color
placeholder("Placeholder") // render a placeholder text for empty field
}

// Of course you can apply custom styling as well
inputField({ // just use the ``styling`` parameter!
background {
color { dark }
}
radius { "1rem" }
},
value = dataStore) {
size { small } // render a smaller input
placeholder("Placeholder") // render a placeholder text for empty field
}

Constructors

Link copied to clipboard
fun InputFieldComponent(valueStore: Store<String>?)

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): Input

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<Input.() -> 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<HTMLInputElement>.() -> Unit>

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

Link copied to clipboard
open override 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
open override val severity: NullableDynamicComponentProperty<Severity?>
Link copied to clipboard
open override val size: ComponentProperty<FormSizesStyles.() -> Style<BasicParams>>
Link copied to clipboard
val step: DynamicComponentProperty<String>
Link copied to clipboard
val type: DynamicComponentProperty<String>
Link copied to clipboard
val value: DynamicComponentProperty<String>
Link copied to clipboard
open override val variant: ComponentProperty<InputFieldVariants.() -> Style<BasicParams>>