Skip to main content

CRUD UI Components

The UI package in @repo/crud provides a collection of React components for building CRUD interfaces. These components are built on top of the CRUD Engine and provide a seamless integration with React.

Features

  • Ready-to-Use Components: Components for lists, forms, and detail views
  • Customizable: Easily customize the appearance and behavior of components
  • Responsive: Works well on all screen sizes
  • Accessible: Built with accessibility in mind
  • Internationalization: Support for multiple languages
  • Theme Support: Works with your application’s theme
  • TypeScript Support: Full TypeScript support with generics

Installation

This package is part of the zopio monorepo and is available to all applications in the workspace.

Basic Usage

Setting Up the Provider

Before using the UI components, you need to set up the CRUD provider in your application:

Core Components

ResourceList

The ResourceList component displays a list of resources with sorting, filtering, and pagination.

Props

ResourceDetails

The ResourceDetails component displays the details of a resource.

Props

ResourceForm

The ResourceForm component provides a form for creating or updating a resource.

Props

ResourceCreate

The ResourceCreate component provides a page for creating a new resource.

Props

ResourceEdit

The ResourceEdit component provides a page for editing an existing resource.

Props

Supporting Components

Pagination

The Pagination component provides pagination controls.

Props

Filter

The Filter component provides filtering controls.

Props

Sort

The Sort component provides sorting controls.

Props

The Search component provides search functionality.

Props

Layout Components

CrudLayout

The CrudLayout component provides a layout for CRUD pages.

Props

Toolbar

The Toolbar component provides a toolbar for CRUD pages.

Props

Form Components

Form

The Form component provides a base form component.

Props

TextField

The TextField component provides a text input field.

Props

SelectField

The SelectField component provides a select input field.

Props

CheckboxField

The CheckboxField component provides a checkbox input field.

Props

RadioField

The RadioField component provides a radio input field.

Props

TextAreaField

The TextAreaField component provides a textarea input field.

Props

FormButtons

The FormButtons component provides submit and cancel buttons for forms.

Props

API Reference

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