Socket
Socket
Sign inDemoInstall

@radix-ui/primitive

Package Overview
Dependencies
2
Maintainers
6
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @radix-ui/primitive


Version published
Weekly downloads
4.7M
decreased by-19.39%
Maintainers
6
Created
Weekly downloads
 

Package description

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

Readme

Source

primitive

Installation

$ yarn add @radix-ui/primitive
# or
$ npm install @radix-ui/primitive

Usage

This is an internal utility, not intended for public usage.

FAQs

Last updated on 19 May 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc