Accordions[ Variable Reference ]

Since v4.4.0, Jellyfish has included support for ARIA accessible accordions. Accordions are a great way to present content in a limited space, allowing users to expand and collapse sections as needed.

Including an accordion pattern within Jellyfish UI reduces the reliance on external Javascript libraries, ensuring a consistent experience across your project.

A Basic Accordion

Accordions require the following markup to function properly. When the document loads, accordions will automatically be detected by Javascript and made ARIA-accessible with automatic IDs, aria-attributes and the Accordion Heading converted into a button.

You can inspect the rendered example to see what the markup looks like after the Javascript has processed it.

    
  

Ancient Survivors

Jellyfish have existed for over 500 million years, predating dinosaurs and even trees. Fossil evidence shows they've survived multiple mass extinction events that wiped out countless other species, making them one of Earth's most resilient life forms.

Fishy Imposters

Despite the name, jellyfish aren't fish at all. They're invertebrates called medusae, belonging to the phylum Cnidaria. Scientists prefer the term "jellies" or "sea jellies" to avoid the confusion with actual fish.

Watery Beasts

Jellyfish bodies are composed almost entirely of water, with no brain, heart, or bones. Their simple body structure consists mainly of a gelatinous umbrella-shaped bell and trailing tentacles. Despite lacking a brain, they have a basic nervous system that helps them detect light, odors, and other stimuli.

Accordion Options

Add data-allow-multiple to allow multiple accordion items to be open simultaneously. Add data-start-collapsed to have all accordion items start in a collapsed state.

    
  
Immortality? Completed it, Mate.

The Turritopsis dohrnii can reverse its aging process and potentially live forever by reverting to its juvenile stage. When faced with injury, starvation, or old age, it transforms back into a polyp and starts its life cycle over again, essentially achieving biological immortality?

That stings!

The box jellyfish has venom potent enough to kill a human in minutes, making it one of the ocean's most dangerous creatures. Their tentacles contain thousands of microscopic stinging cells called nematocysts that inject toxins affecting the heart, nervous system, and skin cells simultaneously.

Colors

If $generate-accordion-modifiers is set to true you can use a color modifier from the $colors map to apply formatting to an accordion or an accordion-item.

    
  
Giant Tentacles

The lion's mane jellyfish can grow tentacles over 100 feet long, making it longer than a blue whale. Found in cold Arctic waters, the largest recorded specimen had a bell diameter of over 7 feet and tentacles reaching an astounding 120 feet in length.

Glow Up

Many jellyfish species produce their own light through chemical reactions, creating stunning displays in dark waters. This bioluminescence can serve multiple purposes including attracting prey, deterring predators, and even communicating with other jellyfish in the murky depths.

Breathe Easy

They absorb oxygen directly through their skin and have no need for lungs or circulatory systems. Their thin membrane allows gases to diffuse in and out efficiently, while nutrients from digested food spread throughout their body via a simple gastrovascular cavity.

Smack My Fish Up

Groups of jellyfish, called blooms or smacks, can contain hundreds of thousands of individuals and clog fishing nets. These population explosions are becoming more frequent due to warming oceans and overfishing, sometimes shutting down power plants when they block cooling water intake pipes.

The color variants are opinionated, but it's easy to override them with custom CSS properties:

    
  

The base styling with be set with SASS variables for ease.