Skip to content

Migrating from ghl-ui Tag to HighRise Tag

HighRise HLTag replaces UITag with semantic colors, checkbox/selectable support, optional dropdown affordance, count badges, truncation, and an avatar slot. IDs are optional; provide them only when you need to reference the element.

Component Implementation Changes

Import Changes

diff
- import { UITag } from '@gohighlevel/ghl-ui'
+ import { HLTag } from '@platform-ui/highrise'

Basic Usage Changes

Basic Tag

diff
- <UITag>Basic Tag</UITag>
+ <HLTag color="gray" size="sm">Basic Tag</HLTag>

Type/Color Variants

diff
- <UITag type="success">Success</UITag>
- <UITag type="warning">Warning</UITag>
- <UITag type="error">Error</UITag>
- <UITag type="info">Info</UITag>
+ <HLTag color="green">Success</HLTag>
+ <HLTag color="orange">Warning</HLTag>
+ <HLTag color="red">Error</HLTag>
+ <HLTag color="blue">Info</HLTag>

With Icon

diff
- <UITag type="success">
-   <template #icon>
-     <CheckIcon class="w-4 h-4" />
-   </template>
-   Success
- </UITag>
+ <HLTag color="green" size="sm">
+   <template #icon>
+     <CheckIcon />
+   </template>
+   Success
+ </HLTag>

Props Changes

ghl-ui PropHighRise PropNotes
typecolorMap UI types: default→gray, primary→blue, success→green, warning→orange, error→red, info→blue
size (small | medium | large)size (xs | sm | md | lg)Defaults to sm; choose the closest match
closableclosableSame behavior
roundroundSame behavior
borderedborderedSame behavior (default true)
groupPositionRemoved; use separate tags or layout wrappers
id (required)id (optional)Provide when referenced elsewhere
checkbox, checkedEnable selectable tags; combine with v-model:checked
interactiveToggle hover/click affordance; defaults to true unless disabled
dropdown'open' | 'close' | false to show a caret indicator
countNumeric badge on the tag
avatarPropsPass avatar props to the avatar slot
truncate, maxWidthTruncate label and show tooltip via HLEllipsis
disabledDisable interactions

Events

ghl-ui EventHighRise EventNotes
closeclosePayload { event?: Event; id?: string }
clickUse v-model:checked/@checked for interactions
checkedEmits boolean when tag toggles selection

Slots

ghl-ui SlotHighRise SlotNotes
defaultdefaultMain content
iconiconSame usage
groupRemoved; compose with multiple tags
avatarNew slot for avatar content

Examples

Basic Tag with Colors

vue
<template>
  <div class="flex gap-2">
    <HLTag color="gray" size="sm">Default</HLTag>
    <HLTag color="blue" size="sm">Primary</HLTag>
    <HLTag color="green" size="sm">Success</HLTag>
    <HLTag color="red" size="sm">Error</HLTag>
    <HLTag color="orange" size="sm">Warning</HLTag>
  </div>
</template>

Selectable Tag (Checkbox Mode)

vue
<template>
  <HLTag color="blue" size="md" checkbox v-model:checked="isChecked" @checked="handleChecked"> Selectable Tag </HLTag>
</template>

<script setup>
import { ref } from 'vue'
import { HLTag } from '@platform-ui/highrise'

const isChecked = ref(false)
const handleChecked = checked => {
  console.log('Tag checked:', checked)
}
</script>

Closable Tag with Icon

vue
<template>
  <HLTag color="green" size="md" closable @close="handleClose">
    <template #icon>
      <CheckIcon />
    </template>
    Closable Tag
  </HLTag>
</template>

<script setup>
import { HLTag } from '@platform-ui/highrise'
import { CheckIcon } from '@gohighlevel/ghl-icons/24/outline'

const handleClose = () => {
  console.log('Tag closed')
}
</script>

Truncated Tag with Count

vue
<template>
  <HLTag color="indigo" size="sm" :count="12" truncate :max-width="120"> Very long tag label that should truncate nicely </HLTag>
</template>

Best Practices

  1. Map UI type values to semantic color tokens for consistency.
  2. Use v-model:checked when the tag represents a selection state; set interactive="false" for static tags.
  3. Prefer truncate + maxWidth for long labels instead of manual CSS.
  4. Provide id only when referenced externally (e.g., analytics, aria-labelledby).
  5. Pair avatar or count with concise labels to keep tag height compact.

Migrating from ghl-ui Tag to HighRise Tag

This guide will help you migrate from the ghl-ui Tag component to the new HighRise Tag component. The Tag component has been completely redesigned with enhanced accessibility, consistent sizing, improved customization options, and better integration with the HighRise design system.

Component Implementation Changes

Import Changes

diff
- import { UITag } from '@gohighlevel/ghl-ui'
+ import { HLTag } from '@platform-ui/highrise'

Basic Usage Changes

Basic Tag

diff
- <UITag>Basic Tag</UITag>
+ <HLTag id="basic-tag" size="sm" color="gray">
+   Basic Tag
+ </HLTag>

Type/Color Variants

diff
- <UITag type="success">Success</UITag>
- <UITag type="warning">Warning</UITag>
- <UITag type="error">Error</UITag>
- <UITag type="info">Info</UITag>

