Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bolttech/atoms-accordion

Package Overview
Dependencies
Maintainers
8
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bolttech/atoms-accordion

A simple accordion component for displaying collapsible content.

  • 0.16.0
  • npm
  • Socket score

Version published
Weekly downloads
102
decreased by-32.89%
Maintainers
8
Weekly downloads
 
Created
Source

Accordion Component

A simple accordion component for displaying collapsible content.

Installation

Use the package manager npm or yarn to install the component.

npm install @edirect/frontend-foundations @bolttech/atoms-accordion

or

yarn add @edirect/frontend-foundations @bolttech/atoms-accordion

Props

The Accordion component accepts the following properties:

PropTypeDescription
headerTextstringThe text to be displayed as the accordion header.
showContentbooleanControls whether the content is shown or hidden.
contentTextstringThe text to be displayed as the accordion content.
disabledbooleanDisables the accordion interaction when set to true.
iconstringThe name of the icon to be displayed next to the header text.
changeShowContentfunctionCallback function to toggle the showContent state.
idstringAn optional identifier to differentiate between multiple instances of the accordion (for testing, etc.).

Usage

import React, {useState} from 'react';
import {Accordion} from '@bolttech/atoms-accordion';
import {bolttechTheme} from "@edirect/frontend-foundations";

const ExampleComponent = () => {
  const [showContent, setShowContent] = useState(false);

  const handleToggleContent = (value) => {
    setShowContent(value);
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Accordion
        headerText="Accordion Header"
        showContent={showContent}
        contentText="Accordion Content"
        icon="expand_more"
        changeShowContent={handleToggleContent}
        id="unique-accordion-id"
      />
    </BolttechThemeProvider>
  );
};

export default ExampleComponent;

Contributing

Contributions are welcome! For any bug fixes, improvements, or new features, please open an issue or submit a pull request.

Please make sure to follow the code standards and test your changes before submitting.

FAQs

Package last updated on 21 Aug 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc