Input Field Component
open class InputFieldComponent(valueStore: Store<String>?) : Component<Input> , EventProperties<HTMLInputElement> , ElementProperties<Input> , InputFormProperties, SeverityProperties, InputFieldProperties, TooltipProperties
Content copied to clipboard
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
InputFieldComponent
Link copied to clipboard
Types
Functions
severity
Link copied to clipboard
open override fun severity(value: SeverityProperties.SeverityContext.() -> Severity)
Content copied to clipboard
severityClassOf
Link copied to clipboard
open override fun severityClassOf(severityStyle: SeverityStyles): Flow<StyleClass>
Content copied to clipboard
tooltip
Link copied to clipboard
Properties
disabled
Link copied to clipboard
element
Link copied to clipboard
events
Link copied to clipboard
open override val events: ComponentProperty<EventContext<HTMLInputElement>.() -> Unit>
Content copied to clipboard
placeholder
Link copied to clipboard
readonly
Link copied to clipboard
renderTooltip
Link copied to clipboard
open override val renderTooltip: ComponentProperty<Tag<HTMLElement>.() -> Unit>
Content copied to clipboard
severity
Link copied to clipboard
size
Link copied to clipboard
open override val size: ComponentProperty<FormSizesStyles.() -> Style<BasicParams>>
Content copied to clipboard
step
Link copied to clipboard
type
Link copied to clipboard
value
Link copied to clipboard
variant
Link copied to clipboard
open override val variant: ComponentProperty<InputFieldVariants.() -> Style<BasicParams>>
Content copied to clipboard