@curatordev/mantine
v0.1.5
Published
React admin UI components for Mantine v8 + Refine.js
Maintainers
Readme
@curatordev/mantine
React admin UI components for Mantine v8 and Refine.js.
Installation
pnpm add @curatordev/mantine @mantine/core @mantine/dates @mantine/hooks @mantine/modals @refinedev/core dayjs react-hook-formFeatures
- Layout: Page layouts (Create, Edit, List, Show views with breadcrumbs and actions)
- Fields: Display components (Text, Number, Boolean, Date, Email, URL, Image, File, Markdown, Reference, Tag, Array, Computed)
- Inputs: Form inputs (Text, Number, Boolean, Date, DateTime, Select, MultiSelect, Autocomplete, File, Image, ManyToMany editor)
- Buttons: Action buttons (Create, Edit, Delete, Show, List, Save, Refresh, Export)
- Filters: Query filters (Text, Numeric, Boolean, Select, List, DateRange)
- Actions: Perform operations on multiple selected records with "select all" support
- Forms: Pre-built form layouts (EditForm)
- Overlays: Modal dialogs (Create, Edit overlays)
- Context: Data management (ManyToMany relationships)
- Utilities: General purpose utils (Export, Files)
Quick Start
import { Edit, EditForm, TextFieldInput, BooleanFieldInput } from '@curatordev/mantine';
function UserEdit({ id }: { id: string }) {
return (
<Edit resource="users" id={id}>
{(user, { resource, id }) => (
<EditForm data={user} resource={resource} id={id}>
<TextFieldInput source="first_name" label="First Name" />
<TextFieldInput source="last_name" label="Last Name" />
<BooleanFieldInput source="is_active" label="Active" />
</EditForm>
)}
</Edit>
);
}Component Categories
Layout
Page layout components:
Create- Create page with breadcrumbs and back buttonEdit- Edit page with breadcrumbs and action buttonsList- List page with breadcrumbs and create buttonShow- Show/detail page with breadcrumbs and action buttons
Fields
Read-only display components for showing data:
TextField- Display text valuesNumberField- Display numbers with formattingBooleanField- Display boolean as checkmark/xDateField- Display dates with formattingEmailField- Display email as mailto linkUrlField- Display URL as linkImageField- Display image with lightboxFileField- Display file with download linkMarkdownField- Render markdown contentReferenceField- Display related recordTagField- Display value as tag/badgeArrayField- Display array itemsComputedField- Display computed valueLabeledField- Wrapper for label + field
Inputs
Form input components that work with react-hook-form:
TextFieldInput- Text/textarea inputNumberFieldInput- Number inputBooleanFieldInput- Checkbox/switch inputDateFieldInput- Date pickerDateTimeFieldInput- Date + time pickerSelectFieldInput- Single select dropdownMultiSelectFieldInput- Multi-select dropdownAutocompleteFieldInput- Autocomplete with searchFileFieldInput- File uploadImageFieldInput- Image upload with previewManyToManyTableEditor- Edit many-to-many relationships in a table
Buttons
Action buttons that integrate with Refine.js resource actions:
CreateButton- Navigate to create pageEditButton- Navigate to edit pageShowButton- Navigate to show/detail pageDeleteButton- Delete a record with confirmationListButton- Navigate back to list pageSaveButton- Submit formRefreshButton- Refresh current dataExportButton- Export all filtered records to CSV (or custom format)
Filters
Query filter components for list pages:
TextFilter- Text search filterNumericFilter- Number range filterBooleanFilter- Boolean toggle filterSelectFilter- Single/multi select filterListFilter- Filter by IDsDateRangeFilter- Date range filter with presets
Actions
Perform operations on multiple selected records:
BulkActions- UI component for bulk operations with dropdown and "select all" functionalityuseRecordSelection- Hook to manage record selection state
Forms
Pre-built form layouts:
EditForm- Standard edit/create form layout with save button
Overlays
Modal dialog components:
CreateOverlay- Create form in a modalEditOverlay- Edit form in a modal
Context
Data management:
ManyToManyProvider- Provider for many-to-many relationship datauseManyToMany- Hook to access many-to-many context
Utilities
Utilities for exporting data:
fetchAllRecords- Fetch all records across pages with filtersfetchAllIds- Fetch all record IDs across pagesrecordsToCSV- Convert records to CSV formatdownloadFile- Trigger browser file downloadgenerateExportFilename- Generate timestamped filename
Backend Integration
Curator components are designed to work with REST APIs that implement structured pagination, sorting, and filtering. For Go backends, check out dewey, which provides utilities for building these capabilities into your API endpoints.
License
MIT - see LICENSE for details.
