Your components can use the same building blocks as the administration: the model instance, the rows loader and the form. This page shows how to draw rows of a model in your own UI, for example a calendar, and still edit them in the standard admin form. The examples use global components and helpers, so they work both in components loaded from the component directory and in components from your own Vite build.

Building blocks

All three are registered globally, so you use them without an import.

Getting a model

getFreshModel() creates a new instance from the model tree. Pass a parent model as the second argument, and the instance loads only the rows belonging to the parent row.
A model you create yourself is not removed with the component. Destroy it when the component unmounts.
Scopes narrow the loaded rows. setScope() replaces a scope with the same key, and a scope change reloads the rows from the first page.

Drawing rows your own way

ModelRowsBuilder loads the rows, keeps pagination, order, scopes and auto refresh working, and reloads when the parent row changes. Its default slot replaces the table. Put your own markup into the slot and read the loaded rows from the model.
resources/js/components/EventsBuilder.vue
The component above is attached to a tab of a parent admin model with a group component:
app/Models/Termine.php

Editing rows in a modal

The component draws rows, but there is no form on the page. Call model.modals.enable() once, and the form of every row the model opens is shown in a modal. Saving or deleting the row closes the modal.
resources/js/components/EventsCalendar.vue
You can also open the modal directly, without enable():
The full API is described in Modals and toasts.

Saving from your own UI

A change made outside the form, for example dragging an event in the calendar, can be saved without opening the form. Set the row data and save it partially.

Reacting to changes

Listen to model events when something outside the model has to follow its rows.