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

@radix-ui/react-collapsible

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-collapsible


Version published
Weekly downloads
2.2M
increased by76.91%
Maintainers
8
Weekly downloads
 
Created

What is @radix-ui/react-collapsible?

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.

What are @radix-ui/react-collapsible's main functionalities?

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>
  );
}

Other packages similar to @radix-ui/react-collapsible

FAQs

Package last updated on 06 Oct 2021

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