
com.raquo.laminar.shoelace.sl.Range.scala Maven / Gradle / Ivy
package com.raquo.laminar.shoelace.sl
import com.raquo.laminar.keys.{EventProp, HtmlProp, HtmlAttr, StyleProp}
import com.raquo.laminar.api.L
import com.raquo.laminar.defs.styles.{traits as s, units as u}
import com.raquo.laminar.nodes.Slot
import org.scalajs.dom
import scala.scalajs.js
import scala.scalajs.js.|
import scala.scalajs.js.annotation.JSImport
// This file is generated at compile-time by ShoelaceGenerator.scala
/**
* Ranges allow the user to select a single value within a given range using a slider.
*
* [[https://github.com/raquo/laminar-shoelace-components/blob/master/src/main/scala/com/raquo/laminar/shoelace/sl/Range.scala Range.scala source code]]
*
* [[https://shoelace.style/components/range Shoelace Range docs]]
*/
object Range extends WebComponent("sl-range") {
@JSImport("@shoelace-style/shoelace/dist/components/range/range.js", JSImport.Namespace)
@js.native object RawImport extends js.Object
type Self = Range.type
type Ref = RangeComponent with dom.HTMLElement
// -- Events --
/** Emitted when the control loses focus. */
lazy val onBlur: EventProp[dom.Event] = eventProp("sl-blur")
/** Emitted when an alteration to the control's value is committed by the user. */
lazy val onChange: EventProp[dom.Event] = eventProp("sl-change")
/** Emitted when the control gains focus. */
lazy val onFocus: EventProp[dom.Event] = eventProp("sl-focus")
/** Emitted when the control receives input. */
lazy val onInput: EventProp[dom.Event] = eventProp("sl-input")
/** Emitted when the form control has been checked for validity and its constraints aren't satisfied. */
lazy val onInvalid: EventProp[dom.Event] = eventProp("sl-invalid")
// -- Attributes --
lazy val title: HtmlAttr[String] = stringAttr("title")
/** The name of the range, submitted as a name/value pair with form data. */
lazy val name: HtmlAttr[String] = stringAttr("name")
/** The current value of the range, submitted as a name/value pair with form data. */
lazy val defaultValue: HtmlAttr[Int] = intAttr("value")
/** The range's label. If you need to display HTML, use the `label` slot instead. */
lazy val label: HtmlAttr[String] = stringAttr("label")
/** The range's help text. If you need to display HTML, use the help-text slot instead. */
lazy val helpText: HtmlAttr[String] = stringAttr("help-text")
/** Disables the range. */
lazy val disabled: HtmlAttr[Boolean] = boolAttr("disabled")
/** The minimum acceptable value of the range. */
lazy val min: HtmlAttr[Int] = intAttr("min")
/** The maximum acceptable value of the range. */
lazy val max: HtmlAttr[Int] = intAttr("max")
/** The interval at which the range will increase and decrease. */
lazy val step: HtmlAttr[Int] = intAttr("step")
/** The preferred placement of the range's tooltip. */
lazy val tooltip: HtmlAttr[String] = stringAttr("tooltip")
/**
* By default, form controls are associated with the nearest containing `
© 2015 - 2025 Weber Informatics LLC | Privacy Policy