Tristate component #2148
WolfgangFahl
started this conversation in
Show and tell
Replies: 2 comments
-
|
nice. It could be used for Minesweeper if more states are supported |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
the number of states is actually not limited |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Candidate for #1618
Summary
Addition of a new class named
Tristateto the NiceGUI widgets project. This class provides a tri-state toggle input component that leverages predefined Unicode icon sets for visual representation, handling state changes entirely within Python without relying on JavaScript logic for state management.Demo
http://ngdemo.bitplan.com/tristate

Details
The
Tristatecomponent allows users to cycle through three states, each represented by a distinct Unicode icon. It's designed to integrate seamlessly with the existing NiceGUI application structure, offering a reactive UI component that updates its display based on user interactions.Here are the key features of the
Tristatemodule:Example Icon Sets for Tristate Module
arrows- Left Arrow (←), Up-Down Arrow (↕️), Right Arrow (→)ballot- Ballot Box (☐), Ballot Box with Check (☑️), Ballot Box with X (☒️)check- Checkbox (☐), Question Mark (❔), Checkmark (✔️)circles- Circle (⭘), Bullseye (🎯), Fisheye (🔘)electrical- Plug (🔌), Battery Half (🔋), Lightning (⚡)faces- Sad Face (☹️), Neutral Face (😐), Happy Face (☺️)hands- Thumbs Down (👎), Hand (✋), Thumbs Up (👍)hearts- Empty Heart (♡), Half Heart (❤️), Full Heart (❤️)locks- Unlocked (🔓), Locked with Pen (🔏), Locked (🔒)marks- Question Mark (❓), Check Mark (✅), Cross Mark (❌)moons- New Moon (🌑), Half Moon (🌓), Full Moon (🌕)musical_notes- Single Note (♪), Double Note (♫), Multiple Notes (🎶)stars- Empty Star (☆), Half Star (★), Full Star (★)traffic_lights- Red (🔴), Yellow (🟡), Green (🟢)weather- Cloud (☁️), Sun (☀️), Thunderstorm (⛈️)Implementation Details
-tristate.py
-tristate.js
The
Tristateclass was developed adhering to the following criteria:blackandisort.References
The
Tristatemodule is inspired by the following resources:Beta Was this translation helpful? Give feedback.
All reactions