Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>HBS ViewerNew to Visual Studio Code? Get it now.
HBS Viewer

HBS Viewer

Darshan Parmar

| (0) | Free
Live preview for Handlebars (.hbs, .handlebars) templates with dynamic variables editor and live file watching.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HBS Viewer Icon

HBS / Handlebars Live Viewer

Real-time live preview for Handlebars templates with dynamic variables injection & responsive viewports.

VS Code Version License: MIT


✨ Key Features

  • 📂 Seamless File Selection:
    • Open preview instantly via the editor title bar eye icon ($(eye)) when viewing any .hbs / .handlebars file.
    • Right-click any template in the Explorer ➔ Open Handlebars Preview.
    • Switch templates on-the-fly inside the preview webview or via Command Palette (HBS Viewer: Select Template & Open Preview).
  • ⚡ Live File Watching & Instant Re-rendering:
    • Re-renders as you type in the editor in real-time with zero save latency.
    • Automatically detects file modifications from disk, git operations, or branch switching.
  • 🎛️ Floating & Draggable Variables Dialog:
    • Independent floating popup modal that never squishes or disrupts the preview canvas.
    • Drag anywhere across the screen and resize freely.
    • ⚡ Auto-Detect Variables: Introspects template AST to discover variable keys and pre-populate sample JSON mock data with one click.
    • Format / Beautify: Clean up and indent JSON automatically.
    • 📂 Load / 💾 Save JSON: Import mock data from workspace .json files or export context data.
    • Per-Template Persistence: Automatically saves your custom variables per template file across VS Code sessions.
  • 📱 Multi-Device Responsive Viewports:
    • Test responsive templates across standard device viewports:
      • 🖥️ Responsive (Full)
      • 📱 Mobile (390 × 844)
      • 📱 Mobile SM (375 × 667)
      • 📱 Tablet (768 × 1024)
      • 💻 Laptop (1280 × 800)
      • 🖥️ Desktop (1440 × 900)
    • 🔄 Orientation Rotation: Easily flip between portrait and landscape modes.
    • Auto-Fit & Zoom: Automatically scales larger devices to fit your active editor split, or zoom at 100%, 75%, 50%.
  • 👁️ Dual Preview Modes:
    • Visual View: Sandboxed iframe rendering with isolated CSS styling.
    • HTML Source View: Inspect formatted raw markup with a one-click 📋 Copy HTML action.
  • 🛠️ Standard Built-in Helpers:
    • Pre-registered helper functions: eq, ne, lt, gt, lte, gte, and, or, not, json, upper, lower, and default.

🚀 Getting Started

  1. Open any .hbs or .handlebars file in VS Code.
  2. Click the 👁 (eye) icon in the top right editor tab toolbar, or run:
    • Cmd+Shift+P / Ctrl+Shift+P ➔ HBS Viewer: Open Handlebars Preview
  3. The preview will open beside your code editor.
  4. Click { } Variables in the top bar to open the floating JSON variables editor.
  5. Click ⚡ Detect to automatically populate your template variables with mock data, and watch the preview update live!

🧪 Sample Template & Mock Data

Try out the bundled examples located in the examples/ folder:

  • examples/sample.hbs: Complete HTML template demonstrating conditionals, lists, and helpers.
  • examples/sample-data.json: Sample mock data context.

👨‍💻 Author & Publisher

  • Publisher: darshanyeah
  • Author: Darshan Parmar
  • Website: darshp.in
  • Contact: darshanparmar505@gmail.com

📄 License

This extension is licensed under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft