HTML
<template>
<lightning-accordion>
<lightning-accordion-section name="A" label="Accordion Title A">
<p>This is the content area for section A.</p>
</lightning-accordion-section>
<lightning-accordion-section name="B" label="Accordion Title B">
<p>This is the content area for section B.</p>
</lightning-accordion-section>
</lightning-accordion>
</template>
JavaScript
import { LightningElement } from "lwc";
export default class Accordion extends LightningElement {}
Preview