New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@paprika/collapsible

Package Overview
Dependencies
Maintainers
4
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/collapsible

Collapsible component, allows the user to expand and collapse some enclosed content.

  • 4.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-18.6%
Maintainers
4
Weekly downloads
 
Created
Source

@paprika/collapsible

Description

Collapsible component, allows the user to expand and collapse some enclosed content.

Installation

yarn add @paprika/collapsible

or with npm:

npm install @paprika/collapsible

Props

Collapsible

PropTyperequireddefaultDescription
a11yTextstringfalsenullDescriptive a11y text for assistive technologies. By default, text from children node will be used.
childrennodefalsenullBody content of the collapsible.
iconAlign[ "left", "right"]false"left"Set's icon alignment left or right.
iconCollapsenodefalseSets RightArrowIcon if true.
iconExpandnodefalseSets DownArrowIcon if true.
isCollapsedboolfalsetrueState of the collapsible.
isDisabledboolfalsefalseIf the collapsible is disabled.
hasOnlyIconToggleboolfalsefalse
labelnodetrue-Sets the label that will display in the collapsible
onClickfuncfalse() => {}Callback to be executed when the button is clicked or activated by keyboard.
triggerAriaDescribedbystringfalsenullaria-describedby on the trigger element.

Usage

import Collapsible from "@paprika/collapsible";

const [isCollapsed, setIsCollapsed] = React.useState(false);

const yourComponent = () => {
  return (
    <Collapsible
      a11yText="collapsible section"
      isCollapsed={isCollapsed}
      isDisabled={false}
      label="Click me to show/hide the content"
      iconAlign="left"
      onClick={() => setIsCollapsed(!isCollapsed)}
    >
      <p>
        <strong>Content</strong> – children of the &lt;Collapsible&gt; is hidden while the collapsible is collapsed, and
        visible with it is expanded.
      </p>
    </Collapsible>
  );
};

export default yourComponent;
  • Storybook Showcase
  • GitHub source code
  • Create GitHub issue
  • CHANGELOG

FAQs

Package last updated on 06 Jan 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