DEV Community

Discussion on: Show and Hide Content Easily With details and summary HTML Tags

Collapse
cezaraugusto profile image
Cezar Augusto

Hey @vtrpldn , nice post! Great to know about summary/details, love dynamic HTML elements.

btw is it possible (semantically?) to have the component to display in an "open" state by default? Would be cool! :)

Collapse
vtrpldn profile image
Vitor Paladini Author

Hey, Cezar. Thanks!

Yes, you can add an open attribute to it, like so: <details open> and the details box will start in an opened state

Collapse
cezaraugusto profile image
Cezar Augusto

cool, thanks! been learning nice stuff from your posts here on DEV, keep them coming!