[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/admin](../../README) / [index](../README) / ResourceListPage

# Class: ResourceListPage

Defined in: [admin/src/pages/ResourceListPage.tsx:108](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L108)

Base class for Flow pages — reactive server-side components rendered over a WebSocket.

## Remarks

A Flow component's state lives on the **server**. You subclass `Component`, hold state in
fields, and implement [render](../../../flow/index/classes/Component#render) to return an [HtmlNode](../../../flow/index/type-aliases/HtmlNode) (authored in `.tsx` with
`jsxImportSource: "@zerotal/flow"`). The root element must carry `data-flow-root`.

Only fields and methods the component opts into are reachable from the browser:
- `@expose` marks a field as reactive (streamed to the client, writable via `flow:model` /
  `$flow.$set`) or a method as a callable **action** (invoked over the socket, e.g. `flow:click`).
- `@locked` sends a field to the client read-only — it round-trips in the snapshot but the
  client cannot mutate it (enforced in $set).

Between requests, the component is serialised into an **HMAC-signed snapshot** and rehydrated
on the next round-trip, so tampering with client-held state is rejected. When an action runs,
the server re-renders and streams a DOM diff that the browser applies via Alpine's morph —
only the changed HTML crosses the wire.

Lifecycle hooks fire in order around each request: [onBoot](../../../flow/index/classes/Component#onboot) → ([onMount](../../../flow/index/classes/Component#onmount) on the
initial GET / [onHydrate](../../../flow/index/classes/Component#onhydrate) on round-trips) → property updates → the action →
[onUpdate](../../../flow/index/classes/Component#onupdate) → [onRendering](../../../flow/index/classes/Component#onrendering) → [render](../../../flow/index/classes/Component#render) → [onRendered](../../../flow/index/classes/Component#onrendered) →
[onDehydrate](../../../flow/index/classes/Component#ondehydrate). Actions may emit side effects — flashes, redirects, events, downloads,
client scripts — which are drained after the action and folded into the response frame.

## Examples

A counter with an exposed field and an action, bound reactively:
```tsx
import { Component, expose } from "@zerotal/flow";

export class Counter extends Component {
  @expose count = 0;

  @expose increment() {
    this.count++;
  }

  override async render() {
    return (
      <div data-flow-root>
        <p>{this.count}</p>
        <button flow:click="increment">+</button>
      </div>
    );
  }
}
```

A form-style component with validation, a flash, and a redirect from an action:
```tsx
import { Component, expose, locked } from "@zerotal/flow";

export class ProfilePage extends Component {
  @locked userId = 0;
  @expose name = "";

  @expose async save() {
    await this.validate({ name: (rule) => rule.required().min(2) });
    await User.update(this.userId, { name: this.name });
    return this.redirect("/dashboard").withSuccess("Profile saved.");
  }

  override async render() {
    return (
      <div data-flow-root>
        <input {...this.bind("name")} />
        {this.errors.has("name") && <span>{this.errors.name}</span>}
        <button flow:click="save">Save</button>
      </div>
    );
  }
}
```

## Extends

- [`Component`](../../../flow/index/classes/Component)

## Constructors

### Constructor

> **new ResourceListPage**(): `ResourceListPage`

#### Returns

`ResourceListPage`

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`constructor`](../../../flow/index/classes/Component#constructor)

## Actions

### signal

#### Get Signature

> **get** **signal**(): `AbortSignal`

Defined in: [flow/src/Component.ts:447](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L447)

The AbortSignal for the running `@task`. Pass it to `fetch`/an SDK, or check
`this.signal.aborted` in a loop, for cooperative cancellation. Outside a task it is an
already-inert signal that never aborts, so `@task` code reads the same regardless.

##### Returns

`AbortSignal`

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`signal`](../../../flow/index/classes/Component#signal)

***

### cancelled

#### Get Signature

> **get** **cancelled**(): `boolean`

Defined in: [flow/src/Component.ts:455](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L455)

True when the running `@task` has been cancelled from the client.

##### Returns

`boolean`

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`cancelled`](../../../flow/index/classes/Component#cancelled)

***

### flash()

> **flash**(`message`, `optionsOrLevel?`): [`FlashBuilder`](../../../flow/index/interfaces/FlashBuilder)

Defined in: [flow/src/Component.ts:710](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L710)

Emit a flash notification to the client.

Returns a [FlashBuilder](../../../flow/index/interfaces/FlashBuilder) so the toast can be configured fluently. The
second argument may also be a level string (back-compat) or a
[FlashOptions](../../../flow/index/interfaces/FlashOptions) object (for dynamic config):

#### Parameters

##### message

`string`

the toast text.

##### optionsOrLevel?

`"error"` \| `"success"` \| `"warning"` \| `"info"` \| [`FlashOptions`](../../../flow/index/interfaces/FlashOptions)

a [FlashLevel](../../../flow/index/type-aliases/FlashLevel) shorthand or a [FlashOptions](../../../flow/index/interfaces/FlashOptions) object.

#### Returns

[`FlashBuilder`](../../../flow/index/interfaces/FlashBuilder)

a [FlashBuilder](../../../flow/index/interfaces/FlashBuilder) for fluent configuration.

#### Example

```ts
this.flash("Saved");                              // success toast
this.flash("Bad input", "error");                 // level shorthand
this.flash("Saved", { type: "success", duration }); // options object
this.flash("Post deleted").warning().duration(8000).progressBar();
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`flash`](../../../flow/index/classes/Component#flash)

***

### refresh()

> **refresh**(): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:859](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L859)

Force `onMount()` to run again on the CURRENT WebSocket round trip.
Use this to reload external data without requiring a full page reload.

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`refresh`](../../../flow/index/classes/Component#refresh)

***

### client()

> **client**(`script`): `void`

Defined in: [flow/src/Component.ts:879](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L879)

Queue a raw JavaScript expression to be evaluated in the browser
after the current action's DOM patch is applied.

The expression runs in the Alpine context of the component root element:
`$el`, `$refs`, and other Alpine magic properties are all available.

Multiple calls are batched and executed in order after the single round trip.

#### Parameters

##### script

`string`

#### Returns

`void`

#### Example

```ts
this.client(`$refs.titleInput.focus()`);
this.client(`$el.querySelector('.toast').classList.add('visible')`);
```

#### Security

Never interpolate unescaped user input into the expression string.

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`client`](../../../flow/index/classes/Component#client)

***

### title()

#### Call Signature

> **title**(): `string`

Defined in: [flow/src/Component.ts:887](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L887)

Gets the current title value.

##### Returns

`string`

##### Inherited from

[`Component`](../../../flow/index/classes/Component).[`title`](../../../flow/index/classes/Component#title)

#### Call Signature

> **title**(`value`): `void`

Defined in: [flow/src/Component.ts:897](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L897)

Update `document.title` in the browser after this action completes.

##### Parameters

###### value

`string`

##### Returns

`void`

##### Example

```ts
this.title(`Search: ${this.query}`);
```

##### Inherited from

[`Component`](../../../flow/index/classes/Component).[`title`](../../../flow/index/classes/Component#title)

***

### download()

> **download**(`filename`, `content`, `mime?`): `void`

Defined in: [flow/src/Component.ts:1170](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1170)

Trigger a browser file download.

`content` is either text (CSV, JSON, an SVG) or the raw bytes of a binary
file. Text is encoded as UTF-8; bytes are sent exactly as given, which is
what a format like a spreadsheet or a PDF requires — passing those through
a string would re-encode every byte above 127 and corrupt the file.

#### Parameters

##### filename

`string`

the download's suggested file name.

##### content

`string` \| `Uint8Array`\<`ArrayBufferLike`\>

text, or the file's raw bytes (base64-encoded to travel).

##### mime?

`string` = `"application/octet-stream"`

the MIME type. Defaults to `application/octet-stream`.

#### Returns

`void`

#### Example

```ts
async export() {
  const csv = this.buildCsv(this.items);
  this.download('export.csv', csv, 'text/csv;charset=utf-8');
}
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`download`](../../../flow/index/classes/Component#download)

***

### stream()

> **stream**(`ref`, `content`, `opts?`): `void`

Defined in: [flow/src/Component.ts:1396](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1396)

Push content to the client MID-ACTION — before the final patch — into any
element marked `flow:stream="ref"`. Appends by default; pass
`{ replace: true }` to overwrite instead.

Works only during WebSocket actions (no-op during SSR).

#### Parameters

##### ref

`string`

the `flow:stream="ref"` target element.

##### content

`string`

raw HTML appended (or replacing) inside the target.

##### opts?

pass `{ replace: true }` to overwrite instead of append.

###### replace?

`boolean`

#### Returns

`void`

#### Security

`content` is injected as raw innerHTML on the client. Never pass
unescaped user input directly — sanitize or escape it first, or use a
trusted HTML sanitizer (e.g. DOMPurify) client-side.

#### Example

```ts

```

#### Expose

async generate() {
  for await (const token of llm.stream(this.prompt)) {
    this.stream('answer', token);
  }
}

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`stream`](../../../flow/index/classes/Component#stream)

## Errors

### onError()

> **onError**(`error`): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:591](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L591)

Called when an action throws an unhandled error. Flow catches the error and
still re-renders; override to customise (log, swallow, re-flash). The default
flashes the message. (Livewire `exception()`.)

#### Parameters

##### error

`Error`

the error thrown by the action.

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onError`](../../../flow/index/classes/Component#onerror)

## Events

### dispatch()

> **dispatch**\<`K`\>(`name`, ...`args`): `void`

Defined in: [flow/src/Component.ts:1057](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1057)

Dispatch a named event to all other Flow components on the page.
Components with a matching `@on('event-name')` decorator will have
their listener method called automatically.

#### Type Parameters

##### K

`K` *extends* `string`

#### Parameters

##### name

`K`

##### args

...`K` *extends* `never` ? `EventArgs`\<[`FlowEvents`](../../../flow/index/interfaces/FlowEvents)\[`K`\]\> : \[`Record`\<`string`, `unknown`\>\]

#### Returns

`void`

#### Example

```ts
async save() {
  const post = await Post.create(this.form);
  this.dispatch('post-created', { id: post.id });
}
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`dispatch`](../../../flow/index/classes/Component#dispatch)

***

### dispatchTo()

> **dispatchTo**\<`K`\>(`component`, `name`, ...`args`): `void`

Defined in: [flow/src/Component.ts:1075](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1075)

Dispatch an event ONLY to components of a given class name (skips all others
listening for the same event). Mirrors Livewire's `dispatch()->to(...)`.

#### Type Parameters

##### K

`K` *extends* `string`

#### Parameters

##### component

`string`

##### name

`K`

##### args

...`K` *extends* `never` ? `EventArgs`\<[`FlowEvents`](../../../flow/index/interfaces/FlowEvents)\[`K`\]\> : \[`Record`\<`string`, `unknown`\>\]

#### Returns

`void`

#### Example

```ts
this.dispatchTo('Dashboard', 'post-created', { id: post.id });
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`dispatchTo`](../../../flow/index/classes/Component#dispatchto)

***

### dispatchSelf()

> **dispatchSelf**\<`K`\>(`name`, ...`args`): `void`

Defined in: [flow/src/Component.ts:1094](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1094)

Dispatch an event only to THIS component (it won't bubble to others).
Mirrors Livewire's `dispatch()->self()`.

#### Type Parameters

##### K

`K` *extends* `string`

#### Parameters

##### name

`K`

##### args

...`K` *extends* `never` ? `EventArgs`\<[`FlowEvents`](../../../flow/index/interfaces/FlowEvents)\[`K`\]\> : \[`Record`\<`string`, `unknown`\>\]

#### Returns

`void`

#### Example

```ts
this.dispatchSelf('refresh');
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`dispatchSelf`](../../../flow/index/classes/Component#dispatchself)

## Lifecycle

### onMount()

> **onMount**(`ctx?`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:159](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L159)

Called ONCE on the initial HTTP GET request.
Never called on subsequent WebSocket round trips (call `this.refresh()` to force it).

Receives the route [HttpContext](../../../core/index/classes/HttpContext) — the same argument controllers get — so
dynamic-segment pages can read implicitly-bound models off `ctx.params`:

    override async onMount(ctx: HttpContext) {
      this.accountId = (ctx.params.account as Account).id;
    }

Bound models persist across WebSocket round-trips via Flow synths (store the model on a
`@locked`/`@expose` field), so they need not be re-resolved on every action.

#### Parameters

##### ctx?

[`HttpContext`](../../../core/index/classes/HttpContext)\<`Record`\<`string`, `string`\>\>

the route [HttpContext](../../../core/index/classes/HttpContext) (initial GET only).

#### Returns

`Promise`\<`void`\>

#### Overrides

[`Component`](../../../flow/index/classes/Component).[`onMount`](../../../flow/index/classes/Component#onmount)

***

### onUpdate()

> **onUpdate**(): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:510](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L510)

Called once after the invoked action method completes, just before re-rendering.
Distinct from `onUpdated()`, which fires per client-driven property change.

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onUpdate`](../../../flow/index/classes/Component#onupdate)

***

### onBoot()

> **onBoot**(`_ctx?`): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:523](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L523)

Called at the BEGINNING of every request for this component — both the initial
HTTP render and every subsequent WebSocket round-trip — after state is restored
(round-trips) or `@url`/`@session` seeded (initial), but before `onMount()` /
`onHydrate()`, property updates, and the action. Use for setup that must run on
every request. (Livewire `boot()`.) Receives the route [HttpContext](../../../core/index/classes/HttpContext) — note that on
WebSocket round-trips the URL is the stored route pattern, so raw `ctx.params` are
only populated on the initial GET; prefer `onMount()` for reading bound models.

#### Parameters

##### \_ctx?

[`HttpContext`](../../../core/index/classes/HttpContext)\<`Record`\<`string`, `string`\>\>

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onBoot`](../../../flow/index/classes/Component#onboot)

***

### onHydrate()

> **onHydrate**(): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:533](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L533)

Called at the beginning of every SUBSEQUENT (WebSocket) request, right after the
component is rebuilt from its snapshot — never on the initial render (use
`onMount()` for that). Ideal for re-deriving non-persisted/protected state from
restored properties. (Livewire `hydrate()`.)

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onHydrate`](../../../flow/index/classes/Component#onhydrate)

***

### onDehydrate()

> **onDehydrate**(): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:542](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L542)

Called at the END of every request, just before the component is serialised into
its snapshot. Use to normalise state back into a serialisable shape.
(Livewire `dehydrate()`.)

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onDehydrate`](../../../flow/index/classes/Component#ondehydrate)

***

### onUpdating()

> **onUpdating**(`_prop`, `_value`, `_key?`): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:556](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L556)

Called BEFORE a client-driven property update is applied (a `value`/`checked`
input or `$flow.$set`). Throw to reject the update. Only fires for writable
(`@expose`) properties. For a single property, define `onUpdating<Prop>(value, key?)`
— e.g. `onUpdatingEmail()`. (Livewire `updating()`.)

#### Parameters

##### \_prop

`string`

##### \_value

`unknown`

##### \_key?

`string`

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onUpdating`](../../../flow/index/classes/Component#onupdating)

***

### onUpdated()

> **onUpdated**(`_prop`, `_value`, `_key?`): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:566](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L566)

Called AFTER a client-driven property update is applied. For a single property,
define `onUpdated<Prop>(value, key?)` — e.g. `onUpdatedUsername()` to normalise a
value such as lower-casing. (Livewire `updated()`.)

#### Parameters

##### \_prop

`string`

##### \_value

`unknown`

##### \_key?

`string`

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onUpdated`](../../../flow/index/classes/Component#onupdated)

***

### onRendering()

> **onRendering**(): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:573](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L573)

Called BEFORE `render()` runs. (Livewire `rendering()`.)

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onRendering`](../../../flow/index/classes/Component#onrendering)

***

### onRendered()

> **onRendered**(`_html`): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:581](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L581)

Called AFTER `render()` produces this component's HTML. (Livewire `rendered()`.)

#### Parameters

##### \_html

`string`

#### Returns

`Promise`\<`void`\>

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`onRendered`](../../../flow/index/classes/Component#onrendered)

## Navigation & redirects

### redirect()

> **redirect**(`url`, `status?`): [`RedirectFlash`](../../../flow/index/interfaces/RedirectFlash)

Defined in: [flow/src/Component.ts:781](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L781)

Redirect the client to `url` after the current action completes.

Returns a builder so a flash can be chained (mirrors the HTTP ResponseBuilder):

#### Parameters

##### url

`string`

Destination URL.

##### status?

`number`

Optional HTTP-style status (advisory — the client navigates regardless).

#### Returns

[`RedirectFlash`](../../../flow/index/interfaces/RedirectFlash)

a [RedirectFlash](../../../flow/index/interfaces/RedirectFlash) builder for chaining a flash onto the redirect.

#### Example

```ts
this.redirect("/dashboard");
return this.redirect(next || "/", 303).withSuccess("Welcome back.");
return this.redirect("/login").withError("Please sign in.");
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`redirect`](../../../flow/index/classes/Component#redirect)

***

### redirectRoute()

> **redirectRoute**(`name`, `params?`, `status?`): [`RedirectFlash`](../../../flow/index/interfaces/RedirectFlash)

Defined in: [flow/src/Component.ts:820](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L820)

Redirect to a named route, mirroring Livewire's `redirectRoute('profile', ['id' => 1])`.
Route params fill `:segment` placeholders; any extra keys become query-string params.

#### Parameters

##### name

`string`

The route name registered with `.name(...)`.

##### params?

`Record`\<`string`, `string` \| `number`\> = `{}`

Route + query params.

##### status?

`number`

Optional HTTP-style status (advisory — the client navigates regardless).

#### Returns

[`RedirectFlash`](../../../flow/index/interfaces/RedirectFlash)

a [RedirectFlash](../../../flow/index/interfaces/RedirectFlash) builder for chaining a flash onto the redirect.

#### Example

```ts
return this.redirectRoute("profile", { id: 1 }).withSuccess("Saved.");
this.redirectRoute("posts.show", { slug: "hello", ref: "email" }); // /posts/hello?ref=email
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`redirectRoute`](../../../flow/index/classes/Component#redirectroute)

***

### redirectIntended()

> **redirectIntended**(`fallback?`, `status?`): [`RedirectFlash`](../../../flow/index/interfaces/RedirectFlash)

Defined in: [flow/src/Component.ts:842](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L842)

Redirect the user back to where they were headed before being intercepted — Livewire's
`redirectIntended('/default/url')`. Reads (and clears) the `intended_url` stored in the
session by `AuthMiddleware`, falling back to `fallback` when none is stored or the stored
URL is cross-origin (open-redirect guard).

#### Parameters

##### fallback?

`string` = `"/"`

URL to use when no intended URL is available. Defaults to `/`.

##### status?

`number`

Optional HTTP-style status (advisory — the client navigates regardless).

#### Returns

[`RedirectFlash`](../../../flow/index/interfaces/RedirectFlash)

a [RedirectFlash](../../../flow/index/interfaces/RedirectFlash) builder for chaining a flash onto the redirect.

#### Example

```ts
if (await Auth.attempt(creds)) return this.redirectIntended("/dashboard");
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`redirectIntended`](../../../flow/index/classes/Component#redirectintended)

***

### currentUrl()

> **currentUrl**(`_options?`): `string`

Defined in: [flow/src/Component.ts:1133](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1133)

Build a URL from the current one with merged query params — client-only. Use it in a
JSX expression: `href={this.currentUrl({ query: this.q })}`, `class={this.currentUrl() === "/" ? "on" : ""}`,
or `{this.currentUrl(...)}`. The compiler rewrites `this.currentUrl` → `$flow.currentUrl`
so it runs on the client. It never runs on the server — hitting this throw means the call
reached server code (e.g. a page the compiler couldn't statically compile, or a server action).

#### Parameters

##### \_options?

`CurrentUrlOptions`

#### Returns

`string`

#### Throws

when executed on the server (it is meant to be compiled to `$flow.currentUrl`).

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`currentUrl`](../../../flow/index/classes/Component#currenturl)

***

### navigateCurrent()

> **navigateCurrent**(`_options?`): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:1145](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1145)

Build the URL as [currentUrl](../../../flow/index/classes/Component#currenturl) does, then SPA-navigate to it — client-only. Use it in a
client handler: `onClick={() => this.navigateCurrent({ query: { page: 2 } })}`. The compiler
rewrites it to `$flow.navigateCurrent`. To navigate from server code, return a `redirect()`.

#### Parameters

##### \_options?

`CurrentUrlOptions`

#### Returns

`Promise`\<`void`\>

#### Throws

when executed on the server (it is meant to be compiled to `$flow.navigateCurrent`).

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`navigateCurrent`](../../../flow/index/classes/Component#navigatecurrent)

## Other

### layout

> `static` **layout**: *typeof* [`AdminLayout`](AdminLayout) = `AdminLayout`

Defined in: [admin/src/pages/ResourceListPage.tsx:109](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L109)

***

### resource

> `static` **resource**: *typeof* [`Resource`](Resource)

Defined in: [admin/src/pages/ResourceListPage.tsx:111](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L111)

Set by each generated subclass.

***

### panel

> `static` **panel**: [`PanelInstance`](PanelInstance)

Defined in: [admin/src/pages/ResourceListPage.tsx:113](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L113)

The panel this page belongs to — set by each generated subclass.

***

### search

> **search**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:115](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L115)

***

### sortBy

> **sortBy**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:116](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L116)

***

### sortDir

> **sortDir**: `"asc"` \| `"desc"` = `"asc"`

Defined in: [admin/src/pages/ResourceListPage.tsx:117](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L117)

***

### sort

> **sort**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:123](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L123)

Additional sorts, as `col:dir,col:dir`. The header click drives `sortBy`;
this carries the tie-breakers beneath it, so "by status, then newest first"
is a link rather than a saved query somewhere.

***

### page

> **page**: `string` = `"1"`

Defined in: [admin/src/pages/ResourceListPage.tsx:124](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L124)

***

### tab

> **tab**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:125](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L125)

***

### filters

> **filters**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:127](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L127)

Active filters, JSON-encoded `{ filterKey: value }`.

***

### trashed

> **trashed**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:129](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L129)

Soft-delete scope: "" (active), "with" (incl. trashed), "only" (trashed).

***

### perPage

> **perPage**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:131](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L131)

Page size override (empty = the resource default).

***

### cols

> **cols**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:133](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L133)

Hidden column keys, comma-joined (column-visibility manager).

***

### group

> **group**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:135](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L135)

Active row grouping column ("" = none).

***

### locale

> **locale**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:137](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L137)

Active locale, for a translatable resource.

***

### parentId

> **parentId**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:143](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L143)

The parent record's id, for a resource nested under another. Locked rather
than URL-derived so WebSocket actions stay scoped to the same parent.

***

### selected

> **selected**: `string`[] = `[]`

Defined in: [admin/src/pages/ResourceListPage.tsx:146](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L146)

Selected row ids for bulk actions (reactive — survives round-trips).

***

### builderDrafts

> **builderDrafts**: `Record`\<`string`, [`QueryRule`](../type-aliases/QueryRule)\> = `{}`

Defined in: [admin/src/pages/ResourceListPage.tsx:154](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L154)

Working copy of each query-builder filter's rule tree, keyed by filter.

Editing happens here rather than in the URL so a half-built rule doesn't
re-query on every keystroke; "Apply" is what writes it to `?filters=`.

***

### newViewName

> **newViewName**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:157](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L157)

Name being typed into the "save this view" box.

***

### addBuilderRule()

> **addBuilderRule**(`key`, `path`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:209](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L209)

#### Parameters

##### key

`unknown`

##### path

`unknown`

#### Returns

`void`

***

### addBuilderGroup()

> **addBuilderGroup**(`key`, `path`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:221](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L221)

#### Parameters

##### key

`unknown`

##### path

`unknown`

#### Returns

`void`

***

### removeBuilderRule()

> **removeBuilderRule**(`key`, `path`, `index`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:228](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L228)

#### Parameters

##### key

`unknown`

##### path

