|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: Create a React PDF Viewer with Agentic UI Builder | Syncfusion |
| 4 | +description: Learn how to use the React PDF Viewer component of Syncfusion Essential JS 2 with Agentic UI Builder. |
| 5 | +control: PDF Viewer |
| 6 | +platform: document-processing |
| 7 | +documentation: ug |
| 8 | +domainurl: ##DomainURL## |
| 9 | +--- |
| 10 | + |
| 11 | +# Create a React PDF Viewer with Agentic UI Builder |
| 12 | + |
| 13 | +This article explains how to build a Syncfusion® React PDF Viewer by entering natural-language instructions into the [**Syncfusion® React Agentic UI Builder**](https://www.syncfusion.com/explore/mcp-servers/) (which runs on Syncfusion's MCP Server). Describe your requirements, and the tool will generate a complete PDF Viewer implementation. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- Ensure the **React Agentic UI Builder** extension is installed in your IDE. See the official [installation guide](https://ej2.syncfusion.com/react/documentation/mcp-server/installation). |
| 18 | +- Have an existing React project ready (JavaScript or TypeScript, any supported version) before using the Agentic UI Builder. |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +After installation, open your React project in your IDE, launch the AI assistant, and run the ```#sf_react_ui_builder``` command describing the UI you want. For example: |
| 23 | + |
| 24 | +**Example:** |
| 25 | + |
| 26 | +``` |
| 27 | +#sf_react_ui_builder Create standalone React PDF Viewer using the Bootstrap 5 theme with the default modules. Install the required packages, import the theme CSS in the correct order, and initialize the PDF Viewer. |
| 28 | +``` |
| 29 | + |
| 30 | +The UI Builder generates complete implementations including layout, components, and styling. A preview of the generated output appears below: |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +## Individual Tools |
| 35 | + |
| 36 | +You can directly call individual tools using their specific tool names when you need focused assistance. This is helpful when you want targeted support from a particular tool. |
| 37 | + |
| 38 | +### Layout Tool (`#sf_react_layout`) |
| 39 | + |
| 40 | +This tool provides a collection of pre-built, responsive UI layout templates and blocks commonly used across different page sections and design patterns. |
| 41 | + |
| 42 | +**When to use:** For creating page structures, responsive layouts, or using ready-made UI patterns. |
| 43 | + |
| 44 | +**Example:** |
| 45 | + |
| 46 | +``` |
| 47 | +#sf_react_layout Add a navigation bar and footer for PFD Viewer |
| 48 | +``` |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +### Component Tool (`#sf_react_component`) |
| 53 | + |
| 54 | +This tool offers quick reference details for Syncfusion React components, including their properties, events, methods, and basic usage examples. |
| 55 | + |
| 56 | +**When to use:** When you need essential API information or structure details to correctly implement a specific component. |
| 57 | + |
| 58 | +**Example:** |
| 59 | + |
| 60 | +``` |
| 61 | +#sf_react_component Integrate a tab component in the existing PDF Viewer setup |
| 62 | +``` |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +### Style Tool (`#sf_react_style`) |
| 67 | + |
| 68 | +This tool provides options for configuring themes, setting up styling, and integrating icons for Syncfusion React components. It supports multiple themes such as Tailwind 3 CSS, Bootstrap 5.3, Material 3, and Fluent 2, along with light and dark mode setups and consistent icon usage. |
| 69 | + |
| 70 | +**When to use:** When applying themes, customizing colors, modifying component appearance, or adding icons to the UI. |
| 71 | + |
| 72 | +**Example:** |
| 73 | + |
| 74 | +``` |
| 75 | +#sf_react_style Change the theme to tailwind 3 for the PDF Viewer setup |
| 76 | +``` |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +### Tips & Best Practices |
| 81 | + |
| 82 | +- Turn on **Agent mode** in your IDE to enable smooth, multi-step operations with confirmation prompts. |
| 83 | +- Use higher-capability models (**Claude Sonnet 4.5 or newer, GPT-5**) as they typically produce more accurate, higher-quality code. |
| 84 | +- If a step times out or becomes unresponsive, cancel it and retry. |
| 85 | +- Review the generated code and commands before applying them in a production environment. |
| 86 | + |
| 87 | +### See Also |
| 88 | + |
| 89 | +- For examples of prompt patterns and customization options for layouts, components, and styles, refer to the [prompt Library](https://ej2.syncfusion.com/react/documentation/mcp-server/agentic-ui-builder/prompt-library). |
0 commit comments