Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

๐Ÿš€ Juris VSCode Snippets

jurisauthor edited this page Jul 5, 2025 · 2 revisions

The ultimate VSCode snippet collection for Juris Framework development

Boost your productivity with 200+ intelligent code snippets for building Juris Object VDOM applications. Get complete components, forms, layouts, and patterns with proper JSDoc type annotations.

Juris Framework VSCode License

โœจ Features

  • ๐ŸŽฏ 200+ Snippets - Complete coverage of Juris patterns
  • ๐Ÿ“ JSDoc Integration - Full type safety with IntelliSense
  • ๐Ÿ—๏ธ Component Templates - Basic, lifecycle, headless, and typed components
  • ๐ŸŽจ Layout Elements - All HTML elements with class/ID variants
  • ๐Ÿ“‹ Form Components - Complete login/register forms with validation
  • ๐Ÿ”„ Interactive Patterns - Tabs, conditional rendering, array mapping
  • ๐Ÿท๏ธ Auto-closing Labels - Never lose track of nested structures
  • ๐Ÿ“ฑ Multi-line Formatting - Readable, maintainable code structure

๐Ÿ› ๏ธ Installation

Option 1: Manual Installation (Recommended)

  1. Open VSCode User Snippets:

    • Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
    • Type "Preferences: Configure Snippets"
    • Select "javascript.json"
  2. Copy the snippet configuration:

Option 2: Direct File Access

Navigate to your VSCode snippets folder and edit directly:

Windows:

%APPDATA%\Code\User\snippets\javascript.json

macOS:

~/Library/Application Support/Code/User/snippets/javascript.json

Linux:

~/.config/Code/User\snippets\javascript.json

Option 3: Workspace-Specific Installation

  1. Create .vscode/snippets/ folder in your project root
  2. Create javascript.json in the snippets folder
  3. Copy the snippet configuration from the GitHub repository

๐Ÿ“– Quick Start

After installation, start typing any snippet prefix and press Tab:

// Type: jcomp + Tab
/**
 * @param {Object} props
 * @param {JurisContext} context
 * @returns {JurisVDOMElement}
 */
const ComponentName = (props, context) => {
 const { getState, setState } = context;
return {
 div: {
 className: 'container',
 children: [
 // Your content here
 ]
 }//div.container
};

};

๐ŸŽฏ Snippet Categories

๐Ÿ—๏ธ Component Templates

Prefix Description
jcomp Basic component with JSDoc
jcomplife Component with lifecycle hooks
jheadless Headless component
jcomptyped Strongly typed component
jcompstate Component with typed state

๐ŸŽจ Class & ID Shortcuts

Use the dot notation for className and hash notation for ID:

// Type: jdiv.container + Tab
{div: {
 className: 'container',
 children: []
}}//div.container

// Type: jbtn#submit + Tab
{button: { id: 'submit', text: 'Submit', onClick: () => handleSubmit() }}//button#submit

๐Ÿ’ก Real-World Examples

Authentication System

// Type: jlogin + Tab - Complete login form
// Type: jregister + Tab - Complete registration form 
// Type: jauth + Tab - Auth container with tab switching

Tab Component

// Type: jtab + Tab
export const SimpleTab = (props, { getState, setState }) => {
 return {
 div: {
 children: [
 // Tab buttons with state management
 // Dynamic content switching
 ]
 }//div
 };
};

Form with Validation

// Type: jform.contact + Tab
{form: {
 className: 'contact',
 onSubmit: (e) => {
 e.preventDefault();
 handleSubmit();
 },
 children: [
 // Form fields here
 ]
}}//form.contact

๐ŸŽฏ Best Practices

1. Use JSDoc Types

All component snippets include proper JSDoc annotations:

/**
 * @param {Object} props
 * @param {JurisContext} context
 * @returns {JurisVDOMElement}
 */

2. Leverage Class/ID Shortcuts

  • Use jdiv.container for quick className assignment
  • Use jbtn#submit for quick ID assignment
  • Combine with multi-line formatting for readability

3. Follow Closing Label Convention

All snippets include proper closing labels:

{div: {
 className: 'container',
 children: []
}}//div.container

4. State Management Patterns

// Use reactive properties for dynamic content
text: () => getState('message'),
className: () => getState('isActive') ? 'active' : 'inactive',
children: () => getState('items', []).map(item => /* ... */)

๐Ÿ”ง Configuration

VSCode Settings

Add to your VSCode settings for optimal experience:

{
 "editor.tabCompletion": "on",
 "editor.suggest.snippetsPreventQuickSuggestions": false,
 "editor.suggest.showSnippets": "top"
}

File Associations

For enhanced IntelliSense with .component.js files:

{
 "files.associations": {
 "*.component.js": "javascript"
 }
}

๐ŸŒŸ Advanced Usage

Custom Snippet Creation

Extend the snippet collection by adding your own patterns to the JSON file.

Team Sharing

Share the .vscode/snippets/javascript.json file in your project repository for team-wide consistency.

๐Ÿค Contributing

Found a bug or have a suggestion?

  1. Visit the Juris GitHub repository
  2. Check the snippet configuration
  3. Submit an issue or pull request

๐Ÿ“š Resources

๐Ÿ“„ License

MIT License - see the Juris repository for details.


Made with โค๏ธ for the Juris Framework community

Boost your productivity and build amazing Juris applications faster than ever!

# ๐Ÿš€ Juris VSCode Snippets

The ultimate VSCode snippet collection for Juris Framework development

Boost your productivity with 200+ intelligent code snippets for building Juris Object VDOM applications. Get complete components, forms, layouts, and patterns with proper JSDoc type annotations.

Juris Framework VSCode License

โœจ Features

  • ๐ŸŽฏ 200+ Snippets - Complete coverage of Juris patterns
  • ๐Ÿ“ JSDoc Integration - Full type safety with IntelliSense
  • ๐Ÿ—๏ธ Component Templates - Basic, lifecycle, headless, and typed components
  • ๐ŸŽจ Layout Elements - All HTML elements with class/ID variants
  • ๐Ÿ“‹ Form Components - Complete login/register forms with validation
  • ๐Ÿ”„ Interactive Patterns - Tabs, conditional rendering, array mapping
  • ๐Ÿท๏ธ Auto-closing Labels - Never lose track of nested structures
  • ๐Ÿ“ฑ Multi-line Formatting - Readable, maintainable code structure

๐Ÿ› ๏ธ Installation

Option 1: Manual Installation (Recommended)

  1. Open VSCode User Snippets:

    • Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
    • Type "Preferences: Configure User Snippets"
    • Select "javascript.json"
  2. Copy the snippet configuration:

Option 2: Direct File Access

Navigate to your VSCode snippets folder and edit directly:

Windows:

%APPDATA%\Code\User\snippets\javascript.json

macOS:

~/Library/Application Support/Code/User/snippets/javascript.json

Linux:

~/.config/Code/User\snippets\javascript.json

Option 3: Workspace-Specific Installation

  1. Create .vscode/snippets/ folder in your project root
  2. Create javascript.json in the snippets folder
  3. Copy the snippet configuration from the GitHub repository

๐Ÿ“– Quick Start

After installation, start typing any snippet prefix and press Tab:

// Type: jcomp + Tab
/**
 * @param {Object} props
 * @param {JurisContext} context
 * @returns {JurisVDOMElement}
 */
const ComponentName = (props, context) => {
 const { getState, setState } = context;
 
 return {
 div: {
 className: 'container',
 children: [
 // Your content here
 ]
 }//div.container
 };
};

๐ŸŽฏ Snippet Categories

๐Ÿ—๏ธ Component Templates

Prefix Description
jcomp Basic component with JSDoc
jcomplife Component with lifecycle hooks
jheadless Headless component
jcomptyped Strongly typed component
jcompstate Component with typed state

๐ŸŽจ Layout Elements

Prefix Description
jdiv / jdiv. / jdiv# Div container
jsection / jsection. / jsection# Section element
jheader / jheader. / jheader# Header element
jfooter / jfooter. / jfooter# Footer element
jnav / jnav. / jnav# Navigation element
jmain / jmain. / jmain# Main content element
jarticle / jarticle. / jarticle# Article element
jaside / jaside. / jaside# Aside/sidebar element

๐Ÿ“‹ Form Elements

Prefix Description
jform / jform. / jform# Form with submit handler
jinput / jinput. / jinput# Input with reactive value
jselect / jselect. / jselect# Select dropdown
jbtn / jbtn. / jbtn# Button elements
jtextarea Textarea with reactive value
jlabel Label element

๐Ÿ” Authentication Forms

Prefix Description
jlogin Complete login form
jregister Complete registration form
jauth Auth container with tabs

๐Ÿ“ Text & Media Elements

