1.1.1 • Published 6 years ago

react-togglr v1.1.1

Weekly downloads
16
License
MIT
Repository
github
Last release
6 years ago

react-togglr

React library for building declarative toggle components

Example

const UserProfileDropdown = ({ avatarUrl, name }) => (
  <Toggle
    render={({ on, toggle }) => (
      <div className="UserProfileDropdown">
        <img className="UserProfileDropdown-avatar" src={avatarUrl} />
        <span className="UserProfileDropdown-name" onClick={toggle}>
          {name}{' '}
          <img
            src={arrow}
            className={`UserProfileDropdown-arrow ${on
              ? 'UserProfileDropdown-arrow--on'
              : ''} `}
          />
        </span>
        {on ? <Menu /> : null}
      </div>
    )}
    onToggle={({ on }) => console.log(`${on ? 'ON' : 'OFF'}`)}
  />
);

Built With

Authors

  • Vicent Gozalbes - Initial work - vigosan

License

This project is licensed under the MIT License - see the LICENSE.md file for details

1.1.1

6 years ago

1.1.0

7 years ago

1.0.0

7 years ago