Back to Fluentui

Badge Migration

packages/react-components/react-persona/library/docs/MIGRATION.md

4.40.2-hotfix22.3 KB
Original Source

Badge Migration

Migration from v8

v8 offers a component equivalent to v9's Persona. However, the API is slightly different. The main difference is that v9's Persona does not handle the functionality of the presence and avatar. Instead, the presence and avatar are separate components that can be used in conjunction with Persona.

Here's how the API of v8's Persona compares to the one from v9's Persona component:

  • className => className
  • coinProps => Use avatar's or presence's slot props
  • componentRef => NOT SUPPORTED - use ref instead
  • hidePersonaDetails => Use the Avatar component for this case
  • imageShouldFadeIn => NOT SUPPORTED
  • isOutOfOffice => Use the outOfOffice prop of the presence slot. E.g.: presence={{ outOfOffice: true }}
  • presence => Use the status prop of the presence slot. E.g.: presence={{ status: 'away' }}
  • presenceTitle => NOT SUPPORTED
  • showOverflowTooltip => NOT SUPPORTED
  • showUnknownPersonaCoin => NOT SUPPORTED
  • styles => Use style customization through className instead

Property Mapping

v8 Personav9 Persona
coinPropsavatar or badge slot props
coinSizesize
classNameclassName
componentRefref
hidePersonaDetails-
imageShouldFadeIn-
isOutOfOfficestatus in presence slot props
optionalTextquaternaryText
presencepresence
presenceTitlename
primaryTextname
secondaryTextsecondaryText
showOverflowTooltip-
showUnknownPersonaCoin-
stylesclassName
tertiaryTexttertiaryText
textname