Prefix Description
jp / jp. / jp# Paragraph element
jspan / jspan. / jspan# Span element
jh1 / jh1. / jh1# Heading elements (h1-h6)
jimg Image element
jlink Anchor/link element
jtext Reactive text element

๐Ÿ“Š Lists & Tables

Prefix Description
jul / jul. / jul# Unordered list
jol Ordered list
jli List item
jtable / jtable. / jtable# Complete table
jtr Table row

๐ŸŽ›๏ธ Interactive Components

Prefix Description
jtab Simple tab component
jtabs Dynamic tab system
jbtns3 Quick 3-button array
jdetails Details/summary element
jdialog Dialog modal
jprogress Progress bar
jmeter Meter element

๐Ÿ”„ Dynamic Patterns

Prefix Description
jif Conditional rendering
jmap Array mapping
jsub State subscription
jstate New local state
jservice Service injection

๐ŸŽจ Enhancement Patterns

Prefix Description
jenhan Basic DOM enhancement
jenhansel Enhancement with selectors
jenhanfn Enhancement with function

๐Ÿ“‹ Template Compilation

Prefix Description
jtemplate Template compilation structure

๐ŸŽจ Class & ID Shortcuts

Use the dot notation for className and hash notation for ID:

// Type: jdiv.container + Tab
{div: {
 className: 'container',
 children: []
}}//div.container
// Type: jbtn#submit + Tab 
{button: {
 id: 'submit',
 text: 'Submit',
 onClick: () => handleSubmit()
}}//button#submit

๐Ÿ’ก Real-World Examples

Authentication System

// Type: jlogin + Tab - Complete login form
// Type: jregister + Tab - Complete registration form 
// Type: jauth + Tab - Auth container with tab switching

Tab Component

// Type: jtab + Tab
export const SimpleTab = (props, { getState, setState }) => {
 return {
 div: {
 children: [
 // Tab buttons with state management
 // Dynamic content switching
 ]
 }//div
 };
};

Form with Validation

// Type: jform.contact + Tab
{form: {
 className: 'contact',
 onSubmit: (e) => {
 e.preventDefault();
 handleSubmit();
 },
 children: [
 // Form fields here
 ]
}}//form.contact

๐ŸŽฏ Best Practices

1. Use JSDoc Types

All component snippets include proper JSDoc annotations:

/**
 * @param {Object} props
 * @param {JurisContext} context
 * @returns {JurisVDOMElement}
 */

2. Leverage Class/ID Shortcuts

  • Use jdiv.container for quick className assignment
  • Use jbtn#submit for quick ID assignment
  • Combine with multi-line formatting for readability

3. Follow Closing Label Convention

All snippets include proper closing labels:

{div: {
 className: 'container',
 children: []
}}//div.container

4. State Management Patterns

// Use reactive properties for dynamic content
text: () => getState('message'),
className: () => getState('isActive') ? 'active' : 'inactive',
children: () => getState('items', []).map(item => /* ... */)

๐Ÿ”ง Configuration

VSCode Settings

Add to your VSCode settings for optimal experience:

{
 "editor.tabCompletion": "on",
 "editor.suggest.snippetsPreventQuickSuggestions": false,
 "editor.suggest.showSnippets": "top"
}

File Associations

For enhanced IntelliSense with .component.js files:

{
 "files.associations": {
 "*.component.js": "javascript"
 }
}

๐ŸŒŸ Advanced Usage

Custom Snippet Creation

Extend the snippet collection by adding your own patterns to the JSON file.

Team Sharing

Share the .vscode/snippets/javascript.json file in your project repository for team-wide consistency.

๐Ÿค Contributing

Found a bug or have a suggestion?

  1. Visit the [Juris GitHub repository](https://github.com/jurisjs/juris)
  2. Check the [snippet configuration](https://github.com/jurisjs/juris/tree/main/vscode/javascript.json)
  3. Submit an issue or pull request

๐Ÿ“š Resources

๐Ÿ“„ License

MIT License - see the [Juris repository](https://github.com/jurisjs/juris) for details.


Made with โค๏ธ for the Juris Framework community

Boost your productivity and build amazing Juris applications faster than ever!

Clone this wiki locally

AltStyle ใซใ‚ˆใฃใฆๅค‰ๆ›ใ•ใ‚ŒใŸใƒšใƒผใ‚ธ (->ใ‚ชใƒชใ‚ธใƒŠใƒซ) /