Skip to content

Migrating from ghl-ui Form to HighRise Form

HighRise uses HLForm and HLFormItem with HighRise sizing defaults. Use this guide to align props and usage.

Component Implementation Changes

Import Changes

diff
- import { UIForm, UIFormItem } from '@gohighlevel/ghl-ui'
+ import { HLForm, HLFormItem } from '@platform-ui/highrise'

Basic Usage Changes

diff
- <UIForm :model="formModel" :rules="rules" ref="formRef">
-   <UIFormItem label="Name" path="name" required>
-     <UIInput v-model="formModel.name" />
-   </UIFormItem>
-   <UIFormItem>
-     <UIButton @click="submit">Submit</UIButton>
-   </UIFormItem>
- </UIForm>
+ <HLForm :model="formModel" :rules="rules" ref="formRef" size="md">
+   <HLFormItem label="Name" path="name" required :show-feedback="true">
+     <HLInput v-model:value="formModel.name" />
+   </HLFormItem>
+   <HLFormItem>
+     <HLButton @click="submit">Submit</HLButton>
+   </HLFormItem>
+ </HLForm>

Props Changes

HLForm

ghl-ui PropHighRise PropNotes
modelmodelSame usage.
rulesrulesSame usage.
show-labelshowLabeloptional
show-require-markshowRequireMarkOptional.
inlineinlineSame semantics.
label-placementlabelPlacement'top' or 'left'.
label-widthlabelWidthNumber/string.
label-alignlabelAlign'left' or 'right'.
sizesizesm | md (default) | lg; controls item gap and child size mapping.
require-mark-placementrequireMarkPlacement'left' or 'right'.
validate-messagesvalidateMessagesCustom validation messages.
disableddisabledDisables the form.
show-feedbackshowFeedbackToggle feedback visibility.

HLFormItem

ghl-ui Prop / SlotHighRise PropNotes
labellabel or #label slotSlot still supported; label prop simplest.
pathpathSame usage for validation.
ruleruleSingle-item rule override.
show-labelshowLabelBoolean; defaults to parent behavior.
show-feedbackshowFeedbackBoolean; inherits when undefined.
requiredrequiredMarks the field required.
feedbackfeedback / #feedback slotCustom feedback text or slot content.
validation-statusvalidationStatus'error' | 'warning' | 'success'.
tooltip slottooltip propPass FormItemTooltipProps for inline tooltip icon/content.
label-propslabelPropsForward extra props to label element.

Examples

Form with Validation

vue
<template>
  <HLForm :model="form" :rules="rules" ref="formRef" size="md">
    <HLFormItem label="Email" path="email" required>
      <HLInput v-model:value="form.email" />
    </HLFormItem>
    <HLFormItem label="Country" path="country" required>
      <HLSelect id="country" v-model:value="form.country" :options="countryOptions" />
    </HLFormItem>
    <HLFormItem>
      <HLButton type="primary" @click="handleSubmit">Submit</HLButton>
    </HLFormItem>
  </HLForm>
</template>

<script setup>
import { ref } from 'vue'

const form = ref({ email: '', country: '' })
const countryOptions = [
  { label: 'United States', value: 'US' },
  { label: 'Canada', value: 'CA' },
]
const rules = {
  email: [{ required: true, message: 'Email is required', trigger: 'blur' }],
  country: [{ required: true, message: 'Country is required', trigger: 'change' }],
}
const handleSubmit = async () => {
  const valid = await formRef.value?.validate?.()
  if (valid) {
    // submit
  }
}
</script>

Best Practices

  1. Choose size to match the enclosing UI (defaults to md).
  2. Provide path on every HLFormItem when using rules.
  3. Use tooltip prop instead of label slots for inline help icons.
  4. Surface validation feedback through showFeedback and feedback/validationStatus when you have custom validation flows.