framework7io / framework7io/framework7

UX - Toggle with Yes/no label + lang - only with css -

Open
#2,508 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
JavaScript
Stars
18.8k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Hi Vladimir, I've done a user test and saw some things to improve, about people of 50-60 years using the phone.

They don't understand if the toggle is "on" or "off"
ex:
image

The solution that we found is add a "yes" or "no" label, each time they click it, and my Damian, from my team solved it only with css.

Maybe you could add it to the core of f7.

  1. Add a lang to the like this:
    <html lang="en">
  2. add this css rule
html[lang="en"] .toggle input[type="checkbox"]:checked + .toggle-icon:before {
		content: "Yes";
	}

The full html example code (in spanish) is:

 <li class="item-content item-input">

        <div class="item-inner">
            <span>{{nombre}}</span>
            <label class="toggle toggle-init color-green">
                <input type='checkbox' class='f chk_usuarios' name='chk_usuario' id='chk_usuario_{{uuid}}' value='{{uuid}}' {{#if habilitado}} checked='checked' {{/if}} >
                <span class="toggle-icon"></span>
            </label>
        </div>

</li>

and the results are:

image

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Framework7's toggle component markup and CSS, then compare it with the checkbox and .toggle-icon structure shown in the issue. The change is done when toggles visibly communicate their checked state with Yes/No labels and support the requested language-based styling without affecting existing toggle behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html, javascript
Domain
frontend, mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.