Input

com.raquo.laminar.shoelace.sl.Input

Inputs collect data from the user.

Input.scala source code

Shoelace Input docs

Attributes

Graph
Supertypes
class WebComponent
trait CommonTypes
class Object
trait Matchable
class Any
Show all
Self type
Input.type

Members list

Type members

Classlikes

trait InputComponent extends Object

Attributes

Supertypes
class Object
trait Any
class Object
trait Matchable
class Any
Self type
HTMLInputElement
object RawImport extends Object

Attributes

Supertypes
class Object
trait Any
class Object
trait Matchable
class Any
Self type
RawImport.type
object cssParts

For documentation only. You need to style these from a CSS stylesheet.

For documentation only. You need to style these from a CSS stylesheet.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
cssParts.type
object slots

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
slots.type

Types

type Ref = InputComponent & HTMLInputElement

Inherited types

type ComponentMod = Modifier[Element] | ModFunction

Attributes

Inherited from:
WebComponent
protected type DSP[V] = DerivedStyleProp[V]

Attributes

Inherited from:
CommonTypes
type Element = ReactiveHtmlElement[Ref]

Attributes

Inherited from:
WebComponent
type ModFunction = (WebComponent) => Modifier[Element]

Attributes

Inherited from:
WebComponent
protected type SS = StyleSetter

Attributes

Inherited from:
CommonTypes

Value members

Inherited methods

final def apply(mods: ComponentMod*): Element

Instantiate this component using the specified modifiers.

Instantiate this component using the specified modifiers.

Modifiers can be the usual Laminar modifiers (e.g. onDblClick --> observer), or they can be functions from this component to a modifier (e.g. _.onClick --> observer)

Scala 2 does not support union types, so use the of method instead.

IntelliJ is unable to provide autocompletion when using this method, so I suggest using of too. Upvote https://youtrack.jetbrains.com/issue/SCL-21713/Method-accepting-a-union-of-types-that-includes-a-Function-type-problems-with-go-to-definition-type-hints-and-autocomplete-Scala

Attributes

Inherited from:
WebComponent
protected def asIsProp[V](name: String): HtmlProp[V, _]

Attributes

Inherited from:
CommonTypes
protected def boolAttr(name: String): HtmlAttr[Boolean]

Attributes

Inherited from:
CommonTypes
protected def boolProp(name: String): HtmlProp[Boolean, _]

Attributes

Inherited from:
CommonTypes
protected def colorStyle(name: String): StyleProp[String] & Color & Color[SS, DSP]

Attributes

Inherited from:
CommonTypes
def controlled[Ev <: Event, V](updater: Input.type => KeyUpdater[Element, HtmlProp[V, _], V], listener: Input.type => EventListener[Ev, _]): Binder[Element]

Creates controlled input block.

Creates controlled input block.

Works similarly to standard Laminar controlled inputs, except you need to check what prop and event(s) a particular Web Component expects.

For general info, see Controlled Inputs docs

Attributes

Inherited from:
ControlledInput
protected def doubleProp(name: String): HtmlProp[Double, _]

Attributes

Inherited from:
CommonTypes
protected def doubleStyle(key: String): StyleProp[Double]

Attributes

Inherited from:
CommonTypes
protected def eventProp[Ev <: Event](name: String): EventProp[Ev]

Attributes

Inherited from:
CommonTypes
protected def intAttr(name: String): HtmlAttr[Int]

Attributes

Inherited from:
CommonTypes
protected def intProp(name: String): HtmlProp[Int, _]

Attributes

Inherited from:
CommonTypes
protected def intStyle(key: String): StyleProp[Int]

Attributes

Inherited from:
CommonTypes
protected def lengthStyle(name: String): StyleProp[String] & Length[DSP, Int]

Attributes

Inherited from:
CommonTypes
protected def lineStyle(key: String): StyleProp[String] & Line

Attributes

