Skip to main content

Data UI Components

The UI package provides React components and hooks for working with data in the zopio framework. It offers a seamless integration between your data providers and React components.

Features

  • React Hooks: Hooks for data fetching and manipulation
  • UI Components: Ready-to-use components for displaying data
  • Form Integration: Tools for building data-driven forms
  • Optimistic Updates: Support for optimistic UI updates
  • Loading States: Handling loading and error states

React Hooks

Data Provider Hook

The useDataProvider hook gives you access to the data provider in your components:

CRUD Operation Hooks

The UI package provides hooks for each CRUD operation:

useGetList

useGetOne

useCreate

useUpdate

useDelete

Mutation Hooks

The UI package provides hooks for mutations with optimistic updates:

UI Components

DataProvider Component

The DataProvider component provides the data context to your application:

DataList Component

The DataList component displays a list of resources:

DataDetails Component

The DataDetails component displays the details of a resource:

DataForm Component

The DataForm component provides a form for creating or updating a resource:

DataPagination Component

The DataPagination component provides pagination controls:

DataFilter Component

The DataFilter component provides filtering controls:

Form Integration

useDataForm Hook

The useDataForm hook provides form functionality for data operations:

Field Components

The UI package provides field components for building forms:

Advanced Usage

Optimistic Updates

The UI package supports optimistic updates for a better user experience:

Custom Hooks

You can create custom hooks that build on the provided hooks:

API Reference

For a complete API reference, please refer to the TypeScript definitions in the package.