olton / Metro-UI-CSS

Impressive component library for expressive web development! Build responsive projects on the web with the first front-end component library in Metro Style. And now there are even more opportunities every day!
http://metroui.org.ua/
MIT License
7k stars 1.97k forks source link

TriState Checkbox #1834

Open Stankman opened 2 years ago

Stankman commented 2 years ago

A Three State Checkbox

I think it would be pretty useful for people who don't want to use radio buttons and this one looks pretty more compact :)

Three Custom Values, data-value-1 data-value-2 data-value-3 I guess, I don't know how this one works but I have seen it in other UI Frameworks.

I just thought of this component because I ran into a situation where I have options like: 0, 1 or 2, but a simple Switch or checkbox is not sufficient. And this TriState Checkbox would be great as a solution using MetroUI

TriState

xscode-auto-reply[bot] commented 2 years ago

Thanks for opening a new issue. The author has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/olton/Metro-UI-CSS or Patreon

TorakikiSan commented 2 years ago

You can't use this? (from Metro documentation)

immagine

Stankman commented 2 years ago

You can't use this?

(from Metro documentation)

immagine

Its not quite the same, because you aren't giving any exact value to it or... hmm at least I cant think of how implementing it to change 3 times on 3 clicks

olton commented 2 years ago

https://codepen.io/olton/pen/JjyJBZa?editors=1000

olton commented 2 years ago
olton commented 2 years ago

Definition

<input type="checkbox" data-role="checkbox-three-state" data-caption="Checkbox">