Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include more example in a documentation page #20

Closed
titse opened this issue Nov 14, 2017 · 7 comments
Closed

Include more example in a documentation page #20

titse opened this issue Nov 14, 2017 · 7 comments

Comments

@titse
Copy link

titse commented Nov 14, 2017

Please include more example for this React component. For example, I would like to know how would I style my toggle button and add onClick handler function.

@arnthor3
Copy link
Owner

What exactly do you want to style?
There is a small example for the onClick in the readme.
I will try to commit a couple of examples asap.

@titse
Copy link
Author

titse commented Nov 14, 2017

  1. I would like to style the button with example of being able to pass additional props such as class name or id. I would like to be able to change the color of the button and the slider. I would like to see an example if we can add icons to the button in addition to text.
  2. I would like to know how the onClick button works with a example such as triggering an event. It could be simple as toggle a message "Hello React World!" into the HTML page. I am using event and state to trigger a change in state object to set value to "Complete".

If I come up with any more use cases, I will post here.

@arnthor3
Copy link
Owner

I added a folder, "examples", I threw a couple of comments there.
Regarding the styles, the component adds a prefix to the classnames you pass in the offstyle and the onstyle props with "btn". So if you would create a custom class 'off_style' you would need to add the prefix 'btn-' to the name so it would be 'btn-off_style'. Yeah, this is begging for a more elegant solution, I know..

@titse
Copy link
Author

titse commented Nov 15, 2017

Okay! I shall take a look! Thank you!

@titse
Copy link
Author

titse commented Nov 15, 2017

Would it be possible you push fix#22 to npm? I close out this issue when Issue#22 has been completed

@arnthor3
Copy link
Owner

Nice, I published, hope it works.

@titse
Copy link
Author

titse commented Nov 15, 2017

Thanks!

@titse titse closed this as completed Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants