Giter Club home page Giter Club logo

titatoggle's Introduction

TiTatoggle - (bootstrap 4 addon without JS)

Using awesome toggle buttons without Javascript or any other logic, other than plane form elements. The Pattern is the same as Twitter-Bootstrap. So it can be implemented without a breeze.

Browser support: Internet Explorer 9/10/11, Edge, FireFox, Safari, Chrome, Safari Ios, Stock Android browser 4.2, Chrome Android

Install package:

$ npm install titatoggle --save-dev (Bootstrap 4.x.x)
$ npm install [email protected] --save-dev (Legacy bootstrap 3.x.x)
$ yarn add titatoggle
$ bower install titatoggle

Example usage

<div class="checkbox checkbox-slider--X">
	<label>
		<input type="checkbox"><span>checked</span>
	</label>
</div>

More examples can be found at the documentation site:Titatoggle

MIT License

titatoggle's People

Contributors

auspexeu avatar bruce17 avatar dot-underscore avatar jdonaldson10 avatar kleinejan avatar pvnr0082t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

titatoggle's Issues

styling not correct when used within Bootstrap .form-horizontal

When used in plain Bootstrap form, everything is fine:

<form>
        <div class="checkbox checkbox-slider--default">
            <label>
                <input type="checkbox"><span>TiTaToggle</span>
            </label>
        </div>
    </form>

When used within form-horizontal:

<form class="form-horizontal">
        <div class="checkbox checkbox-slider--default">
            <label>
                <input type="checkbox"><span>TiTaToggle</span>
            </label>
        </div>
    </form>

then, because of this Bootstrap css rule, and this property: padding-top: 7px:

.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
  padding-top: 7px;
  margin-top: 0;
  margin-bottom: 0;
}

the handle and its container are not top aligned - the container is pushed down, but not the handle.

A way to correct, for my limited css knowledge, may be to add margin-top: 7px; to this rule

.checkbox-slider--default input + span:after {
  background: #ffffff;
  border: solid transparent 1px;
  background-clip: content-box;
}

and all other rules like this one.

Regards and thanks for great component!
Tomasz

Browser support info

Hi!

This looks like a great plugin!

What is the browser support for these checkboxes?

Support radiobutton toggle

Use 2 radiobuttons (group) to toggle a value/switch, the same way as a checkbox does currently.
Semantically not ideal but this is no ideal world :)

Radio button

Make the same pattern for Radio buttons.
A two way toggle between values.

Printing issue

Printing does not print switches but does print checkboxes. Otherwise, it is plum! :)

How to install without node?

Hello!

I would like to use titatogle but I don't work with node. How I can install and use without node? For example, I work with bootstrap 4. Maybe, I just need to change the css? Please, a step by step would be nice. Thank you.

Nice job!

Nice job. Is it possible to turn radio buttons into switches. I use bootstrap switch but I would prefer a pure less solution. Thank you.

Better CSS positioning

I'm trying to get the sliders to be positioned relative to the text vs relative to the parent. When I have a container where the text is centered and I want the checkboxes centered, its no bueno.

screenshot 2017-02-25 22 14 05

checked and unchecked via JS

Hi there, Thanks for your work! It's great and so simple solution!

But I have one problem - it's checking and unchecking the styled checkbox via JS. Here is the demo http://take.ms/ysu1S , I can't set checked attribute to the styled checkbox. Do you have any ideas here?

Release

When do you plan to release a new version with the last most recent changes?

Focus ring in Chrome

When you click on the toggle you get a focus ring or outline when using Chrome (I'm using latest version on Mac). Safari and Firefox don't have this issue.

I can't seem to get rid of it using the usual :focus {outline: none;} or
outline-style:none;
box-shadow:none;
border-color:transparent;

Not working with ReactJS

Hello. I've included the titatoggle-dist.css into my ReactJS project but the toggle doesn't seem to be working (looks disabled). Is there something I may be doing wrong?

<div className="checkbox checkbox-slider--b-flat checkbox-slider-warning"><input type="checkbox" /><span></span></div>

Performance issue with Cordova

Hi there. Somehow the responsiveness of these are impacted when used on a cordova project with iOS. It seems that there is an initial delay before hand.

I am using this one in my case:

  <div class="checkbox checkbox-slider--c checkbox-slider-info">
    <label>
      <input type="checkbox"><span>something</span>
    </label>
  </div>

When running grunt serve and played through chrome there is no performance issues.
When running cordova emulate ios or cordova build ios and loading it on iPhone through xCode that is when there is a 0.5second delay.

Would you have any idea to why?

Thank you! and otherwise very cool stuff.

Appearance does not work on rounded toggles

This results in a green slider - it should be red:

<div class="checkbox checkbox-slider--a-rounded checkbox-slider-danger">
    <label>
        <input type="checkbox" checked><span>checked</span>
    </label>
</div>

Allow customized On/Off text

I'd love to be able to toggle between states like "absolute/relative" what that text currently within the toggle where the "On/Off" text currently lives. Is there a way to customize this?

Text does not styled properly.

I'm trying to duplicate the results here:
http://kleinejan.github.io/titatoggle/

Specifically, first and last lines of this:
screen shot 2018-03-04 at 12 51 09 pm

Using this code:

<div class="checkbox checkbox-slider--default">
	<label>
		<input type="checkbox">
		<span>default</span>
	</label>
</div>
		
<div class="checkbox checkbox-slider--default">
	<label>
		<input type="checkbox" disabled>
		<span>disabled</span>
	</label>
</div>

I get this instead:
screen shot 2018-03-04 at 12 55 00 pm

Here's the test project.
titatoggle.zip

Your example seems to reference classes which are not in titatoggle-dist.css.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.