Issue
I have a tooltip from PrimeNG and I want to add a label and a caption to both be displayed with different styling in the tooltip. Is there a way I can do this using using the pTooltip? Are there any better alternatives?
Current tooltip:
Code Fragment:
<div class="field">
<label for="firstname" class="p-sr-only">Username</label>
<input id="firstname" type="text" pInputText placeholder="Username" pTooltip="Enter your username">
</div>
<button pButton pRipple type="button" label="Save" icon="pi pi-check" pTooltip="Click to proceed"></button>
Desired Layout:
Solution
PrimeNG's tooltip can render HTML if you disable the escape attribute:
<button pButton type="button" label="Save" icon="pi pi-check" pTooltip="<div>LABEL</div><br/><div>Caption</div>" [escape]="false"></button>
Answered By - skink


0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.