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

Missing binding examples for all form components #189

Open
jerefrer opened this issue Nov 9, 2023 · 4 comments
Open

Missing binding examples for all form components #189

jerefrer opened this issue Nov 9, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@jerefrer
Copy link
Contributor

jerefrer commented Nov 9, 2023

Link to the Page

https://stwui.vercel.app/toggle

Describe the Issue (screenshots encouraged!)

I'll take the Toggle component for instance.

We have many examples demonstrating the use of all kinds of options, but nowhere on the page is actually explained how to wire this component to a Svelte variable.

To understand that I need to scroll all the way down to the Toggle Props table and understand that I should bind:on={myVar}.

Same with Checkbox, I have to understand that I need to bind:checked={myVar} by looking way down the doc page. And then when looking in the console I see <Checkbox> was created without expected prop 'value', so I have to end up with something like the following to get rid of the warning:

<Checkbox
	name="my-variable"
	value={myVar}
	bind:checked={myVar}
>
	<Checkbox.Label slot="label">My variable</CheckboxGroup.Checkbox.Label>
</Checkbox>

And I'm not even sure that's absolutely necessary, since it works just with the bind:checked={myVar}.
Then there was this bug coming from omitting to set the name attribute.

Wouldn't it be much simpler that all examples for all form components include something like bind:on={myVar}?
In that way the example could just be copied and pasted in one's code without spending more time trying to understand how STWUI was built.

It was even more frustrating for me when I tried to use Select, as I tried to describe in this other issue.

Thank you for reading all this, and for building this library that is otherwise quite enjoyable to use ;)

@jerefrer jerefrer added the documentation Improvements or additions to documentation label Nov 9, 2023
@N00nDay
Copy link
Owner

N00nDay commented Nov 13, 2023

I don't disagree with you. This just comes back to available time. If I get a moment I will work on this but functionality always wins for the moments I do have available.

@jerefrer
Copy link
Contributor Author

Thank you for at least having found the time to consider all my complaints :)

Are the docs also on Github? Could I maybe try to find time to make a pull request for that one?

@ogrotten
Copy link

ogrotten commented Dec 5, 2023

but functionality always wins for the moments I do have available.

And yet documentation or clearer UX would have prevented 2 posts.

@N00nDay
Copy link
Owner

N00nDay commented Dec 23, 2023

Thank you for at least having found the time to consider all my complaints :)

Are the docs also on Github? Could I maybe try to find time to make a pull request for that one?

The docs are included in this repo so they can be altered within the repo. My apologies for the delayed response. End of year with work and holidays have been keeping me tied up at the moment. Please feel free to contribute by updating the docs. It would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants