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

@radix-ui/react-primitive

Package Overview
Dependencies
Maintainers
8
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-primitive

  • 0.1.2-rc.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created

What is @radix-ui/react-primitive?

The @radix-ui/react-primitive package provides foundational components and utilities that are used to build accessible design systems with React. It includes primitives for accessibility, styling, and state management, which can be composed to create more complex UI components.

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

Accessibility Primitives

This feature provides components that help manage accessibility concerns, such as visually hiding content while keeping it accessible to screen readers.

{"import { VisuallyHidden } from '@radix-ui/react-primitive';\n\nfunction MyComponent() {\n  return (\n    <VisuallyHidden>This text is visually hidden but accessible to screen readers</VisuallyHidden>\n  );\n}"}

Styling Primitives

This feature includes utilities for styling components using a CSS-in-JS approach, allowing for theme-based styling and dynamic styles.

{"import { styled } from '@radix-ui/react-primitive';\n\nconst StyledButton = styled('button', {\n  backgroundColor: 'crimson',\n  color: 'white',\n  borderRadius: '9999px',\n});\n\nfunction MyComponent() {\n  return <StyledButton>Click me</StyledButton>;\n}"}

State Management Primitives

This feature provides utilities for managing state within components, such as generating unique IDs for DOM elements.

{"import { createId } from '@radix-ui/react-primitive';\n\nfunction MyComponent() {\n  const id = createId();\n  return <div id={id}>Unique content</div>;\n}"}

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

FAQs

Package last updated on 07 Dec 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

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