
Product
Rubygems Ecosystem Support Now Generally Available
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
@zag-js/react
Advanced tools
@zag-js/react is a collection of accessible, headless UI components for React. It provides a set of hooks and utilities to build custom UI components with accessibility and state management in mind.
Accordion
The Accordion feature allows you to create collapsible sections of content. The useAccordion hook provides the necessary props to manage the state and accessibility of the accordion items.
import { useAccordion } from '@zag-js/react';
function AccordionComponent() {
const { getAccordionProps, getItemProps } = useAccordion();
return (
<div {...getAccordionProps()}>
<div {...getItemProps({ index: 0 })}>Item 1</div>
<div {...getItemProps({ index: 1 })}>Item 2</div>
</div>
);
}
Tabs
The Tabs feature provides a way to create tabbed interfaces. The useTabs hook manages the state and accessibility of the tabs and their corresponding panels.
import { useTabs } from '@zag-js/react';
function TabsComponent() {
const { getTabListProps, getTabProps, getTabPanelProps } = useTabs();
return (
<div>
<div {...getTabListProps()}>
<button {...getTabProps({ index: 0 })}>Tab 1</button>
<button {...getTabProps({ index: 1 })}>Tab 2</button>
</div>
<div {...getTabPanelProps({ index: 0 })}>Content 1</div>
<div {...getTabPanelProps({ index: 1 })}>Content 2</div>
</div>
);
}
Dialog
The Dialog feature helps in creating modal dialogs. The useDialog hook provides the necessary props to control the dialog's open/close state and ensure it is accessible.
import { useDialog } from '@zag-js/react';
function DialogComponent() {
const { getDialogProps, getTriggerProps } = useDialog();
return (
<div>
<button {...getTriggerProps()}>Open Dialog</button>
<div {...getDialogProps()}>This is a dialog</div>
</div>
);
}
Headless UI is a set of completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS. It provides similar functionality to @zag-js/react but is more tightly integrated with Tailwind CSS, making it a great choice for projects already using Tailwind.
React Aria is a library of React Hooks that provides accessible UI primitives. It offers similar headless components and focuses on accessibility, much like @zag-js/react, but with a broader range of low-level hooks for building custom components.
FAQs
The react wrapper for zag
We found that @zag-js/react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket's Rubygems ecosystem support is moving from beta to GA, featuring enhanced security scanning to detect supply chain threats beyond traditional CVEs in your Ruby dependencies.
Research
The Socket Research Team investigates a malicious npm package that appears to be an Advcash integration but triggers a reverse shell during payment success, targeting servers handling transactions.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.