Skip to content

SClickableChip <s-clickable-chip> ​

ts
import { SClickableChip } from 'polaris-vue-elements'

Example ​

Visit Polaris Removable chip
vue
<script setup>
import { ref } from 'vue'
import { SClickableChip, SIcon } from 'polaris-vue-elements'

const removed = ref(false)
</script>

<template>
  <!-- SClickableChip is a Chip that can act as a link (href) or command trigger,
       and its `graphic` slot only accepts an SIcon. -->
  <SClickableChip href="https://polaris.shopify.com" target="_blank">
    <template #graphic>
      <SIcon type="external" />
    </template>
    Visit Polaris
  </SClickableChip>

  <!-- removable chips fire `remove`; drive `hidden` from app state to actually hide it. -->
  <SClickableChip removable :hidden="removed" @remove="removed = true">
    Removable chip
  </SClickableChip>
</template>

Props ​

PropTypeDescription
accessibilityLabelstringA label that describes the purpose or contents of the Chip. It will be read to users using assistive technologies such as screen readers.
color"subdued" | "base" | "strong"Modify the color to be more or less intense.
command"--auto" | "--show" | "--hide" | "--toggle" | "--copy"Sets the action the commandFor should take when this clickable is activated. See the documentation of particular components for the actions they support. - --auto: a default action for the target component. - --show: shows the target component. - --hide: hides the target component. - --toggle: toggles the target component. - --copy: copies the target ClipboardItem.
commandForstringID of a component that should respond to activations (e.g. clicks) on this component. See command for how to control the behavior of the target.
disabledbooleanWhether the chip is disabled, preventing any user interaction.
hiddenbooleanWhether the chip is hidden from view. When using controlled component pattern with removable chips, update this property when the remove event fires. For non-removable chips, manually toggle this property to show or hide the chip.
hrefstringThe URL to navigate to when clicked. The click event fires first, then navigation occurs. If commandFor is also set, the command executes instead of navigation.
interestForstringID of a component that should respond to interest (e.g. hover and focus) on this component.
removablebooleanWhether the chip displays a remove button for dismissal. When clicked, the remove callback fires.

Events ​

EventType
afterhideCustomEvent
clickCustomEvent
removeCustomEvent

Listen for these with @afterhide-style listeners on <SClickableChip>.

Slots ​

SlotDescription
defaultThe text label displayed within the chip, which represents an interactive filter, tag, or selectable item.
graphicAn optional icon to display at the start of the chip. Accepts only icon components.

Released under the MIT License.