
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@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 targeted 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';
The accordion consists of several key parts:
<sp-accordion>
<sp-accordion-item label="Bellows">
<div>
The bellows is the expandable section in the middle of the
accordion.
</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Treble">
<div>
The treble section of the accordion is the right-hand section for
playing melodies.
</div>
</sp-accordion-item>
<sp-accordion-item label="Bass">
<div>
The bass section of the accordion is the left-hand section for
playing accompaniment.
</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion size="s">
<sp-accordion-item label="Key Accordion">
<div>
A key accordion, or a chromatic piano accordion, includes a keyboard
for the right hand.
</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Button Accordion">
<div>
A button accoridon, or a chromatic accordion, has buttons instead of
keys.
</div>
</sp-accordion-item>
<sp-accordion-item label="Diatonic Accordion">
<div>
Produces two different tones or notes depending on whether the
bellows is pulled or pushed.
</div>
</sp-accordion-item>
<sp-accordion-item label="Concertina">
<div>
A concertina has buttons on both sides and each button makes two
different notes or tones depending on whether the bellows is pulled
or pushed.
</div>
</sp-accordion-item>
</sp-accordion>
Medium
<sp-accordion size="m">
<sp-accordion-item label="Key Accordion">
<div>
A key accordion, or a chromatic piano accordion, includes a keyboard
for the right hand.
</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Button Accordion">
<div>
A button accoridon, or a chromatic accordion, has buttons instead of
keys.
</div>
</sp-accordion-item>
<sp-accordion-item label="Diatonic Accordion">
<div>
Produces two different tones or notes depending on whether the
bellows is pulled or pushed.
</div>
</sp-accordion-item>
<sp-accordion-item label="Concertina">
<div>
A concertina has buttons on both sides and each button makes two
different notes or tones depending on whether the bellows is pulled
or pushed.
</div>
</sp-accordion-item>
</sp-accordion>
Large
<sp-accordion size="l">
<sp-accordion-item label="Key Accordion">
<div>
A key accordion, or a chromatic piano accordion, includes a keyboard
for the right hand.
</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Button Accordion">
<div>
A button accoridon, or a chromatic accordion, has buttons instead of
keys.
</div>
</sp-accordion-item>
<sp-accordion-item label="Diatonic Accordion">
<div>
Produces two different tones or notes depending on whether the
bellows is pulled or pushed.
</div>
</sp-accordion-item>
<sp-accordion-item label="Concertina">
<div>
A concertina has buttons on both sides and each button makes two
different notes or tones depending on whether the bellows is pulled
or pushed.
</div>
</sp-accordion-item>
</sp-accordion>
Extra Large
<sp-accordion size="xl">
<sp-accordion-item label="Key Accordion">
<div>
A key accordion, or a chromatic piano accordion, includes a keyboard
for the right hand.
</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Button Accordion">
<div>
A button accoridon, or a chromatic accordion, has buttons instead of
keys.
</div>
</sp-accordion-item>
<sp-accordion-item label="Diatonic Accordion">
<div>
Produces two different tones or notes depending on whether the
bellows is pulled or pushed.
</div>
</sp-accordion-item>
<sp-accordion-item label="Concertina">
<div>
A concertina has buttons on both sides and each button makes two
different notes or tones depending on whether the bellows is pulled
or pushed.
</div>
</sp-accordion-item>
</sp-accordion>
The density
property, when applied, accepts the values of compact
or spacious
.
<div
style="
display: grid;
grid-gap: 20px;
grid-template-columns: 1fr 1fr"
>
<sp-accordion density="compact" size="s">
<sp-accordion-item label="Compact Density">
<div>This accordion is compact.</div>
</sp-accordion-item>
<sp-accordion-item label="Small Size">
<div>This accordion is also small.</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion density="compact" size="m">
<sp-accordion-item label="Compact Density">
<div>This accordion is compact.</div>
</sp-accordion-item>
<sp-accordion-item label="Medium Size">
<div>This accordion is also medium.</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion density="compact" size="l">
<sp-accordion-item label="Compact Density">
<div>This accordion is compact.</div>
</sp-accordion-item>
<sp-accordion-item label="Large Size">
<div>This accordion is also large.</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion density="compact" size="xl">
<sp-accordion-item label="Compact Density">
<div>This accordion is compact.</div>
</sp-accordion-item>
<sp-accordion-item label="Extra Large Size">
<div>This accordion is also extra large.</div>
</sp-accordion-item>
</sp-accordion>
</div>
Spacious
<div
style="
display: grid;
grid-gap: 20px;
grid-template-columns: 1fr 1fr"
>
<sp-accordion density="spacious" size="s">
<sp-accordion-item label="Spacious Density">
<div>This accordion is spacious.</div>
</sp-accordion-item>
<sp-accordion-item label="Small Size">
<div>This accordion is also small.</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion density="spacious" size="m">
<sp-accordion-item label="Spacious Density">
<div>This accordion is spacious.</div>
</sp-accordion-item>
<sp-accordion-item label="Medium Size">
<div>This accordion is also medium.</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion density="spacious" size="l">
<sp-accordion-item label="Spacious Density">
<div>This accordion is spacious.</div>
</sp-accordion-item>
<sp-accordion-item label="Large Size">
<div>This accordion is also large.</div>
</sp-accordion-item>
</sp-accordion>
<sp-accordion density="spacious" size="xl">
<sp-accordion-item label="Spacious Density">
<div>This accordion is spacious.</div>
</sp-accordion-item>
<sp-accordion-item label="Extra Large Size">
<div>This accordion is also extra large.</div>
</sp-accordion-item>
</sp-accordion>
</div>
By default, only one accordion item can be expanded at a time. Use the allow-multiple
attribute to allow multiple items to be expanded simultaneously.
<sp-accordion allow-multiple>
<sp-accordion-item label="Kermit">
<div>Kermit is a frog.</div>
</sp-accordion-item>
<sp-accordion-item label="Fozzie">
<div>Fozzie is a bear.</div>
</sp-accordion-item>
<sp-accordion-item label="Miss Piggy">
<div>Miss Piggy is a pig.</div>
</sp-accordion-item>
</sp-accordion>
Individual accordion items can be disabled using the disabled
attribute. Disabled items cannot be expanded or collapsed.
<sp-accordion>
<sp-accordion-item label="Apples">
<div>
We have some of the most popular varieties include Red Delicious,
Gala, Granny Smith, Honeycrisp, and Fuji.
</div>
</sp-accordion-item>
<sp-accordion-item disabled label="Bananas">
<div>We have the Gros Michel.</div>
</sp-accordion-item>
<sp-accordion-item label="Oranges">
<div>We have Mandarins, Seville Oranges, and Clementines.</div>
</sp-accordion-item>
</sp-accordion>
The accordion component provides proper ARIA attributes and keyboard navigation:
aria-expanded
to indicate its current statearia-controls
pointing to the content regionrole="region"
and aria-labelledby
pointing to the headeraria-disabled="true"
appliedEach accordion item should have a clear, descriptive label that indicates what content will be revealed when expanded.
Accordion content should be related to the header label and provide additional information or functionality that users can access when needed.
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 2,723 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 7 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.