Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>CxJs SnippetsNew to Visual Studio Code? Get it now.
CxJs Snippets

CxJs Snippets

Duško Pilipović

|
4 installs
| (0) | Free
CxJs useful snippets
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CxJS Snippets

A VS Code extension providing useful code snippets for CxJS framework development. This extension includes snippets for creating components, controllers, models, and other common CxJS patterns.

Features

This extension provides the following snippets for JavaScript, TypeScript:

Available Snippets

Snippet Name Prefix Description Generated Code
Print to console log, console Inserts a console.log statement console.log('');
Create CxJs component cmp, cxcomponent Creates a CxJS functional component Full functional component boilerplate with createFunctionalComponent
Create CxJs controller con, cxcontroller Creates a CxJS controller class Controller class with onInit() and onDestroy() methods
Try catch block trc, cxtrycatch Creates a try-catch block with error toast Try-catch block with showErrorToast(e)
Hot promise window hotwin, cxhotwindow Creates a hot promise window factory Complete window factory with props interface and configuration
Create model mod, cxmodel Creates a typed CxJS model Model interface with createAccessorModelProxy

Usage

  1. Start typing one of the prefix keywords in your JavaScript/TypeScript file
  2. Select the snippet from the autocomplete dropdown
  3. Press Tab to insert the snippet
  4. Use Tab to navigate between placeholders in the snippet

Example: Creating a CxJS Component

Type cmp or cxcomponent and press Tab:

import { createFunctionalComponent } from "cx/ui";
export default createFunctionalComponent(() => (
  <cx>
    <div>// cursor position</div>
  </cx>
));

Example: Creating a CxJS Controller

Type con or cxcontroller and press Tab:

import { Controller } from "cx/ui";
export default class extends Controller {
  onInit() {}
  onDestroy() {}
}

Example: Creating a Typed Model

Type mod or cxmodel and press Tab:

import { createAccessorModelProxy } from "cx/data";

export interface Model {
  $page: {
    /* your properties here */
  };
}

export default createAccessorModelProxy<Model>();

Requirements

  • VS Code 1.50.0 or higher
  • CxJS framework project

Supported Languages

  • JavaScript (.js, .jsx)
  • TypeScript (.ts, .tsx)

Documentation

For more information about CxJS:

  • CxJS Official Documentation
  • Functional Components
  • Controllers
  • Typed Models

Release Notes

1.0.0

Initial release with 6 essential CxJS snippets


Enjoy coding with CxJS!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft