Skip to content

Add name attribute to group of preview details so they behave like accordions #256

@herbdool

Description

@herbdool

I recently found out that by adding the name attribute to details it will make a group of details elements to behave like accordions.

This attribute enables multiple <details> elements to be connected, with only one open at a time. This allows developers to easily create UI features such as accordions without scripting.

The name attribute specifies a group name — give multiple <details> elements the same name value to group them. Only one of the grouped <details> elements can be open at a time — opening one will cause another to close. If multiple grouped <details> elements are given the open attribute, only the first one in the source order will be rendered open.

I suggest we add the name attribute so only one of the previews is open at a time. Perhaps this should be an option as well in case someone wants to be able to open multiple at the same time and manually close them.

Follow-up to #230 and #229

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions