Skip to content

Accessibility: Work in progress

Translations: Not Needed

Input Tag

A component for inputting and managing multiple tags

Basic Usage

To create a new tag, type text into the input field and press Enter. Pressing Backspace will remove the most recently added tag.

+0

Type and press Enter to create a tag

Vue
html
<template>
  <HLInputTag placeholder="Type and press Enter to create a tag" />
</template>

<script setup lang="ts">
  import { HLInputTag } from '@platform-ui/highrise'
</script>

Sizes

+0

Large size

+0

Medium size

+0

Small size

+0

Extra small size

+0

2x Extra small size

+0

3x Extra small size

Vue
html
<template>
  <HLInputTag size="lg" placeholder="Large size" />
  <HLInputTag size="md" placeholder="Medium size" />
  <HLInputTag size="sm" placeholder="Small size" />
  <HLInputTag size="xs" placeholder="Extra small size" />
  <HLInputTag size="2xs" placeholder="2x Extra small size" />
  <HLInputTag size="3xs" placeholder="3x Extra small size" />
</template>
<script setup lang="ts">
  import { HLInputTag } from '@platform-ui/highrise'
</script>

With Prefix and Suffix

$

+0

INR
Vue
html
<template>
  <HLInputTag>
    <template #prefix>$</template>
    <template #suffix>INR</template>
  </HLInputTag>
</template>
<script setup lang="ts">
  import { HLInputTag } from '@platform-ui/highrise'
</script>

Disabled State

+0

Vue
html
<template>
  <HLInputTag disabled />
</template>
<script setup lang="ts">
  import { HLInputTag } from '@platform-ui/highrise'
</script>

With Input Group

http://

+0

Vue
html
<template>
  <HLInputGroup>
    <HLInputGroupLabel>http://</HLInputGroupLabel>
    <HLInputTag />
  </HLInputGroup>
</template>
<script setup lang="ts">
  import { HLInputGroup, HLInputGroupLabel, HLInputTag } from '@platform-ui/highrise'
</script>

Tag Overflow Behavior

When there are too many tags to fit in the container, they are automatically hidden and shown in a "+n" counter. Hovering over the counter reveals all hidden tags in a tooltip.

Tag 1

Tag 2

Tag 3

Tag 4

Tag 5

Tag 6

Tag 7

Tag 8

Tag 9

Tag 10

Tag 11

Tag 12

Tag 13

Tag 14

Tag 15

Tag 16

Tag 17

Tag 18

Tag 19

Tag 20

+0

Vue
html
<template>
  <HLInputTag :value="tags" @update:overflow="handleOverflow" />
</template>

<script setup lang="ts">
  import { HLInputTag } from '@platform-ui/highrise'
  import { ref } from 'vue'
  const tags = ref(['Tag 1', 'Tag 2', 'Tag 3', 'Tag 4', 'Tag 5', 'Tag 6', 'Tag 7'])

  function handleOverflow(overflow: boolean) {
    console.log('Tags are overflowing:', overflow)
  }
</script>

Allow Spaces in Tags

By default, spaces are not allowed in tags. Set allowSpaces to true to enable spaces within tags.

+0

Spaces allowed in tags

Vue
html
<HLInputTag :allowSpaces="true" placeholder="Spaces allowed in tags" />

Loading State

Display a loading indicator while processing tag-related operations.

Loading Tags...

+0

Vue
html
<HLInputTag :loading="true" :value="['Loading Tags...']" />

Imports

ts
import { HLInputTag } from '@platform-ui/highrise'

Props

NameTypeDefaultDescription
id *string | undefinedundefinedUnique identifier for the input tag
placeholderstring'Start typing...'Placeholder text when no tags are present
size'lg' | 'md' | 'sm' | 'xs' | '2xs' | '3xs''sm'Size of the input tag
disabledbooleanfalseWhether the input tag is disabled
autofocusbooleanfalseWhether to focus the input automatically
loadingbooleanfalseWhether to show loading state
allowSpacesbooleanfalseWhether to allow spaces in tags
valuestring[] | undefinedundefinedArray of tag values

Emits

NameParametersDescription
@input(event: Event)Triggered on input
@input:blur(event: Event)Triggered when input loses focus
@input:focus(event: Event)Triggered when input gains focus
@update:value(value: string[])Triggered when tags array is updated
@click({ event: Event, index: number })Triggered when a tag is clicked
@close({ event: Event, index: number })Triggered when a tag's close button is clicked
@update:count(count: number)Triggered when hidden tags count changes
@update:counter(count: number)Triggered when visible counter value changes
@update:overflow(overflow: boolean)Triggered when tags overflow container

Slots

NameDescription
prefixContent to show before the input
suffixContent to show after the input

Key Interactions

KeyAction
EnterCreates a new tag from the current input value
BackspaceDeletes the last tag when input is empty
EscapeBlurs the input field