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

Allow passing accordion title/content via slots #1288

Open
3 of 4 tasks
bgilhome-now opened this issue Aug 13, 2024 · 3 comments · Fixed by #1327
Open
3 of 4 tasks

Allow passing accordion title/content via slots #1288

bgilhome-now opened this issue Aug 13, 2024 · 3 comments · Fixed by #1327
Assignees

Comments

@bgilhome-now
Copy link
Contributor

Describe the feature

To be able to easily render a component (e.g. a RplDataTable) within a RplAccordion item, by using a slot for accordion content.

Motivation

Currently the accordion takes an items array of objects to define item id, title & content (HTML passed as string). This makes it difficult to setup complex HTML or render Vue components in accordion content.

Proposal

Use a slot (default slot) to capture accordion content. The slot content's children will be used as the content for the separate items entries. i.e. slot children length must equal items length.

Titles could optionally be passed the same way, via a named slot title. The items prop could even be optional, using an auto-assigned integer index (1-based) as item.id if not set.

Benefits

Ease of rendering accordions with complex content.

Drawbacks

Maybe confusion as to the slot children aspect (i.e. slot has 5 tags => 5 accordion items)? Might dynamically named slots e.g. <slot name="content[0]"> be better, or more confusing?

Adoption strategy

Update documentation. No breaking changes, accordion can be used as current.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be created outside of Ripple-framework as a layer?

Final checks

@bgilhome-now
Copy link
Contributor Author

PR at the above issue.

@dylankelly
Copy link
Contributor

Agree with this entirely @bgilhome-now - It was missed when it was originally implemented. I'll see what we can do to get this in the backlog

@dylankelly dylankelly added Proposal - planned and removed Proposal - Draft New feature proposal labels Aug 13, 2024
@bgilhome-now
Copy link
Contributor Author

Thanks @dylankelly !

@waitingallday waitingallday linked a pull request Sep 16, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants