> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Form Library

> Browse, preview, and use form templates with AI recommendations and a template generator at /fw/form-templates.

The Form Library screen provides a searchable gallery of form templates with preview, customization, and AI recommendation capabilities and is available at `/fw/form-templates`.

## Overview

This screen displays form templates loaded via `useFormTemplates`, filtered by category and search text. Templates include both organization-specific and marketplace templates (`includeMarketplace: true`). Each template is shown as a `FormTemplateCard`. Actions include: preview (`FormTemplatePreview`), customize (`FormTemplateCustomizer`), create new template (`CreateFormTemplateDialog`), and AI-generate a template (`GenerateFormTemplateDialog`). AI recommendations are shown via `AITemplateRecommendations` using a transformed template list. Clicking **Use Template** from preview or customizer creates a new form based on the template and navigates to the form editor.

## Who it's for

No explicit route-level permission gate. Template creation gated by `fw.templates.create` via `PermissionGate` inside components.

## Before you start

* Navigate to `/fw/form-templates` from the Forms & Workflow sidebar.
* To create templates you need `fw.templates.create`.
* To publish templates you need `fw.templates.publish`.

## Steps

<Steps>
  <Step title="Open Form Library">Navigate to `/fw/form-templates`.</Step>
  <Step title="Search or filter by category">Use the search input and category dropdown to narrow results.</Step>
  <Step title="Preview a template">Click a `FormTemplateCard` to open `FormTemplatePreview`.</Step>
  <Step title="Customize and use">From the preview, open `FormTemplateCustomizer` to adjust the template before creating a form.</Step>
  <Step title="Generate with AI">Click **Generate Template** to open `GenerateFormTemplateDialog` and create a template using AI.</Step>
  <Step title="Create a blank template">Click **New Template** (requires `fw.templates.create`) to open `CreateFormTemplateDialog`.</Step>
</Steps>

## Key concepts

* **Form template** — a reusable form blueprint that can be cloned into a new form.
* **Template categories** — defined in `FORM_TEMPLATE_CATEGORIES` from `fw/types/formTemplates`.
* **Marketplace** — templates available beyond the current organization (SME: confirm scope).

## Related

<Columns cols={2}>
  <Card title="Forms & Workflow" icon="diagram-project" href="/fw/overview">
    Forms & Workflow core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/fw\.tsx
  * src/cores/fw/pages/FormTemplateLibraryPage.tsx
  * src/cores/fw/types/formTemplates.ts
  * src/platform/permissions/constants.ts
</Accordion>
