To implement this functionality in Primeng, a workaround is needed as there is no direct way to do it. Although not the ideal solution, it can still fulfill your requirements.
For instance, let's consider the Primeng Radio button.
In order to customize it, a custom class customeRadio is added in the html along with an <a>
tag for the option value.
<div class="ui-g-12 customeRadio">
<p-radioButton name="group1" value="Option 1" label="Option 1" [(ngModel)]="val1" inputId="opt1">
</p-radioButton><a href="">Option 1</a>
</div>
<div class="ui-g-12 customeRadio">
<p-radioButton name="group1" value="Option 2" label="Option 2" [(ngModel)]="val1" inputId="opt2">
</p-radioButton><a href="">Option 2</a>
</div>
<div class="ui-g-12 customeRadio">
<p-radioButton name="group1" value="Option 3" label="Option 3" [(ngModel)]="val1" inputId="opt3">
</p-radioButton><a href="">Option 2</a>
</div>
To apply styles, navigate to the styles.css file or any other location where you prefer to add the css for it.
Use the following css selector property to hide all label content:
.customeRadio label{
display:none;
}
That covers it!