Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>N LanguageNew to Visual Studio Code? Get it now.
N Language

N Language

iamristaf

|
23 installs
| (0) | Free
N Language — Build complete HTML+CSS+JS websites with a single .n file. Syntax highlighting, live preview, compiler, 60+ snippets.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

N Language — VS Code Extension v2.6.0

Build complete HTML + CSS + JS websites with a single .n file.

N Language is a frontend DSL that compiles to production-ready HTML. Write clean, readable syntax once — get a full website out.


Quick Start

  1. Install the extension from the VS Code Marketplace
  2. Create a new file: Ctrl+Shift+N → N Language: New .n File
  3. Write your page using N Language syntax
  4. Press Ctrl+Shift+P to open live preview
  5. Press Ctrl+Shift+B to compile to HTML

Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+P Live Preview
Ctrl+Shift+B Compile to HTML
Ctrl+Shift+R Export HTML File

N Language Syntax

Every .n file is made of blocks (block-name { ... }) containing properties (name = "value").

Basic Page Structure

head {
  title = "My Website"
  description = "Built with N Language"
  author = "Your Name"
}

links {
  font = "Inter"
}

style {
  theme = black
}

body {
  heading = "Welcome!"
  paragraph = "N Language makes web development simple."
}

Blocks Reference

head {} — Page Metadata

head {
  title = "Page Title"
  description = "SEO description"
  keywords = "keyword1, keyword2"
  author = "Name"
  theme-color = "#6d28d9"
  lang = "en"
}

vars {} — CSS Variables

vars {
  --primary: #6d28d9
  --secondary: #8b5cf6
  --bg: #0f0f0f
  --text: #f5f5f5
  --spacing: 1.5rem
}

Use them anywhere: color = "var(--primary)"

links {} — External Resources

links {
  font = "Inter"          // Google Font
  tailwind = true         // Tailwind CSS CDN
  bootstrap = true        // Bootstrap CSS+JS CDN
  fontawesome = true      // Font Awesome icons
  animate = true          // Animate.css
  icon = "favicon.ico"   // Favicon
  css = "custom.css"     // Custom CSS file
  js = "app.js"          // Custom JS file
}

style {} — Global CSS / Themes

style {
  theme = black   // Apply a built-in theme
}

Available themes: black, white, purple, blue, green, red, orange, pink

Each theme sets CSS variables: --bg, --text, --primary, --accent, --border, etc.

body {} — Page Content

This is where elements live. See the Elements section below.

scripts {} — JavaScript Logic

scripts {
  state = "count = 0"
  when = "click #btn => count++; console.log(count)"
  after = "document.title = 'Loaded!'"
  fetch = "https://api.example.com/data => myData"
  repeat = "1000 => updateClock()"
  log = "Page initialized"
  emit = "app:ready {detail: 'OK'}"
}

Elements

Text Elements

heading = "Main Title"
heading.font-size = "2.5rem"
heading.color = "var(--primary)"
heading.font-weight = "800"

h1 = "H1 Heading"
h2 = "H2 Heading"
h3 = "H3 Heading"

paragraph = "Body text goes here."
paragraph.line-height = "1.6"
paragraph.color = "var(--text-secondary)"

Buttons

button = "Click Me"
button.background-color = "var(--primary)"
button.color = "white"
button.padding = "0.75rem 1.5rem"
button.border-radius = "var(--radius)"
button.border = "none"
button.cursor = "pointer"

// With click handler
button.onclick = "alert('Hello!')"
button.onclick-href = "/about"
button.onclick-toggle = "sidebar"
button.onclick-show = "modal"
button.onclick-hide = "overlay"
button.onclick-scroll = "section-id"

Links

link = "Visit Site"
link.href = "https://nlang.in"
link.target = "_blank"
link.color = "var(--primary)"

Images

image {
  src = "https://example.com/photo.jpg"
  alt = "Description"
  width = "100%"
  border-radius = "var(--radius)"
  loading = "lazy"
}

Input Fields

input {
  type = "email"
  placeholder = "Enter email..."
  name = "email"
  required = true
  padding = "0.75rem 1rem"
  border = "1px solid var(--border)"
  border-radius = "var(--radius)"
  background-color = "var(--bg-secondary)"
  color = "var(--text)"
  width = "100%"
}

Select Dropdown

select {
  name = "country"
  options = "USA, UK, Canada, Australia"
  padding = "0.75rem"
  width = "100%"
}

// With labels (value:label)
select {
  name = "plan"
  options = "free:Free Plan, pro:Pro Plan, ent:Enterprise"
}

Containers and Layouts

// Flexbox center
container {
  display = "flex-center"
  gap = "1rem"
}

// CSS Grid
grid {
  display = "grid-3"
  gap = "2rem"
  max-width = "1200px"
  margin = "0 auto"
}

// Auto-fit grid (responsive)
grid {
  display = "grid-auto"
  gap = "1.5rem"
}

Multi-Property Chains

Set multiple CSS properties on one element in a single line:

heading.color.font-size.font-weight = "var(--primary), 2rem, 700"
paragraph.margin.padding.line-height = "1rem, 0.5rem, 1.6"

Each comma-separated value maps to the corresponding property. Values with commas inside parentheses are handled correctly:

// These work correctly — commas inside () are preserved
button.background-color = "rgba(109,40,217,0.9)"
heading.font-size = "clamp(1.5rem,4vw,3rem)"

CSS Shorthands

Use shorthand keywords as values for instant styling:

Shorthand Expands To
flex-center display:flex; align-items:center; justify-content:center
flex-col display:flex; flex-direction:column
flex-between display:flex; justify-content:space-between
grid-2 display:grid; grid-template-columns:repeat(2,1fr)
grid-3 display:grid; grid-template-columns:repeat(3,1fr)
grid-4 display:grid; grid-template-columns:repeat(4,1fr)
grid-auto Responsive auto-fit grid
glass Glassmorphism effect
card-shadow Soft card box shadow
shadow-lg Large box shadow
rounded border-radius:0.375rem
rounded-full border-radius:9999px
transition-all transition:all 0.3s ease
gradient-purple Purple gradient background
gradient-blue Blue gradient background
truncate Single-line text truncation
flex-center Centered flex container
sticky-top Sticky positioned top
container-center Centered max-width container
w-full width:100%
h-full height:100%
min-h-screen min-height:100vh

Hover / Focus States

button.hover.background-color = "#5b21b6"
button.hover.transform = "translateY(-2px)"
input.focus.border-color = "var(--primary)"
input.focus.outline = "none"

Scripts Logic Engine

State Management

scripts {
  state = "isOpen = false, count = 0, user = null"
}

Event Handling

scripts {
  when = "click #submit-btn => validateForm()"
  when = "submit #contact-form => e.preventDefault(); sendEmail()"
  when = "change #theme-select => applyTheme(this.value)"
}

Data Fetching

scripts {
  fetch = "https://jsonplaceholder.typicode.com/posts => posts"
  after = "renderPosts(posts)"
}

Timers

scripts {
  repeat = "1000 => updateTimer()"
  after = "startApp()"
}

Complete Example

head {
  title = "My Portfolio"
  description = "Developer portfolio built with N Language"
}

links {
  font = "Inter"
  fontawesome = true
}

style {
  theme = black
}

// Navigation
nav {
  display = "flex-between"
  padding = "1.5rem 2rem"
  background-color = "var(--bg-secondary)"
  position = "sticky"
  top = "0"
  z-index = "100"
}

// Hero section
hero {
  min-height = "100vh"
  display = "flex-center"
  flex-direction = "column"
  text-align = "center"
  padding = "4rem 2rem"
}

heading = "Hi, I'm a Developer"
heading.font-size = "clamp(2rem,5vw,4rem)"
heading.font-weight = "800"
heading.color = "var(--text)"

paragraph = "I build beautiful web experiences."
paragraph.font-size = "1.25rem"
paragraph.color = "var(--text-secondary)"
paragraph.margin-top = "1rem"

button = "View My Work"
button.background-color = "var(--primary)"
button.color = "white"
button.padding = "0.875rem 2rem"
button.border-radius = "var(--radius)"
button.border = "none"
button.cursor = "pointer"
button.margin-top = "2rem"
button.font-size = "1rem"
button.onclick-scroll = "projects"

// Projects section
section {
  id = "projects"
  padding = "5rem 2rem"
}

h2 = "Projects"
h2.text-align = "center"
h2.margin-bottom = "3rem"

grid {
  display = "grid-3"
  gap = "2rem"
  max-width = "1200px"
  margin = "0 auto"
}

// Interactive counter
scripts {
  state = "count = 0"
  when = "click #counter-btn => count++; document.getElementById('count-display').textContent = count"
}

button = "Count: 0"
button.id = "counter-btn"
button.background-color = "var(--primary)"
button.color = "white"
button.padding = "0.75rem 1.5rem"
button.border-radius = "var(--radius)"
button.border = "none"
button.cursor = "pointer"

span = "0"
span.id = "count-display"

Settings

Configure N Language in VS Code settings:

Setting Default Description
nlang.autoPreview true Auto-update preview on save
nlang.outputDir "dist" Compiled HTML output directory
nlang.openBrowserOnCompile false Open in browser after compile

Snippets

Type these prefixes for quick templates:

Prefix Description
npage New page scaffold
npage-theme Page with full theme setup
nhead Head metadata block
nvars CSS variables block
ntheme Apply a theme
nlinks External resources block
nh Heading element
np Paragraph element
nbtn Button element
nlink Link element
nimg Image element
ninput Input field
ntextarea Textarea
nselect Select dropdown
nform Form element
ncontainer Container element
nhero Hero section
nnav Navigation bar
nfooter Footer
ncard Card element
ngrid Grid layout
nflex Flex layout
nscripts Scripts block
nstate State variable
nwhen Event listener
nafter DOM ready handler
nfetch Data fetch
nrepeat Interval timer
nlog Console log
nhover Hover state styles
nmodal Modal dialog
ncounter Interactive counter
ntoast Toast notification
ntestimonial Testimonial card
npricing Pricing card
nfeatures Features grid section
ncta Call to action section
nportfolio Full portfolio template
nprogress Progress bar
nbadge Badge/tag element
nalert Alert box
nspinner Loading spinner

Website & Documentation

nlang.in


License

MIT © iamristaf

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