+ <HLTag id="success-tag" color="green">Success</HLTag>
+ <HLTag id="warning-tag" color="orange">Warning</HLTag>
+ <HLTag id="error-tag" color="red">Error</HLTag>
+ <HLTag id="info-tag" color="blue">Info</HLTag>

With Icon

diff
- <UITag type="success">
-   <template #icon>
-     <CheckIcon class="w-4 h-4" />
-   </template>
-   Success
- </UITag>

+ <HLTag id="icon-tag" color="green" size="sm">
+   <template #icon>
+     <CheckIcon />
+   </template>
+   Success
+ </HLTag>

With Group (Migration Path)

diff
- <UITag type="info">
-   <template #group>Status</template>
-   Active
- </UITag>

+ <!-- Replace with combination of tags or custom styling -->
+ <div class="flex items-center">
+   <HLTag id="group-label" color="gray" size="sm" :interactive="false">Status</HLTag>
+   <HLTag id="group-value" color="blue" size="sm">Active</HLTag>
+ </div>

Props Changes

Required Props

ghl-ui PropHighRise PropNotes
-idNew required prop for accessibility

Modified Props

ghl-ui PropHighRise PropNotes
typecolorChanged to use semantic color system
sizesizeNew size system ('xs', 'sm', 'md', 'lg')
groupPosition-Removed, use separate tags or custom styling

New Props

PropTypeDefaultDescription
checkboxbooleanfalseEnable checkbox mode
checkedbooleanfalseControl checkbox state
countnumberundefinedDisplay count badge
interactivebooleantrueEnable hover/click states
dropdown'open' | 'close' | falsefalseShow dropdown indicator
disabledbooleanfalseDisable tag interactions
avatarPropsHLAvatarPropsundefinedProps for avatar slot

Color Mapping

ghl-ui TypeHighRise Color
'default''gray'
'primary''blue'
'success''green'
'warning''orange'
'error''red'
'info''blue'

Size Mapping

ghl-ui SizeHighRise SizeNotes
'small''sm'Standard small size
'medium''md'Standard medium size
'large''lg'Standard large size
-'xs'New: Extra small size

Emits Changes

ghl-ui EventHighRise EventNotes
closecloseNow includes tag ID in payload
click-Removed, use checked event for interaction
-checkedNew: Emitted when tag is checked/unchecked

Slots Changes

ghl-ui SlotHighRise SlotNotes
defaultdefaultMain content (unchanged)
iconiconIcon content (unchanged)
group-Removed, use separate tags
-avatarNew: Avatar content

Examples

Basic Tag with Different Colors

vue
<template>
  <div class="flex gap-2">
    <HLTag id="gray-tag" color="gray" size="sm">Default</HLTag>
    <HLTag id="blue-tag" color="blue" size="sm">Primary</HLTag>
    <HLTag id="green-tag" color="green" size="sm">Success</HLTag>
    <HLTag id="red-tag" color="red" size="sm">Error</HLTag>
    <HLTag id="orange-tag" color="orange" size="sm">Warning</HLTag>
  </div>
</template>

<script setup>
import { HLTag } from '@platform-ui/highrise'
</script>

Interactive Tag with Checkbox

vue
<template>
  <HLTag id="checkbox-tag" color="blue" size="md" checkbox v-model:checked="isChecked" @checked="handleChecked"> Selectable Tag </HLTag>
</template>

<script setup>
import { ref } from 'vue'
import { HLTag } from '@platform-ui/highrise'

const isChecked = ref(false)
const handleChecked = checked => {
  console.log('Tag checked:', checked)
}
</script>

Closable Tag with Icon

vue
<template>
  <HLTag id="closable-tag" color="green" size="md" closable @close="handleClose">
    <template #icon>
      <CheckIcon />
    </template>
    Closable Tag
  </HLTag>
</template>

<script setup>
import { HLTag } from '@platform-ui/highrise'
import { CheckIcon } from '@gohighlevel/ghl-icons/24/outline'

const handleClose = () => {
  console.log('Tag closed')
}
</script>

Tag with Count and Avatar

vue
<template>
  <HLTag id="avatar-tag" color="indigo" size="md" :count="5">
    <template #avatar>
      <HLAvatar id="tag-avatar" name="John Doe" size="sm" />
    </template>
    User Tag
  </HLTag>
</template>

<script setup>
import { HLTag, HLAvatar } from '@platform-ui/highrise'
</script>

Breaking Changes

  1. Required ID

    • New required id prop for accessibility
    • Must be unique within the page
  2. Color System

    • Replaced type with color prop
    • New semantic color options
    • More consistent color palette
  3. Size System

    • New size options ('xs', 'sm', 'md', 'lg')
    • More consistent sizing across components
    • Added extra small size option
  4. Group Feature

    • Removed group slot and positioning
    • Use separate tags or custom styling instead
  5. Event Changes

    • Removed generic click event
    • Added checked event for interaction
    • Modified close event payload
  6. Interaction Model

    • New checkbox mode for selection
    • Added dropdown feature
    • Explicit interactive state control
  7. Styling System

    • Uses CSS variables
    • New theming approach
    • Consistent with HighRise design system

Best Practices

  1. Always provide unique id props
  2. Use semantic colors appropriately
  3. Choose appropriate sizes for context
  4. Handle events properly
  5. Consider mobile touch targets
  6. Keep content concise
  7. Use proper spacing
  8. Follow accessibility guidelines
  9. Maintain consistent styling
  10. Document component usage