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

@radix-ui/react-presence

Package Overview
Dependencies
Maintainers
6
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-presence

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.5M
increased by0.8%
Maintainers
6
Weekly downloads
 
Created

What is @radix-ui/react-presence?

@radix-ui/react-presence is a utility component for managing the presence of elements in the DOM. It helps in handling the mounting and unmounting of components with animations or transitions, making it easier to manage component lifecycles in a React application.

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

Presence

The `Presence` component is used to conditionally render its children based on the `present` prop. This is useful for managing the presence of elements in the DOM, especially when combined with animations or transitions.

```jsx
import { Presence } from '@radix-ui/react-presence';

function Example() {
  const [isVisible, setIsVisible] = React.useState(false);

  return (
    <div>
      <button onClick={() => setIsVisible(!isVisible)}>
        Toggle Presence
      </button>
      <Presence present={isVisible}>
        <div className="content">Hello, I am here!</div>
      </Presence>
    </div>
  );
}
```

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

FAQs

Package last updated on 01 Oct 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