Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@radix-ui/react-collapsible
Advanced tools
The @radix-ui/react-collapsible package provides components to create collapsible sections in React applications. It is designed to be accessible and customizable, allowing developers to implement collapsible features easily while maintaining good user experience for all users, including those using assistive technologies.
Basic Collapsible Component
This code demonstrates how to create a basic collapsible component using @radix-ui/react-collapsible. It includes a trigger that toggles the visibility of the content.
import * as Collapsible from '@radix-ui/react-collapsible';
function MyComponent() {
const [open, setOpen] = React.useState(false);
return (
<Collapsible.Root open={open} onOpenChange={setOpen}>
<Collapsible.Trigger>Toggle</Collapsible.Trigger>
<Collapsible.Content>
Content inside the collapsible section.
</Collapsible.Content>
</Collapsible.Root>
);
}
react-collapsible is another popular package for creating collapsible components in React. It offers similar functionality but differs in implementation details and API design. react-collapsible might be simpler to use for basic use cases, while @radix-ui/react-collapsible provides more control and customization options.
react-collapse provides components to create collapsible elements using CSS transitions for animations. It focuses more on the animation aspects and might be preferred if smooth animations are a priority. However, @radix-ui/react-collapsible offers better accessibility features out of the box.
react-collapsible
$ yarn add @radix-ui/react-collapsible
# or
$ npm install @radix-ui/react-collapsible
View docs here.
FAQs
Unknown package
The npm package @radix-ui/react-collapsible receives a total of 2,035,061 weekly downloads. As such, @radix-ui/react-collapsible popularity was classified as popular.
We found that @radix-ui/react-collapsible demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.