`unknown`

##### index

`unknown`

#### Returns

`void`

***

### setBuilderGroupOperator()

> **setBuilderGroupOperator**(`key`, `path`, `operator`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:232](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L232)

#### Parameters

##### key

`unknown`

##### path

`unknown`

##### operator

`unknown`

#### Returns

`void`

***

### setBuilderRule()

> **setBuilderRule**(`key`, `path`, `index`, `field`, `value`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:237](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L237)

Update one field of one rule (its constraint, operator or value).

#### Parameters

##### key

`unknown`

##### path

`unknown`

##### index

`unknown`

##### field

`unknown`

##### value

`unknown`

#### Returns

`void`

***

### applyBuilder()

> **applyBuilder**(`key`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:264](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L264)

Commit a builder draft to the URL, which re-runs the query.

#### Parameters

##### key

`unknown`

#### Returns

`Promise`\<`void`\>

***

### clearBuilder()

> **clearBuilder**(`key`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:272](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L272)

Clear a builder entirely — draft and applied.

#### Parameters

##### key

`unknown`

#### Returns

`Promise`\<`void`\>

***

### toggleColumn()

> **toggleColumn**(`id`, `column`, `value`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:294](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L294)

Inline toggle-column edit: flip a boolean column on a record.

#### Parameters

