@mantis-core/ui
v0.1.3
Published
Reusable React UI components for Mantis Core.
Maintainers
Readme
@mantis-core/ui
Reusable React component library for Mantis Core apps.
Purpose
@mantis-core/ui centralizes shared UI primitives so feature teams can build pages without duplicating component logic across projects.
Scope
- Generic UI components for forms, tables, admin layout, maps, and pagination.
- Components intended to be reused by multiple verticals/apps.
- Components designed to work with
@mantis-core/styles(mantis-core-*class contract).
Out Of Scope
- Domain-specific workflows (real estate, restaurant, carpentry, etc).
- Business rules and domain orchestration.
- App-level provider setup (handled by
@mantis-core/next-core).
Installation
pnpm add @mantis-core/ui @mantis-core/stylesMake sure peer dependencies exist in the app (react, react-dom, next, primereact, primeicons).
Styling Requirement
Components rely on style contracts from @mantis-core/styles.
Import the required SCSS modules in your app, for example:
@use "@mantis-core/styles/scss/table.scss";
@use "@mantis-core/styles/scss/paginator.scss";
@use "@mantis-core/styles/scss/inputs.scss";Public API Strategy
Preferred import style:
import { PaginatedTable, TableToolbar, FormFieldRender } from "@mantis-core/ui";Supported subpath imports:
@mantis-core/ui/components/*@mantis-core/ui/table-toolbar@mantis-core/ui/table-filter-field
Use subpaths only when you need explicit boundaries.
Component Catalog
See full catalog in COMPONENTS.md.
Top-level categories:
- Buttons:
Button - Loaders:
Loading - Forms:
CKEditorInput,TextInput,Select,Switch,UploadFilesPreview, etc - Tables:
PaginatedTable,TableToolbar,TableFilterField,ActionColumn, etc - Page/Admin layout:
AdminPageConfigurator,AdminPageLayoutProvider,AdminPageLayoutShell - Generic UI:
Pagination,PaginationInfo,PageSizeSelector,RichTextPreview - Maps:
MapPicker,MapPickerClient,MapPickerOSM
Core Usage Patterns
1) Forms
- Compose fields with
FormFieldRender+ specific input components. - Keep validation/business rules in the app layer.
2) Data Tables
Recommended stack:
TableToolbarTableFilterField/FilterPannelPaginatedTablePaginationhelpers when needed
3) Admin Page Layout
Use the layout contract together:
AdminPageLayoutProviderAdminPageLayoutShellAdminPageConfigurator
4) Maps
MapPickeris dynamic/SSR-safe wrapper.MapPickerClientandMapPickerOSMrun on client.
Architecture Rules For Contributors
- New components must be domain-agnostic.
- Avoid direct business terms in props, labels, or naming.
- Keep runtime boundaries explicit (
"use client"only when required). - Export through
src/index.tsand document inCOMPONENTS.md. - Preserve
mantis-core-*visual contract for shared styles.
Build
pnpm --filter @mantis-core/ui build
pnpm --filter @mantis-core/ui typecheckRelease Checklist
- Component behavior verified in consuming app.
- Props/types documented.
src/index.tsexport updated.COMPONENTS.mdupdated.- Add changeset.
