StackpressGitHub

API reference

stackpress/view/client

stackpress/view/client is the browser-safe view shelf. It re-exports the client-safe hooks, provider components, layout components, notifier helpers, and selected admin client helpers that are safe to import into browser-facing code.

Import

import {
  useResponse,
  useConfig,
  notify,
  LayoutPanel
} from 'stackpress/view/client';

When To Use It

Use this path when your code runs in the browser and you want to avoid pulling in server-side rendering helpers from the broader stackpress/view path.

Export Inventory

ExportKindPurpose
useRequest, useResponse, useConfig, useSession, useServerhooksRead current request, response, config, session, or server context
useTheme, useLanguagehooksRead theme and language context
ServerProvider, ThemeProvider and related context componentscomponentsProvide current request/session/config/theme data
layout componentscomponentsBuild standard view layouts
flash, notify, unload, NotifierContainerhelpers/componentsRender and manage notifications
filter, order, paginatehelpersClient-side admin query helpers

Detailed Exports

useResponse

  • Kind: hook
  • Use it to read the current response payload inside a client-side React view.
  • Returns the response object currently provided by the Stackpress view tree.
import { useResponse } from 'stackpress/view/client';

const response = useResponse<{ title: string }>();

useConfig

  • Kind: hook
  • Use it to read the config payload exposed to the current page tree.
import { useConfig } from 'stackpress/view/client';

useSession

  • Kind: hook
  • Use it to read session data from the current page tree.
import { useSession } from 'stackpress/view/client';

useServer

  • Kind: hook
  • Use it to read the broader server payload exposed to the current view tree.
import { useServer } from 'stackpress/view/client';

notify, flash, unload

  • Kind: functions
  • Use them to create, push, or clear notification entries in the browser-safe view layer.
import { notify, flash, unload } from 'stackpress/view/client';

NotifierContainer

  • Kind: component
  • Use it to render active notifications.
import { NotifierContainer } from 'stackpress/view/client';

ServerProvider

  • Kind: component
  • Use it to make request, response, config, and session data available to nested hooks and components.
import { ServerProvider } from 'stackpress/view/client';

filter, order, paginate

  • Kind: functions
  • Use them when building or transforming admin/client query state in browser-safe code.
import { filter, order, paginate } from 'stackpress/view/client';