Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@spectrum-web-components/accordion
Advanced tools
The `<sp-accordion>` element contains a list of items that can be expanded or collapsed to reveal additional content or information associated with each item. There can be zero expanded items, exactly one expanded item, or more than one item expanded at a
The <sp-accordion>
element contains a list of items that can be expanded or collapsed to reveal additional content or information associated with each item. There can be zero expanded items, exactly one expanded item, or more than one item expanded at a time, depending on the configuration. This list of items is defined by child <sp-accordion-item>
elements that are targetted to the default slot of their <sp-accordion>
parent.
yarn add @spectrum-web-components/accordion
Import the side effectful registration of <sp-accordion>
and <sp-accordion-item>
via:
import '@spectrum-web-components/accordion/sp-accordion.js';
import '@spectrum-web-components/accordion/sp-accordion-item.js';
When looking to leverage the Accordion
and AccordionItem
base class as a type and/or for extension purposes, do so via:
import { Accordion, AccordionItem } from '@spectrum-web-components/accordion';
<sp-accordion>
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 5">
<div>Item 5</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 6">
<div>Item 6</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion allow-multiple>
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 5">
<div>Item 5</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 6">
<div>Item 6</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion size="s">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Medium
<sp-accordion size="m">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Large
<sp-accordion size="l">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Extra Large
<sp-accordion size="xl">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
The density
property, when applied, accepts the values of compact
or spacious
.
<sp-accordion density="compact" size="s">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Medium
<sp-accordion density="compact" size="m">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Large
<sp-accordion density="compact" size="l">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Extra Large
<sp-accordion density="compact" size="xl">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion density="spacious" size="s">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Medium
<sp-accordion density="spacious" size="m">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Large
<sp-accordion density="spacious" size="l">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
Extra Large
<sp-accordion density="spacious" size="xl">
<sp-accordion-item label="Heading 1">
<div>Item 1</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Heading 2">
<div>Item 2</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 3">
<div>Item 3</div>
</sp-accordion-item>
<sp-accordion-item label="Heading 4">
<div>Item 4</div>
</sp-accordion-item>
</sp-accordion>
1.0.1 (2024-11-11)
FAQs
The `<sp-accordion>` element contains a list of items that can be expanded or collapsed to reveal additional content or information associated with each item. There can be zero expanded items, exactly one expanded item, or more than one item expanded at a
The npm package @spectrum-web-components/accordion receives a total of 1,619 weekly downloads. As such, @spectrum-web-components/accordion popularity was classified as popular.
We found that @spectrum-web-components/accordion demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.