Inherited from:
CommonTypes
final def of(mods: ModFunction*): Element

Instantiate this component with the specified modifiers.

Instantiate this component with the specified modifiers.

To pass standard Laminar modifiers with this method, use _ => onDblClick --> observer.

Same as apply, but only accepts scoped functions for modifiers.

Attributes

Inherited from:
WebComponent
def on[Ev <: Event, V](ev: EventProcessor[Ev, V]): EventProcessor[Ev, V]

Optional syntax for using built-in Laminar events: _.on(onDblClick.preventDefault) --> ...

Optional syntax for using built-in Laminar events: _.on(onDblClick.preventDefault) --> ...

Attributes

Inherited from:
WebComponent
protected def stringAttr(name: String): HtmlAttr[String]

Attributes

Inherited from:
CommonTypes
protected def stringProp(name: String): HtmlProp[String, _]

Attributes

Inherited from:
CommonTypes
protected def tagWithControlledInput[Ref <: Element, A, Ev <: Event](prop: HtmlProp[A, _], initial: A, eventProp: EventProp[Ev]): CustomHtmlTag[Ref]

Attributes

Inherited from:
WebComponent
protected def timeStyle(key: String): StyleProp[String] & Time[DSP]

Attributes

Inherited from:
CommonTypes
protected def useImport(importObject: Any): Unit

Attributes

Inherited from:
WebComponent

Concrete fields

lazy val `type`: HtmlAttr[String]

The type of input. Works the same as a native <input> element, but only a subset of types are supported. Defaults to text.

The type of input. Works the same as a native <input> element, but only a subset of types are supported. Defaults to text.

Attributes

Controls whether and how text input is automatically capitalized as it is entered by the user.

Controls whether and how text input is automatically capitalized as it is entered by the user.

Attributes

lazy val autoComplete: HtmlAttr[String]

Specifies what permission the browser has to provide assistance in filling out form field values. Refer to this page on MDN for available values.

Specifies what permission the browser has to provide assistance in filling out form field values. Refer to this page on MDN for available values.

Attributes

lazy val autoCorrect: HtmlAttr[String]

Indicates whether the browser's autocorrect feature is on or off.

Indicates whether the browser's autocorrect feature is on or off.

Attributes

lazy val autoFocus: HtmlAttr[Boolean]

Indicates that the input should receive focus on page load.

Indicates that the input should receive focus on page load.

Attributes

lazy val clearable: HtmlAttr[Boolean]

Adds a clear button when the input is not empty.

Adds a clear button when the input is not empty.

Attributes

lazy val defaultValue: HtmlAttr[String]

The current value of the input, submitted as a name/value pair with form data.

The current value of the input, submitted as a name/value pair with form data.

Attributes

lazy val disabled: HtmlAttr[Boolean]

Disables the input.

Disables the input.

Attributes

lazy val enterkeyhint: HtmlAttr[String]

Used to customize the label or icon of the Enter key on virtual keyboards.

Used to customize the label or icon of the Enter key on virtual keyboards.

Attributes

lazy val filled: HtmlAttr[Boolean]

Draws a filled input.

Draws a filled input.

Attributes

lazy val formId: HtmlAttr[String]

By default, form controls are associated with the nearest containing <form> element. This attribute allows you to place the form control outside of a form and associate it with the form that has this id. The form must be in the same document or shadow root for this to work.

By default, form controls are associated with the nearest containing <form> element. This attribute allows you to place the form control outside of a form and associate it with the form that has this id. The form must be in the same document or shadow root for this to work.

Attributes

lazy val helpText: HtmlAttr[String]

The input's help text. If you need to display HTML, use the help-text slot instead.

The input's help text. If you need to display HTML, use the help-text slot instead.

Attributes

lazy val inputMode: inputMode.type

Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual keyboard on supportive devices.

Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual keyboard on supportive devices.

Attributes

lazy val label: HtmlAttr[String]

