Mantine
Install:
BASH
npm install @vibeflui/mantine @mantine/coreMantineField maps a wide range of field.type values to real Mantine controls — this example spans several of them to show the range, not just select. The app must wrap the page in a MantineProvider and import @mantine/core/styles.css once.
File structure
TXT
schemas/
users/
mantine-user-form.schema.ts
lib/
vibeflui/
registry.tsx
app/
users/
new/
page.tsxSchema file
schemas/users/mantine-user-form.schema.ts
TS
export const mantineUserFormSchema = {
resource: "users",
identity: { key: "id", param: "id" },
table: { enabled: false },
form: {
mode: "page",
fields: [
{ name: "name", label: "Name", type: "text", adapter: "mantine", required: true },
{ name: "email", label: "Email", type: "email", adapter: "mantine", required: true },
{ name: "bio", label: "Bio", type: "textarea", adapter: "mantine" },
{
name: "role",
label: "Role",
type: "select",
adapter: "mantine",
required: true,
options: [
{ label: "Admin", value: "admin" },
{ label: "Editor", value: "editor" },
{ label: "Viewer", value: "viewer" }
]
},
{
name: "plan",
label: "Plan",
type: "radio-group",
adapter: "mantine",
options: [
{ label: "Free", value: "free" },
{ label: "Pro", value: "pro" }
]
},
{ name: "notifyByEmail", label: "Notify by email", type: "switch", adapter: "mantine" }
]
},
actions: {
create: { enabled: true, label: "Save user", handler: "users.create" }
},
registry: {
fieldAdapters: ["mantine"],
actionHandlers: ["users.create"]
},
feedback: {
mode: "inline"
}
} as const;Registry file
lib/vibeflui/registry.tsx
TSX
import { createRegistry } from "@vibeflui/core";
export const vibefluiRegistry = createRegistry({
actionHandlers: {
"users.create": async ({ values }) => ({
status: true,
code: 200,
message: `${String(values?.name ?? "User")} saved with the Mantine field adapter`,
data: values
})
}
});Page file
app/users/new/page.tsx
TSX
"use client";
import { useState } from "react";
import { MantineProvider } from "@mantine/core";
import "@mantine/core/styles.css";
import {
FluiKitFeedback,
FluiKitForm,
FluiKitProvider,
executeOperation,
normalizeSchema,
type FluiKitFeedbackMessage
} from "@vibeflui/core";
import { mantinePlugin } from "@vibeflui/mantine";
import { mantineUserFormSchema } from "@/schemas/users/mantine-user-form.schema";
import { vibefluiRegistry } from "@/lib/vibeflui/registry";
const schema = normalizeSchema(mantineUserFormSchema);
export default function NewUserPage() {
const [feedback, setFeedback] = useState<FluiKitFeedbackMessage | null>(null);
const handleCreateUser = async (values: Record<string, unknown>) => {
const result = await executeOperation({
schema,
operation: "create",
values,
registry: vibefluiRegistry
});
setFeedback({
status: "success",
title: "Saved",
message: String((result.data as { message?: unknown } | undefined)?.message ?? "User saved")
});
};
return (
<MantineProvider>
<FluiKitProvider plugins={[mantinePlugin]} registry={vibefluiRegistry}>
<FluiKitFeedback schema={schema} mode="inline" feedback={feedback} onClose={() => setFeedback(null)} />
<FluiKitForm schema={schema} mode="create" onSubmit={handleCreateUser} />
</FluiKitProvider>
</MantineProvider>
);
}plugins={[mantinePlugin]} registers the mantine field adapter on the same FluiKitProvider this page renders.
Supported field behavior
The adapter handles text-like fields, textarea/json/code/markdown text areas, password, number/range, select, multiselect/tags, switch, checkbox, radio/radio-group, checkbox-group, and email — see Mantine for the full reference.
Exports include createMantinePlugin, mantinePlugin, and MantineField.