##### id

`unknown`

##### column

`unknown`

##### value

`unknown`

#### Returns

`Promise`\<`void`\>

***

### cellEdits

> **cellEdits**: `Record`\<`string`, `unknown`\> = `{}`

Defined in: [admin/src/pages/ResourceListPage.tsx:308](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L308)

Per-cell draft values for inline select/text editing, keyed `id__column`.

***

### saveCell()

> **saveCell**(`id`, `column`, `key`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:315](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L315)

Persist an inline-edited cell. The new value is already synced into
`cellEdits[key]` by Flow's model binding (input fires before change), so we
read it back, write it, and drop the draft so the cell reseeds from the row.

#### Parameters

##### id

`unknown`

##### column

`unknown`

##### key

`unknown`

#### Returns

`Promise`\<`void`\>

***

### moveRow()

> **moveRow**(`id`, `dir`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:337](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L337)

Reorder a row up (-1) / down (+1) by swapping its position-column value with
the adjacent row's. Rows are ordered globally
by the position column; the swap persists via two updates.

#### Parameters

##### id

`unknown`

##### dir

`unknown`

#### Returns

`Promise`\<`void`\>

***

### runAction()

> **runAction**(`key`, `id`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:460](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L460)

Run a single-record callback action resolved by key.

#### Parameters

##### key

`unknown`

##### id

`unknown`

#### Returns

`Promise`\<`void`\>

***

### runBulkAction()

> **runBulkAction**(`key`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:476](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L476)

Run a bulk action over the current selection, then clear it.

#### Parameters

##### key

`unknown`

#### Returns

`Promise`\<`void`\>

***

### toggleSelect()

> **toggleSelect**(`id`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:569](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L569)

#### Parameters

##### id

`unknown`

#### Returns

`void`

***

### toggleSelectAll()

> **toggleSelectAll**(`ids`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:576](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L576)

#### Parameters

##### ids

`unknown`

#### Returns

`void`

***

### clearSelection()

> **clearSelection**(): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:582](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L582)

#### Returns

`void`

***

### actionModalOpen

> **actionModalOpen**: `boolean` = `false`

Defined in: [admin/src/pages/ResourceListPage.tsx:589](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L589)

Whether the action modal is open.

***

### actionFormKey

> **actionFormKey**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:591](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L591)

Key of the action whose modal is open.

***

### actionFormId

> **actionFormId**: `string` = `""`

Defined in: [admin/src/pages/ResourceListPage.tsx:593](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L593)

Record id the modal acts on ("" for header/bulk actions).

***

### actionForm

> **actionForm**: `Record`\<`string`, `unknown`\> = `{}`

Defined in: [admin/src/pages/ResourceListPage.tsx:595](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L595)

Reactive values bound to the modal form fields.

***

### actionErrors

> **actionErrors**: `Record`\<`string`, `string`\> = `{}`

Defined in: [admin/src/pages/ResourceListPage.tsx:597](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L597)

Per-field validation messages for the modal form.

***

### openActionForm()

> **openActionForm**(`key`, `id`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:610](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L610)

Open an action's modal form, seeding defaults (and the record for row actions).

#### Parameters

##### key

`unknown`

##### id

`unknown`

#### Returns

`Promise`\<`void`\>

***

### closeActionForm()

> **closeActionForm**(): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:640](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L640)

#### Returns

`void`

***

### submitActionForm()

> **submitActionForm**(): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:659](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L659)

Validate + run the open action's handler with the submitted form data.

#### Returns

`Promise`\<`void`\>

***

### saveCurrentView()

> **saveCurrentView**(): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:1057](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L1057)

Persist the list's current shape under a name.

#### Returns

`Promise`\<`void`\>

***

### deleteView()

> **deleteView**(`id`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:1074](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L1074)

#### Parameters

##### id

`unknown`

#### Returns

`Promise`\<`void`\>

***

### moveToLane()

> **moveToLane**(`id`, `lane`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:1501](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L1501)

Move a record to another kanban lane.

The lane change is the same authorised update a row action would make —
dragging between columns is a second way to reach one behaviour, not a
second path that skips the check.

#### Parameters

##### id

`unknown`

##### lane

`unknown`

#### Returns

`Promise`\<`void`\>

***

### deleteRecord()

> **deleteRecord**(`id`): `Promise`\<`void`\>

Defined in: [admin/src/pages/ResourceListPage.tsx:1561](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L1561)

Reactive row action: delete a record and flash the result. Flow re-renders
the component after the action, and render() re-queries the records — so the
deleted row (and the total count) drop out of the table automatically.

#### Parameters

##### id

`unknown`

#### Returns

`Promise`\<`void`\>

***

### setHeaderFilter()

> **setHeaderFilter**(`key`, `value`): `void`

Defined in: [admin/src/pages/ResourceListPage.tsx:1746](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L1746)

Set one header filter from its control in the table header.

Writes into the same `?filters=` map the filter bar uses, so a header filter
survives navigation, lands in a saved view, and shows up in the active-filter
chips like any other. Paging resets, because the row someone is filtering for
is unlikely to be on the page they were already on.

#### Parameters

##### key

`unknown`

##### value

`unknown`

#### Returns

`void`

## Rendering

### render()

> **render**(): `Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

Defined in: [admin/src/pages/ResourceListPage.tsx:1825](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/pages/ResourceListPage.tsx#L1825)

Return the JSX that represents this page.
Must include a single root element with `data-flow-root`.

#### Returns

`Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

the rendered [HtmlNode](../../../flow/index/type-aliases/HtmlNode) tree for this component.

#### Overrides

[`Component`](../../../flow/index/classes/Component).[`render`](../../../flow/index/classes/Component#render)

***

### placeholder()

> **placeholder**(): [`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)

Defined in: [flow/src/Component.ts:617](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L617)

Return the placeholder HTML shown while a lazy/deferred component loads.
Override this in child components that use `{ lazy: true }` or `{ defer: true }`.

#### Returns

[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)

#### Example

```ts
override placeholder() {
  return <div class="skeleton animate-pulse h-24 w-full rounded-lg" />;
}
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`placeholder`](../../../flow/index/classes/Component#placeholder)

***

### layout()

> **layout**(`page`): [`HtmlNode`](../../../flow/index/type-aliases/HtmlNode) \| `Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

Defined in: [flow/src/Component.ts:647](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L647)

Wrap the rendered page root in a layout shell. `page` is the already-rendered
`<div data-flow-root>…</div>` node; return whatever JSX wraps it. The default is
no layout (returns `page` unchanged).

This is the JSX-native alternative to `static layout = SomeLayout`: a layout is
just a component you wrap the page in, and its regions are ordinary props — the
same `Page.layout = (page) => <AppLayout>{page}</AppLayout>` convention the
framework's React/Inertia pages already use. `static layout` still works; when
both are present, this method wins.

The shell renders once (on the initial GET) and stays outside the reactive root,
so it is not re-rendered or re-sent on WebSocket actions and survives SPA
navigation between pages that wrap with the same layout.

#### Parameters

##### page

[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)

the already-rendered `<div data-flow-root>` page node to wrap.

#### Returns

[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode) \| `Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

the wrapping shell (or `page` unchanged for no layout).

#### Example

```ts
override layout(page: HtmlNode) {
  return <AppLayout title={ProfilePage.title} actions={<Save />}>{page}</AppLayout>;
}
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`layout`](../../../flow/index/classes/Component#layout)

***

### slot()

> **slot**(`name?`): [`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)

Defined in: [flow/src/Component.ts:677](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L677)

Return the HTML the parent passed for a named slot, for placing inside this
component's `render()`. Call with no argument for the default slot (the child's
plain `children`), or a name for a named slot (`slots={{ header: … }}` on the parent).
Returns an empty node when the slot wasn't provided, so `{this.slot("footer")}`
is safe to leave in the template unconditionally.

Slot content is rendered in the PARENT's scope and carried in this component's
snapshot, so it survives the child's own round-trips. Use `hasSlot()` to branch
on whether a slot was supplied (e.g. to omit a wrapping `<header>` entirely).

#### Parameters

##### name?

`string` = `"default"`

the slot name; omit for the default slot.

#### Returns

[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)

the slot's HTML, or an empty node when the slot was not provided.

#### Example

```ts
override async render() {
  return (
    <div class="card">
      {this.hasSlot("header") && <header>{this.slot("header")}</header>}
      <div class="body">{this.slot()}</div>
      {this.hasSlot("footer") && <footer>{this.slot("footer")}</footer>}
    </div>
  );
}
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`slot`](../../../flow/index/classes/Component#slot)

***

### hasSlot()

> **hasSlot**(`name?`): `boolean`

Defined in: [flow/src/Component.ts:685](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L685)

True when the parent supplied (non-empty) content for the given slot.

#### Parameters

##### name?

`string` = `"default"`

#### Returns

`boolean`

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`hasSlot`](../../../flow/index/classes/Component#hasslot)

***

### child()

> **child**\<`C`\>(`ChildClass`, `opts?`): `Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

Defined in: [flow/src/Component.ts:1233](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1233)

Embed another Component as a nested component with its own isolated state,
its own WebSocket update cycle, and its own snapshot.

Children are islands: a parent re-render does NOT re-render existing
children (their DOM and state are preserved on the client), and a child
update never touches the parent. Use `key` when embedding the same
component class multiple times (e.g. in a loop).

`props` are assigned to the child instance before `onMount()` runs.

Pass `lazy: true` to use IntersectionObserver — `onMount()` is deferred
until the placeholder enters the viewport.
Pass `defer: true` to load immediately after page paint (no intersection check).

#### Type Parameters

##### C

`C` *extends* [`Component`](../../../flow/index/classes/Component)

#### Parameters

##### ChildClass

() => `C`

the child Component class to embed.

##### opts?

`key` disambiguates repeated instances; `props` seed the child before
                   `onMount()`; `lazy`/`defer` render a placeholder first; `slots` pass named
                   slot HTML.

###### key?

`string` \| `number`

###### props?

`Partial`\<`C`\>

###### lazy?

`boolean`

###### defer?

`boolean`

###### slots?

`Record`\<`string`, `string`\>

Named slot HTML (`name → html`, default slot keyed `"default"`), rendered by the parent.

