Skip to content

Migrating from ghl-ui InputNumber to HighRise InputNumber

HLInputNumber with HighRise styling, size mapping, and optional parsing/formatting. IDs are optional (auto-generated).

Component Implementation Changes

Import Changes

diff
- import { UIInputNumber } from '@gohighlevel/ghl-ui'
+ import { HLInputNumber } from '@platform-ui/highrise'

Basic Usage Changes

diff
- <UIInputNumber v-model="value" placeholder="Enter a number" />
+ <HLInputNumber v-model:value="value" placeholder="Enter a number" :show-button="true" />

Props Changes

ghl-ui PropHighRise PropNotes
v-modelv-model:valueEmits update:value (number | null).
idid (optional)Auto-generated if omitted.
sizesizeUses HighRise input sizes (3xslg); inherits form/input-group.
min / maxmin / maxSame behavior.
stepstepDefault 1.
precisionprecisionRounds emitted values to the given decimal places.
show-buttonshowButtonShow increment/decrement buttons (default true).
buttonPlacementbuttonPlacement'right' (default) or 'both'.
textAligntextAlignstart (default), center, end.
parse / formatparse / formatCustom string parsing and display formatting.
clearableclearableClears value; emits clear.
loadingloadingShows loader state.
readonlyreadonlyPrevents input edits.

Events

  • update:value — emitted with the new number or null.
  • focus, blur, clear, input — standard input events.

Examples

Basic

vue
<HLInputNumber v-model:value="value" placeholder="Enter a number" />

Min/Max and Step

vue
<HLInputNumber v-model:value="qty" :min="1" :max="10" :step="0.5" />

Custom Format/Parse

vue
<HLInputNumber
  v-model:value="price"
  :format="val => (val == null ? '' : `$${val.toFixed(2)}`)"
  :parse="
    input => {
      const n = Number(String(input).replace(/[^0-9.-]/g, ''))
      return isNaN(n) ? null : n
    }
  "
/>

Best Practices

  1. Let size inherit from HLForm/input groups unless a specific override is needed.
  2. Use precision to avoid floating rounding issues in emitted values.
  3. Pair parse/format when showing currency or percentages to keep the underlying value numeric.
  4. Keep showButton enabled for better accessibility on number adjustments.