ComponentsTag

Tag

A Tag is one word that describes a specific aspect of an asset. A single asset can have multiple tags. Use tags to highlight an item's status for quick recognition and navigation Use color to indicate meanings that users can learn and recognize across products It leverages the Chip component from Material UI

Usage
import { HvTag } from "@hitachivantara/uikit-react-core";
Source
Package
Tag label

Different colors

You can change the default color of the tag by passing a color name from the UI Kit color palette, a CSS color name or a hex color code.

Tag Label
Tag Label
Tag Label
Tag Label

Long text

The tag component will automatically truncate the text if it is too long to fit in the container. You can add a tooltip to show the full text when the user hovers over the tag.

This is an example of a extremely long tag

Actions

Tags can have actions. Use the onClick prop to add an action to the tag.

Click me!

Deletable tags

You can add a delete button to the tag by using the onDelete prop.

Deletable tag

Controlled selectable state

To use the selectable tags in a controlled way, set the selected prop to true of false.

Asset 1
Asset 2
Asset 3
Asset 4
Selected tags: 

Asset 1, Asset 3