-
Notifications
You must be signed in to change notification settings - Fork 4
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
code examples #73
base: main
Are you sure you want to change the base?
code examples #73
Conversation
be4fd10
to
93c6c1b
Compare
I think having the first example being a simpler one is probably good. I do think, generally, people always want the the architecture with the yields though -- because folks always want a "Menu" component that's generic and can be used for any kind of menu. Any chance you'd be willing to write up an example of this pattern?
<MyMenu>
<:trigger>
text / icon / etc, maybe button if this were to yield yet another modifier,
but _that_ may be out of scope here
</:trigger>
<:menu as |Item|>
<Item> a </Item>
<Item> b </Item>
</:menu>
</MyMenu> |
Good point. Having a complex example that shows the real world scenario is a good idea. Will re-do. |
- Remove the calls to `{{yield}}` those seem to assume some more complex code structure that is not obvious from the README examples - Give complete, working example using headless-ui - I _think_ this makes a good, yet simple to follow starting point?
- Introduce complete example of <MyMenu> component - Most of the code taken from: - https://github.com/GavinJoyce/ember-headlessui/tree/master/tests/dummy/app/components - Introduce <MyMenu::Item> for styling abilities - To overcome: emberjs/rfcs#497
93c6c1b
to
cb0dd92
Compare
Ok, I got a little bit tangled over how to yield a pre-defined component. To my best understanding this is not really possible (yet) so I just went ahead and created |
Remove the calls to
{{yield}}
- those seem to assume some more complex code structure(?) that is not obvious from the README examplesGive complete, working example using headless-ui
I think this makes a good, yet simple to follow starting point?
Giving it out there as a newcomer who had trouble figuring out bits