#### Returns

`Promise`\<[`HtmlNode`](../../../flow/index/type-aliases/HtmlNode)\>

the child's rendered [HtmlNode](../../../flow/index/type-aliases/HtmlNode) (root or placeholder).

#### Example

```ts
override async render() {
  return <div>
    <h1>Dashboard</h1>
    <StatsWidget />
    <CounterWidget key="a" step={5} />
    <SlowWidget lazy />
  </div>;
}
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`child`](../../../flow/index/classes/Component#child)

## State & exposure

### durable?

> `static` `optional` **durable?**: `boolean` \| \{ `ttl?`: `string`; `scope?`: `"session"` \| `"user"`; \}

Defined in: [flow/src/Component.ts:467](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L467)

Opt into durable/resumable snapshots: `static durable = true` (or `{ ttl, scope }`).
The signed snapshot is persisted server-side after every request, keyed by user (or
session) + route, and restored on a fresh GET so the user resumes exactly. See
[clearDurable](../../../flow/index/classes/Component#cleardurable) to drop the stored state on flow completion.

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`durable`](../../../flow/index/classes/Component#durable)

***

### clearDurable()

> **clearDurable**(): `void`

Defined in: [flow/src/Component.ts:479](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L479)

Forget this component's durable snapshot at the end of the current request — call it when a
durable flow completes (a wizard finished, a form submitted) so the next visit starts fresh
instead of resuming the finished state. No-op unless the component opted into `static durable`.

#### Returns

`void`

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`clearDurable`](../../../flow/index/classes/Component#cleardurable)

***

### bind()

> **bind**(`key`): `Record`\<`string`, `unknown`\>

Defined in: [flow/src/Component.ts:1192](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1192)

Emit the HTML attributes needed for `flow:model` two-way binding.

#### Parameters

##### key

`string`

the `@expose` property to two-way bind.

#### Returns

`Record`\<`string`, `unknown`\>

the `flow:model` + `value` attributes to spread onto an input.

#### Example

```ts
<input {...this.bind('name')} />
// → <input flow:model="name" value="Alice" />
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`bind`](../../../flow/index/classes/Component#bind)

## Validation

### errors

#### Get Signature

> **get** **errors**(): [`ErrorsProxy`](../../../flow/index/interfaces/ErrorsProxy)

Defined in: [flow/src/Component.ts:384](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L384)

Typed access to this component's validation error bag.

- `this.errors.has("field")` → `boolean`
- `this.errors.field` → an [ErrorField](../../../flow/index/classes/ErrorField) for `error={this.errors.field}`
- `this.errors.add("field", "message")` → add an error manually
- `this.errors.add({ field: "message" })` → add several at once
- `this.errors.clear(field?)` → clear one field, or all

##### Returns

[`ErrorsProxy`](../../../flow/index/interfaces/ErrorsProxy)

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`errors`](../../../flow/index/classes/Component#errors)

***

### validate()

> **validate**(`rulesOrForm?`): `Promise`\<`void`\>

Defined in: [flow/src/Component.ts:937](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L937)

Validate page properties against rules. If validation fails, errors are
stored and a `ValidationError` is thrown (caught by the framework, which
re-renders the page with `$errors` populated client-side).

Pass explicit rules or omit to use `@validate` decorator rules.

**Error persistence:** validation errors survive across actions and are
re-sent on every patch until the next `validate()` call clears them (on
success) or `resetValidation()` is called explicitly. If you want errors
cleared at the start of every action, call `this.resetValidation()` before
the new `validate()` call.

#### Parameters

##### rulesOrForm?

[`ValidationRules`](../../../flow/index/type-aliases/ValidationRules) \| \{ `__isFlowForm`: `true`; `_validateToErrors`: `Record`\<`string`, `string`[]\>; \}

explicit per-field rules, a [Form](../../../flow/index/classes/Form) instance to validate, or
                    omit to use the component's `@validate` decorator rules.

#### Returns

`Promise`\<`void`\>

#### Example

```ts
async save() {
  this.validate({
    email:    (rule) => rule.required().email(),
    password: (rule) => rule.required().min(8),
  });
  // reaches here only if valid
}
```

#### Throws

when validation fails — the framework catches it and re-renders
  with `this.errors` populated.

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`validate`](../../../flow/index/classes/Component#validate)

***

### addError()

> **addError**(`field`, `message`): `void`

Defined in: [flow/src/Component.ts:1020](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1020)

Manually add a validation error for a field.

#### Parameters

##### field

`string`

##### message

`string`

#### Returns

`void`

#### Example

```ts
this.addError('email', 'That email is already taken.');
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`addError`](../../../flow/index/classes/Component#adderror)

***

### resetValidation()

> **resetValidation**(`field?`): `void`

Defined in: [flow/src/Component.ts:1034](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/flow/src/Component.ts#L1034)

Clear validation errors — all fields, or just the specified field.

#### Parameters

##### field?

`string`

#### Returns

`void`

#### Example

```ts
this.resetValidation();          // clear all
this.resetValidation('email');   // clear email only
```

#### Inherited from

[`Component`](../../../flow/index/classes/Component).[`resetValidation`](../../../flow/index/classes/Component#resetvalidation)
