Add components

A new app already includes a styled example with the Fysicl Elements runtime, Button and Input. The CLI keeps those Vue sources, their dependencies and the theme in a tracked vendor directory. Commit that directory and install its dependencies yourself.

Add one component family later, or run ui add without names for every family. Only init app --bare starts without Elements.

Code example
fysicl ui list
fysicl ui add dialog --dir contact-tools
fysicl ui add --dir contact-tools

Forms, menus and overlays

Use the exact dashboard components: button, input, textarea, checkbox, switch, tabs, dialog, drawer, bottom-sheet, dialog-or-drawer, dropdown-menu, choice-menu, tooltip, popover, slider, color-picker, morph-menu, resource-table, resource-picker, regional selectors, charts and date/time pickers. ChoiceMenu shows a keyboard menu on desktop and a draggable drawer on mobile. DialogOrDrawer uses the same 768px breakpoint. Give overlays a localized title, description and close action. Checkbox and Switch use v-model; Tabs supports arrow keys. DropdownMenu includes checkbox and radio items.

ElementIcon uses @iconify/vue with bundled Lucide data: component icons render during SSR and without network requests. Use your own bundled Iconify data for additional icons. Keep the ISC license with copied sources.

Code example
fysicl ui add checkbox switch tabs choice-menu dialog-or-drawer icon

import { ElementCheckbox, ElementSwitch, ElementChoiceMenu, ElementDialogOrDrawer } from '@fysicl/elements'
// <ElementCheckbox v-model="required" />
// <ElementSwitch v-model="published" />
// <ElementChoiceMenu v-model="type" :options="options" label="Question type" />
// <ElementDialogOrDrawer v-model:open="open" title="Settings">…</ElementDialogOrDrawer>

Native Fysicl controls

Elements includes generated sources from the actual dashboard components, with the same keyboard behavior, hover, Scritto text, NumberFlow and mobile sheets. Included hashes track source parity. The scaffold already configures its runtime and ElementsProvider.

The runtime receives locale, navigation, reduced-motion preferences and optional colors explicitly from your app. Resources require your authorized loader and a scopeKey that changes with account, installation or workspace. Controls never read a dashboard session or private dashboard endpoint implicitly.

Code example
fysicl ui add runtime resource-table resource-picker regional-selectors color-picker chart date-picker date-range-picker time-picker animation

import { createElementsRuntime, ElementsProvider } from '@fysicl/elements/runtime'
// app.use(createElementsRuntime({ locale, scopeKey, resources: authorizedLoader }))
// <ElementsProvider><YourApp /></ElementsProvider>

Tables and file previews

Add tables for the same editor as Fysicl Tables: multiple sheets, formulas, ranges, formatting, sorting, filters and clipboard support. Charts, refreshable pivots and conditional formatting use the same native controls. Cells respond immediately without editing animations. Use read-only for previews; your app supplies authorized persistence and autosave.

Add files for responsive file previews, including images, PDF pages, media and text. Supply an explicit FilePreviewProvider for inspection, authorized bytes and downloads. TableProvider describes your authorized storage; components add no app permissions or access to private sessions. Advanced Excel features can differ; retain originals and show conversion warnings.

Code example
fysicl ui add tables files account-menu

import { ElementTableGrid, createTableDocument } from '@fysicl/elements/tables'
import type { TableProvider } from '@fysicl/elements/tables'
import { ElementFilePreviewDialog } from '@fysicl/elements/files'
// <ElementTableGrid v-model="document" :read-only="!canEdit" :locale="locale" />

Tables and views

ElementResourceTable uses the same full table as the dashboard: view tabs, search and filters, sorting, column visibility and order, selection, your bulk actions and paging. On phones, rows become compact buttons to details. Column labels cycle ascending, descending and default order; arrows appear only while sorted. The rightmost menu controls general sorting. Supply localized labels for columns, filters and default views.

A stable view-key and a scopeKey containing account, installation and workspace identity keep personal views in this browser. Only search, filter, sort and column choices are stored. Without a key or identity, views last for this visit. Storage failures show a notice and preserve current views.

