@hanzo/ui

Tag

import { Tag } from '@hanzo/ui'

No examples yet.

Types

export type TagColor = DataHue | 'transparent'
export type Tag = {
  id: string
  label: string
  /** A data hue: the entry is drawn as a coloured `Tag` rather than a badge. */
  color?: TagColor
}
export type TagVariant = 'soft' | 'solid' | 'outline' | 'ghost'
export type TagProps = Omit<ComponentProps<typeof XStack>, 'children' | 'color'> & {
  /** One of the thirty data hues, or `transparent`. Anything else reads as gray. */
  color?: TagColor | (string & {})
  variant?: TagVariant
  weight?: 'regular' | 'medium'
  /** An icon before the label, drawn at 14px in the tag's ink unless it names its own. */
  startIcon?: ReactNode
  /** After the label: a remove button, a count. */
  endElement?: ReactNode
  /** One line with an ellipsis and an overflow hint (string children). Default true. */
  truncate?: boolean
  /** The outline variant's edge: `dashed` marks an empty value ("No value"). */
  borderStyle?: 'solid' | 'dashed'
  /** Makes the tag a button. */
  onPress?: () => void
  /** Makes the tag a link. */
  href?: string
  disabled?: boolean
  children?: ReactNode
}

Exports

Tagtype TagPropstype TagColortype TagVariant