Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@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 1,585,604 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.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.