I am new to element ui and css. I want to create the custom radio as shown in the photo. When the user clicks on a radio button, the selected radio button will display a checkmark (✔) symbol inside the radio button to indicate selection. Is there any way to create this with element ui with css class?
2
Answers
I hope you get some idea. I tried my best, and I hope you are satisfied with this.
First let’s see how to create a check, tick icon using SVG:
we need a green polyline with with rounded caps made of three points (by using
points="x,y x,y x,y"
)<label>
label
element in CSS use thelabel:has([type=ratio])
selectorlabel
usinglabel:has([type=radio]:checked)
appearance: none;
on the radio element and custom-style it accordingly[type=radio]:checked
use the SVG icon as its centered background image, just make sure to replace (uri escape) any instance of#
with%23
(like i.e: for the stroke color hash value)