Skip to content

range

Slider (<input type="range">) with the current value shown next to it.

Lte3::range(string $name, mixed $value = null, array $attrs = [])

Blade: lte3::components.range. The value is resolved as described in Value resolution.

{!! Lte3::range('age', 18, ['min' => 12, 'max' => 100, 'step' => 1]) !!}
AttrTypeDefaultDescription
minnumber0 (browser)Minimal value.
maxnumber100 (browser)Maximal value.
stepnumber1 (browser)Step.
labelstringStr::studly($name)Label HTML. '' hides it.
helpstring-Help HTML under the field.
classstring-Extra classes of the input (it always has custom-range).
class_wrapstring-Extra classes of the wrapper .form-group.
hidden_wrapboolfalseHides the whole field.
disabledboolfalseAdds disabled; the field is not submitted.
defaultmixed-Fallback value.
formattercallable or class-Transforms the value before rendering.

Other keys from lte3.view.field_attrs (id, title, required, …) are printed on the input.

The current value is printed into an <output> element to the right of the slider and updated on every input event by an inline handler; no init function is needed, so the field works in content loaded by AJAX too.

name — the selected number as a string (nothing when disabled).