Radio-button

Radio-buttons são utilizados quando, dentro de um range de opções, apenas uma pode ser selecionada.

Estados de interação

Normal
Hover
Selected
Disabled

Código

HTML
Copiar código
Copiar Código
Exibir código
<label class="radio-button"> <input type="radio" /> <span class="text"> Text here </span> <span class="radiomark"></span> </label>
SASS
Copiar código
Copiar Código
Exibir código
.radio-button { display: block; position: relative; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding-left: 35px; padding-right: 10px; cursor: pointer; min-height: 25px; margin: 13px 0; box-sizing: border-box; width: 250px; max-width: 100%; transition: .4s; &.disabled{ pointer-events: none; } .text{ font-family: Lato; font-size: 1em; font-weight: normal; font-style: normal; font-stretch: normal; line-height: 26px; letter-spacing: normal; color: #323232; white-space: nowrap; display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; transition: .4s; } input{ position: absolute; opacity: 0; &:checked + .text { color: #3153f5; } &:checked ~ .radiomark { background-color: #fff; border-color: #3153f5; } &:checked ~ .radiomark:after { display: block; } } .radiomark { position: absolute; top: 0; left: 0; height: 24px; width: 24px; background-color: #fff; border: 1px solid #858585; border-radius: 50%; box-sizing: border-box; &:after { content: ""; position: absolute; display: none; top: 4px; left: 4px; width: 14px; height: 14px; border-radius: 50%; background: #3153f5; } } &:hover, &.hovered{ .radiomark{ border-color: #1b68ff; } .text{ color: #1b68ff; } } &.disabled{ .radiomark{ background-color: #ebebeb; border-color: #ebebeb; } .text{ color: #9b9b9b; } } }