![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@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
The npm package @zag-js/react receives a total of 44,466 weekly downloads. As such, @zag-js/react popularity was classified as popular.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.