MorphCanvas
Home › Gallery › FAQ Accordion Widget
Reading size:

FAQ Accordion Widget

A compact, dependency-free FAQ accordion with smooth expand/collapse on a dark background.

★ 0 community votes · Safety scan passed · Sandboxed preview
Listen to Component Overview (AI Narration)
Viewport:
Backdrop:
Safety Scan
Verified Safe (0 Violations)
Sandbox Isolation
Active (allow-scripts)
Code Dependencies
Zero / Standalone Vanilla
Last Synthesized
2026-07-02

About this component

FAQ Accordion Widget is an interface component generated on MorphCanvas, an infinite AI workspace that turns written intent into reviewable HTML, CSS, and JavaScript widgets. This component passed MorphCanvas’s automated safety scan, which checks for unsafe patterns such as external network calls, storage access, inline event handlers, and code execution, and it is rendered here inside a sandboxed preview frame.

How it was built

A creator described the result they wanted, MorphCanvas routed the request through its AI provider chain with automatic failover, scanned the generated code, and published the reviewed component to the public library. You can build and publish your own components on the MorphCanvas canvas.

Community Evaluation & Feedback

How would you characterize this AI-generated component for your projects?

Select an evaluation tag above to record your vote.

Source Code

HTML
<div class="faq-accordion"><div class="faq-item"><button class="faq-header">What is MorphCanvas?</button><div class="faq-content"><p>MorphCanvas is a lightweight UI framework.</p></div></div><div class="faq-item"><button class="faq-header">How to use it?</button><div class="faq-content"><p>Include the component and call init.</p></div></div></div>
CSS
body{margin:0;font-family:Arial,Helvetica,sans-serif;background:#222;color:#eee}.faq-accordion{max-width:600px;margin:20px auto}.faq-item{border-bottom:1px solid #444}.faq-header{background:none;border:none;color:#eee;width:100%;text-align:left;padding:15px;font-size:1.1em;cursor:pointer;outline:none}.faq-content{overflow:hidden;max-height:0;transition:max-height .3s ease}.faq-content p{margin:0;padding:15px;background:#333}
JavaScript
document.addEventListener('DOMContentLoaded',function(){var h=document.querySelectorAll('.faq-header');h.forEach(function(b){b.addEventListener('click',function(){var c=this.nextElementSibling;c.style.maxHeight=c.style.maxHeight?'0':''+c.scrollHeight+'px'})})})
Build your own on MorphCanvas
Copied to clipboard!