The input's label. If you need to display HTML, use the label slot instead.

The input's label. If you need to display HTML, use the label slot instead.

Attributes

lazy val max: HtmlAttr[Int]

The input's maximum value. Only applies to date and number input types.

The input's maximum value. Only applies to date and number input types.

Attributes

lazy val maxLength: HtmlAttr[Int]

The maximum length of input that will be considered valid.

The maximum length of input that will be considered valid.

Attributes

lazy val min: HtmlAttr[Int]

The input's minimum value. Only applies to date and number input types.

The input's minimum value. Only applies to date and number input types.

Attributes

lazy val minLength: HtmlAttr[Int]

The minimum length of input that will be considered valid.

The minimum length of input that will be considered valid.

Attributes

lazy val name: HtmlAttr[String]

The name of the input, submitted as a name/value pair with form data.

The name of the input, submitted as a name/value pair with form data.

Attributes

lazy val noSpinButtons: HtmlAttr[Boolean]

Hides the browser's built-in increment/decrement spin buttons for number inputs.

Hides the browser's built-in increment/decrement spin buttons for number inputs.

Attributes

lazy val onBlur: EventProp[Event]

Emitted when the control loses focus.

Emitted when the control loses focus.

Attributes

lazy val onChange: EventProp[Event]

Emitted when an alteration to the control's value is committed by the user.

Emitted when an alteration to the control's value is committed by the user.

Attributes

lazy val onClear: EventProp[Event]

Emitted when the clear button is activated.

Emitted when the clear button is activated.

Attributes

lazy val onFocus: EventProp[Event]

Emitted when the control gains focus.

Emitted when the control gains focus.

Attributes

lazy val onInput: EventProp[Event]

Emitted when the control receives input.

Emitted when the control receives input.

Attributes

lazy val onInvalid: EventProp[Event]

Emitted when the form control has been checked for validity and its constraints aren't satisfied.

Emitted when the form control has been checked for validity and its constraints aren't satisfied.

Attributes

lazy val passwordToggle: HtmlAttr[Boolean]

Adds a button to toggle the password's visibility. Only applies to password types.

Adds a button to toggle the password's visibility. Only applies to password types.

Attributes

lazy val passwordVisible: HtmlAttr[Boolean]

Determines whether or not the password is currently visible. Only applies to password input types.

Determines whether or not the password is currently visible. Only applies to password input types.

Attributes

lazy val pattern: HtmlAttr[String]

A regular expression pattern to validate input against.

A regular expression pattern to validate input against.

Attributes

lazy val pill: HtmlAttr[Boolean]

Draws a pill-style input with rounded edges.

Draws a pill-style input with rounded edges.

Attributes

lazy val placeholder: HtmlAttr[String]

Placeholder text to show as a hint when the input is empty.

Placeholder text to show as a hint when the input is empty.

Attributes

lazy val readOnly: HtmlAttr[Boolean]

Makes the input readonly.

Makes the input readonly.

Attributes

lazy val required: HtmlAttr[Boolean]

Makes the input a required field.

Makes the input a required field.

Attributes

lazy val size: size.type

The input's size.

The input's size.

Attributes

lazy val spellCheck: HtmlAttr[Boolean]

Enables spell checking on the input.

Enables spell checking on the input.

Attributes

lazy val step: HtmlAttr[Int]

Specifies the granularity that the value must adhere to, or the special value any which means no stepping is implied, allowing any numeric value. Only applies to date and number input types.

Specifies the granularity that the value must adhere to, or the special value any which means no stepping is implied, allowing any numeric value. Only applies to date and number input types.

Attributes

lazy val title: HtmlAttr[String]
lazy val tpe: HtmlAttr[String]
lazy val typ: HtmlAttr[String]
lazy val value: HtmlProp[String, _]

The current value of the input, submitted as a name/value pair with form data.

The current value of the input, submitted as a name/value pair with form data.

Attributes