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

@radix-ui/primitive

Package Overview
Dependencies
Maintainers
6
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/primitive

  • 1.0.1-rc.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.7M
decreased by-16.29%
Maintainers
6
Weekly downloads
 
Created

What is @radix-ui/primitive?

The @radix-ui/primitive package provides foundational utilities for building accessible design systems and component libraries. It includes a set of low-level UI primitives that can be composed to create complex user interfaces with a focus on accessibility and customization.

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

Accessibility

Provides hooks like `useId` to generate unique IDs for accessibility purposes, ensuring elements such as labels and inputs are properly associated.

{"useId": () => { const id = useId(); return <div id={id}>Accessible Element</div>; }}

State Management

Offers utilities like `createContext` for state management within a component tree, allowing for shared state and context without prop drilling.

{"createContext": () => { const [MyContext, useMyContext] = createContext('MyContext'); return <MyContext.Provider value={/* some value */}><MyComponent /></MyContext.Provider>; }}

Styling

Includes a `styled` utility for theming and styling components, enabling a consistent design system across a UI.

{"styled": () => { const StyledComponent = styled('div', { color: 'red' }); return <StyledComponent>This is a styled component</StyledComponent>; }}

Other packages similar to @radix-ui/primitive

FAQs

Package last updated on 19 May 2023

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