Set hostOrigin explicitly on the Elements runtime and wrap your app in ElementsProvider. Shared dialogs, drawers and menus hide the mobile dashboard bar until every overlay closes. Keep local Save/Done buttons inside overlays.

Code example
import { ElementResourceTable } from '@fysicl/elements/resource-table'
// <ElementResourceTable view-key="forms" :rows="rows" :columns="columns"
//   :row-key="row => row.id" :views="views" :label="t('forms')"
//   :search-placeholder="t('searchForms')" :actions="bulkActions" />

Returning and choosing

A stable view-key also remembers the current-visit search, filters, sorting, page, valid selection and scroll position when returning from details. Each account, installation and workspace scope stays separate. Row data and selected IDs are not saved to localStorage for this return state.

Resource pickers show up to five recently chosen resources. Only IDs are stored in the browser; names and artwork are reloaded through your authorized loader. It must support an exact id lookup while preserving current filters and permissions.

Optionally supply createResource to open your authorized creation form. Resolve { id } only after saving, or null on cancellation. The picker checks the saved item again before selecting it. No callback means no creation action. Keep local Save/Done/Cancel buttons; no extra permissions are granted.

Code example
import type { ResourceCreator } from '@fysicl/elements/resource-picker'
// const createResource: ResourceCreator = async context => {
//   return await openAuthorizedCreationDialog(context) // { id } or null
// }
// <ElementCollectionPicker :create-resource="createResource" />

Data and permissions

Read and write permissions are independent for experiences, tags, collections, destinations, profile and workspace. Request only the .read and .write scopes needed in your manifest. Write grants no deletion, publication, billing or membership administration. tags, profile and workspace support read and update; the capability catalog lists available actions.

The SDK uses only the short-lived in-memory launch token. A missing-scope failure identifies required permissions. Add them to the app draft and request a new review and workspace approval; detection grants no access itself. tag_orders is future functionality and is not accepted now.

Code example
import { createAppDataClient } from '@fysicl/elements/runtime'
const api = createAppDataClient({ hostOrigin, accessToken: () => token, scopeKey: () => authorizationScope })
const capabilities = await api.capabilities()
const collections = await api.resource('collections').list({ limit: 25 })

Update

The CLI tracks hashes of copied files. An update refuses to overwrite a modified vendor directory. Keep app-specific code outside that directory.

Code example
fysicl ui update --dir contact-tools

Use connected accounts

Request connectors.read in your app manifest and submit the version for review. This is a separate read permission: connectors.write does not exist and it grants no general create, edit or publication rights.

After installation, a workspace owner opens Settings → Connections, chooses the account and Apps with access. The owner separately approves the actions and information for your exact app version. Without that approval the list is empty. Your app never receives account tokens or client secrets.

Use only the returned grant ID. Read at most 25 results per request and follow nextCursor for more. Unapproved information fields are absent; do not infer URLs or other data from missing fields. Revocation, an installation change or reconnect can stop access immediately. Respect failures and reload the approved list.

Test installations report that account access is unavailable. Account data, scoped publication and real provider consent need separate testing; a working public video example does not prove OAuth access.

Personal connections are separate under Account → My connections. Only their owner can use them privately in the current workspace, when the Fysicl administrator enables personal accounts for that service. They cannot grant access to workspace apps. During connection setup, the owner chooses once which details and optional listening activity may appear in Experiences. Blocks reuse those approved choices without asking again. Existing accounts can review this under Use in Experiences.

Code example
const capabilities = await api.capabilities()
if (capabilities.connectors.available) {
  const page = await api.connectors.list({ limit: 25 })
  const approved = page.connectors.find(connection =>
    connection.permissions.some(permission => permission.operation === 'youtube.uploads'))
  if (approved) {
    const posts = await api.connectors.read(approved.id, {
      operation: 'youtube.uploads', limit: 25
    }, abortController.signal)
    // Render only fields present in posts.items; preserve posts.nextCursor.
  }
}