Pear

PRange

PRange is a native range input with numeric v-model values and an optional value readout.

Range
Basic range with default min/max.
vue
<p-field label="Brightness" helper="Basic range with default min/max.">
  <p-range v-model="brightness" name="brightness" />
</p-field>
40
Shows the current value.
vue
<p-field label="Contrast" helper="Shows the current value.">
  <p-range
    v-model="contrast"
    name="contrast"
    :min="0"
    :max="100"
    :step="5"
    show-value
  />
</p-field>
7
Custom min/max range.
vue
<p-field label="Volume" helper="Custom min/max range.">
  <p-range v-model="volume" name="volume" :min="0" :max="10" :step="1" show-value />
</p-field>
25
vue
<p-field label="Disabled range" disabled>
  <p-range v-model="disabledRange" name="disabled-range" show-value />
</p-field>
States & Tooltips
Drag to set the alert volume95
That is probably too loud.
vue
<p-field label="Alert volume" error="That is probably too loud.">
  <p-range
    v-model="alertVolume"
    name="alert-volume"
    show-value
    tooltip="Drag to set the alert volume"
    tooltip-placement="bottom"
  />
</p-field>
API

Props

NameTypeDefaultDescription
v-modelnumber-Current range value.
minnumber0Native minimum value.
maxnumber100Native maximum value.
stepnumber1Native step value.
showValuebooleanfalseShows an output element with the current value.
disabledbooleanfalseDisables the range. Inherits from PField when present.
invalidbooleanfalseSets aria-invalid. Inherits from PField when present.
tooltipstring-Optional Pico tooltip content.
tooltipPlacementPTooltipPlacement-Optional Pico tooltip placement.

Events

NameTypeDefaultDescription
update:modelValuenumber-Emitted by v-model while the range input changes.