[v4] How to add classes and data attributes in Messages

Reading the docs (Messages module), I see the following two message parameters:

  • cssClass
  • attrs

When I try to use them on Framework7 V4 nothing happens. This is my code:

text: ‘Content…’,
type: ‘received’,
cssClass: ‘unread’,
attrs: {
‘data-id’: 1,


Are these two message parameters not available on Framework7 V4? Is there another way to achieve it?

Try to add a name, maybe of this it doesn’t work

Thanks for your answer. I have tried adding name parameter but is not working neither. Should I be able to use cssClass and attrs parameters on Framework7 V4?

Yes, these params available in v4. Just make sure you have latest v4.x.x or better update to v5, there is not much things to change for v5