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

@bolttech/atoms-collapse

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bolttech/atoms-collapse

Certainly! Here's the README.md for the provided `Collapse` component:

  • 0.18.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Certainly! Here's the README.md for the provided Collapse component:

Collapse Component

A React component to create collapsible sections with headers and content.

Installation

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

npm install @bolttech/frontend-foundations @bolttech/atoms-collapse

or

yarn add @bolttech/frontend-foundations @bolttech/atoms-collapse

Props

The Collapse component accepts the following properties:

PropTypeDescription
titleTextstringThe text content of the collapse header.
isOpenbooleanDetermines whether the collapse is open or closed.
imgCollapsestring or elementAn image URL or an element to be displayed as the collapse header icon.
statusstringThe status of the collapse (e.g., 'default', 'error', 'success').
onClickfunctionCallback function to handle the collapse header click event.
childrennodeThe content to be displayed within the collapsed section.
dataTestIdstringThe data-testid attribute for testing.
variantstringSize variant a prop that should be the value 'small' or 'large'
iconsIconsIcons referenced with status

Usage

import React, {useState} from 'react';
import {Collapse} from '@bolttech/atoms-collapse';
import {bolttechTheme, BolttechThemeProvider} from "@bolttech/frontend-foundations";

const ExampleComponent = () => {
  const [isCollapseOpen, setIsCollapseOpen] = useState(false);

  const handleCollapseClick = (isOpen) => {
    setIsCollapseOpen(isOpen);
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Collapse
        titleText="Section Title"
        isOpen={isCollapseOpen}
        imgCollapse="https://example.com/collapse-icon.png"
        status="default"
        onClick={handleCollapseClick}
        dataTestId="custom-collapse"
      >
        {/* Content to display within the collapsed section */}
      </Collapse>
    </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 24 Sep 2024

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