Skip to main content
Home Theme VS Code Noir VS Code Theme 🕵🏻 Noir is like a mysterious night in an old film noir, with its dark, monochromatic tones setting the stage for thrilling code adventures. It's the perfect theme to turn your coding sessions into suspenseful detective stories!
Noir VS Code Theme | Coding Theme
VS Code preview Full workbench mockup using this variant's colors and tokenColors.
colors Workbench UI color keys from the theme JSON colors map.
activityBar.background #ffffff activityBar.foreground #000000 activityBar.inactiveForeground #00000066 activityBarBadge.background #000000 activityBarBadge.foreground #ffffff badge.background #4d4d4d tokenColors TextMate scopes and font styles (syntax highlighting rules).
scope foreground fontStyle punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison #d5d5d5 — variable.other.generic-type.haskell #b4b4b4 — storage.type.haskell #bcbcbc — support.variable.magic.python
Shiki preview TypeScript sample highlighted with this variant's colors and tokenColors.
Noir VS Code Theme — Noir Dark
badge.foreground
#ffffff
breadcrumb.activeSelectionForeground #e0e0e0
breadcrumb.background #1e1e1e
breadcrumb.focusForeground #e0e0e0
breadcrumb.foreground #cccccccc
button.background #646464
button.foreground #ffffff
button.hoverBackground #bcbcbc
button.secondaryBackground #474747
button.secondaryForeground #ffffff
button.secondaryHoverBackground #4f4f4f
checkbox.background #3c3c3c
checkbox.border #00000000
checkbox.foreground #cccccc
debugExceptionWidget.background #333333
debugExceptionWidget.border #474747
debugToolBar.background #333333
debugToolBar.border #474747
diffEditor.border #444444
diffEditor.insertedTextBackground #ebffbb33
diffEditor.removedTextBackground #ff9a9a33
dropdown.background #3c3c3c
dropdown.border #00000000
dropdown.foreground #cccccc
editor.background #191919
editor.findMatchBackground #414141
editor.findMatchBorder #a3a3a3
editor.findMatchHighlightBackground #99999955
editor.findMatchHighlightBorder #ffffff00
editor.findRangeHighlightBackground #3a3d4166
editor.findRangeHighlightBorder #ffffff00
editor.foldBackground #6b6b6b4d
editor.foreground #ffffff
editor.hoverHighlightBackground #264f7840
editor.inactiveSelectionBackground #3a3d41
editor.lineHighlightBackground #ffffff0A
editor.lineHighlightBorder #282828
editor.rangeHighlightBackground #ffffff0b
editor.rangeHighlightBorder #ffffff00
editor.selectionBackground #3b3b3b
editor.selectionHighlightBackground #add6ff26
editor.selectionHighlightBorder #717171
editor.wordHighlightBackground #575757b8
editor.wordHighlightStrongBackground #737373b8
editorBracketMatch.background #0064001a
editorBracketMatch.border #888888
editorCodeLens.foreground #999999
editorCursor.background #000000
editorCursor.foreground #aeafad
editorError.background #B73A3400
editorError.border #ffffff00
editorError.foreground #ff7458
editorGroup.border #444444
editorGroup.emptyBackground #191919
editorGroupHeader.tabsBackground #252526
editorGutter.addedBackground #587c0c
editorGutter.background #1e1e1e
editorGutter.commentRangeForeground #c5c5c5
editorGutter.deletedBackground #94151b
editorGutter.foldingControlForeground #c5c5c5
editorGutter.modifiedBackground #1188a9
editorHoverWidget.background #252526
editorHoverWidget.border #454545
editorHoverWidget.foreground #cccccc
editorIndentGuide.activeBackground #707070
editorIndentGuide.background #404040
editorInfo.background #4490BF00
editorInfo.border #4490BF00
editorInfo.foreground #75beff
editorLineNumber.activeForeground #c6c6c6
editorLineNumber.foreground #858585
editorLink.activeForeground #ffffff
editorMarkerNavigation.background #2d2d30
editorMarkerNavigationError.background #ff6243
editorMarkerNavigationInfo.background #6fbbff
editorMarkerNavigationWarning.background #ffe261
editorOverviewRuler.background #3d3d3d00
editorOverviewRuler.border #7f7f7f4d
editorRuler.foreground #5a5a5a
editorSuggestWidget.background #252526
editorSuggestWidget.border #454545
editorSuggestWidget.foreground #d4d4d4
editorSuggestWidget.highlightForeground #ffffff
editorSuggestWidget.selectedBackground #494949
editorWarning.background #A9904000
editorWarning.border #ffffff00
editorWarning.foreground #ffe56d
editorWhitespace.foreground #e3e4e229
editorWidget.background #252526
editorWidget.foreground #cccccc
editorWidget.resizeBorder #5F5F5F
focusBorder #ffffff
foreground #cccccc
gitDecoration.addedResourceForeground #6bcf7e
gitDecoration.conflictingResourceForeground #e49bff
gitDecoration.deletedResourceForeground #ff654a
gitDecoration.ignoredResourceForeground #8c8c8c
gitDecoration.modifiedResourceForeground #c1afff
gitDecoration.stageDeletedResourceForeground #ff5335
gitDecoration.stageModifiedResourceForeground #c1afff
gitDecoration.submoduleResourceForeground #a0d1ff
gitDecoration.untrackedResourceForeground #91ffb7
icon.foreground #cccccc
input.background #3c3c3c
input.border #00000000
input.foreground #cccccc
input.placeholderForeground #a6a6a6
inputOption.activeBackground #c2c2c266
inputOption.activeBorder #007acc00
inputOption.activeForeground #ffffff
list.activeSelectionBackground #5e5e5e
list.activeSelectionForeground #ffffff
list.dropBackground #454545
list.errorForeground #ff4545
list.focusBackground #414141
list.focusForeground #cccccc
list.highlightForeground #ffffff
list.hoverBackground #2a2d2e
list.hoverForeground #cccccc
list.inactiveSelectionBackground #37373d
list.inactiveSelectionForeground #cccccc
list.warningForeground #ffd95d
listFilterWidget.background #626262
listFilterWidget.noMatchesOutline #b2b2b2
listFilterWidget.outline #00000000
menu.background #252526
menu.border #00000085
menu.foreground #cccccc
menu.selectionBackground #6d6d6d
menu.selectionBorder #00000000
menu.selectionForeground #ffffff
menu.separatorBackground #bbbbbb
menubar.selectionBackground #ffffff1a
menubar.selectionForeground #cccccc
merge.commonContentBackground #282828
merge.commonHeaderBackground #383838
merge.currentContentBackground #27403B
merge.currentHeaderBackground #3b8c7b
merge.incomingContentBackground #28384B
merge.incomingHeaderBackground #4376b6
minimap.background #191919
minimap.errorHighlight #ff7458
minimap.findMatchHighlight #414141
minimap.selectionHighlight #3b3b3b
minimap.warningHighlight #ffe56d
minimapGutter.addedBackground #587c0c
minimapGutter.deletedBackground #94151b
minimapGutter.modifiedBackground #1188a9
notificationCenter.border #474747
notificationCenterHeader.background #303031
notificationCenterHeader.foreground #cccccc
notifications.background #252526
notifications.border #303031
notifications.foreground #cccccc
notificationsErrorIcon.foreground #f48771
notificationsInfoIcon.foreground #75beff
notificationsWarningIcon.foreground #cca700
notificationToast.border #474747
panel.background #1e1e1e
panel.border #80808059
panelSection.border #80808059
panelTitle.activeBorder #e7e7e7
panelTitle.activeForeground #e7e7e7
panelTitle.inactiveForeground #e7e7e799
peekView.border #ffffff
peekViewEditor.background #2a2a2a
peekViewEditor.matchHighlightBackground #60606099
peekViewEditor.matchHighlightBorder #ffffff
peekViewEditorGutter.background #1f1f1f
peekViewResult.background #252526
peekViewResult.fileForeground #ffffff
peekViewResult.lineForeground #bbbbbb
peekViewResult.matchHighlightBackground #8686864d
peekViewResult.selectionBackground #ffffff33
peekViewResult.selectionForeground #ffffff
peekViewTitle.background #1e1e1e
peekViewTitleDescription.foreground #ccccccb3
peekViewTitleLabel.foreground #ffffff
pickerGroup.border #3f3f46
pickerGroup.foreground #9d9d9d
progressBar.background #ffffff
scrollbar.shadow #000000
scrollbarSlider.activeBackground #bfbfbf66
scrollbarSlider.background #79797966
scrollbarSlider.hoverBackground #646464b3
selection.background #585858
settings.focusedRowBackground #ffffff07
settings.headerForeground #cccccc
sideBar.background #323232
sideBar.dropBackground #454545
sideBar.foreground #cccccc
sideBarSectionHeader.background #00000000
sideBarSectionHeader.border #cccccc33
sideBarSectionHeader.foreground #cccccc
sideBarTitle.foreground #bbbbbb
statusBar.background #ffffff
statusBar.debuggingBackground #494949
statusBar.debuggingForeground #ffffff
statusBar.foreground #000000
statusBar.noFolderBackground #7d7d7d
statusBar.noFolderForeground #ffffff
statusBarItem.activeBackground #FFFFFF25
statusBarItem.hoverBackground #ffffff1f
statusBarItem.remoteBackground #454545
statusBarItem.remoteForeground #ffffff
tab.activeBackground #1e1e1e
tab.activeBorder #00000000
tab.activeBorderTop #00000000
tab.activeForeground #ffffff
tab.border #252526
tab.inactiveBackground #2d2d2d
tab.inactiveForeground #ffffff80
terminal.ansiBlack #585858
terminal.ansiBlue #3896ff
terminal.ansiBrightBlack #666666
terminal.ansiBrightBlue #58a7ff
terminal.ansiBrightCyan #30d6ff
terminal.ansiBrightGreen #44ffb4
terminal.ansiBrightMagenta #ff87ff
terminal.ansiBrightRed #ff6262
terminal.ansiBrightWhite #e5e5e5
terminal.ansiBrightYellow #ffffaa
terminal.ansiCyan #15d1ff
terminal.ansiGreen #0fffa3
terminal.ansiMagenta #ff58ff
terminal.ansiRed #ff4444
terminal.ansiWhite #e5e5e5
terminal.ansiYellow #ffff11
terminal.border #80808059
terminal.foreground #cccccc
terminal.selectionBackground #ffffff40
terminalCursor.background #6f6f6f
terminalCursor.foreground #ffffff
textLink.foreground #ffffff
titleBar.activeBackground #ffffff
titleBar.activeForeground #000000
titleBar.border #00000000
titleBar.inactiveBackground #ffffffcd
titleBar.inactiveForeground #a1a1a1
tree.indentGuidesStroke #585858
walkThrough.embeddedEditorBackground #00000050
widget.shadow #0000005c #d5d5d5
punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python #ffffff —
variable.parameter.function.language.special.self.python #ffffff —
storage.modifier.lifetime.rust #ffffff —
support.function.std.rust #9b9b9b —
entity.name.lifetime.rust #ffffff —
variable.language.rust #d5d5d5 —
support.constant.edge #b4b4b4 —
constant.other.character-class.regexp #d5d5d5 —
keyword.operator.quantifier.regexp #bcbcbc —
punctuation.definition.string.begin,punctuation.definition.string.end #9f9f9f —
variable.parameter.function #ffffff —
comment markup.link #606060 —
markup.changed.diff #ffffff —
meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff #9b9b9b —
markup.inserted.diff #9f9f9f —
markup.deleted.diff #d5d5d5 —
meta.function.c,meta.function.cpp #d5d5d5 —
punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.terminator.statement.c,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c #ffffff —
punctuation.separator.key-value #ffffff —
keyword.operator.expression.import #9b9b9b —
support.constant.math #ffffff —
support.constant.property.math #bcbcbc —
variable.other.constant #ffffff —
storage.type.annotation.java, storage.type.object.array.java #ffffff —
punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.terminator.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java #ffffff —
storage.modifier.import.java,storage.type.java,storage.type.generic.java #ffffff —
keyword.operator.instanceof.java #b4b4b4 —
meta.definition.variable.name.java #d5d5d5 —
keyword.operator.logical #717171 —
keyword.operator.bitwise #717171 —
keyword.operator.channel #717171 —
support.constant.property-value.scss,support.constant.property-value.css #bcbcbc —
keyword.operator.css,keyword.operator.scss,keyword.operator.less #717171 —
support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss #bcbcbc —
punctuation.separator.list.comma.css #ffffff —
support.constant.color.w3c-standard-color-name.css #bcbcbc —
support.type.vendored.property-name.css #717171 —
support.module.node,support.type.object.module,support.module.node #ffffff —
entity.name.type.module #ffffff —
variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node #d5d5d5 —
support.constant.json #bcbcbc —
keyword.operator.expression.instanceof, keyword.operator.new, keyword.operator.ternary, keyword.operator.optional, keyword.operator.expression.keyof #b4b4b4 —
support.type.object.console #d5d5d5 —
support.variable.property.process #bcbcbc —
entity.name.function,support.function.console #9b9b9b —
keyword.operator.misc.rust #ffffff —
keyword.operator.sigil.rust #b4b4b4 —
keyword.operator.delete #b4b4b4 —
support.type.object.dom #717171 —
support.variable.dom,support.variable.property.dom #d5d5d5 —
keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational #717171 —
keyword.operator.assignment.c,keyword.operator.comparison.c,keyword.operator.c,keyword.operator.increment.c,keyword.operator.decrement.c,keyword.operator.bitwise.shift.c,keyword.operator.assignment.cpp,keyword.operator.comparison.cpp,keyword.operator.cpp,keyword.operator.increment.cpp,keyword.operator.decrement.cpp,keyword.operator.bitwise.shift.cpp #b4b4b4 —
punctuation.separator.delimiter #ffffff —
punctuation.separator.c,punctuation.separator.cpp #b4b4b4 —
support.type.posix-reserved.c,support.type.posix-reserved.cpp #717171 —
keyword.operator.sizeof.c,keyword.operator.sizeof.cpp #b4b4b4 —
variable.parameter.function.language.python #bcbcbc —
support.type.python #717171 —
keyword.operator.logical.python #b4b4b4 —
variable.parameter.function.python #bcbcbc —
punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python #ffffff —
meta.function-call.generic.python #9b9b9b —
constant.character.format.placeholder.other.python #bcbcbc —
keyword.operator.assignment.compound #b4b4b4 —
keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts #717171 —
entity.name.namespace #ffffff —
variable.language #ffffff —
token.variable.parameter.java #ffffff —
import.storage.java #ffffff —
token.package.keyword #b4b4b4 —
entity.name.function, meta.require, support.function.any-method, variable.function #9b9b9b —
entity.name.type.namespace #ffffff —
support.class, entity.name.type.class #ffffff —
entity.name.class.identifier.namespace.type #ffffff —
entity.name.class, variable.other.class.js, variable.other.class.ts #ffffff —
variable.other.class.php #d5d5d5 —
control.elements, keyword.operator.less #bcbcbc —
keyword.other.special-method #9b9b9b —
keyword.operator.expression.delete,keyword.operator.expression.in,keyword.operator.expression.of,keyword.operator.expression.instanceof,keyword.operator.new,keyword.operator.expression.typeof,keyword.operator.expression.void #b4b4b4 —
token.storage.type.java #ffffff —
support.type.property-name #ffffff —
support.constant.property-value #ffffff —
support.constant.font-name #bcbcbc —
entity.other.inherited-class #ffffff —
constant.other.symbol #717171 —
punctuation.definition.constant #bcbcbc —
entity.other.attribute-name #bcbcbc —
entity.other.attribute-name.id #9b9b9b normal
entity.other.attribute-name.class.css #bcbcbc normal
markup.heading punctuation.definition.heading, entity.name.section #9b9b9b —
keyword.other.unit #d5d5d5 —
markup.bold,todo.bold #bcbcbc —
punctuation.definition.bold #ffffff —
markup.italic, punctuation.definition.italic,todo.emphasis #b4b4b4 —
entity.name.section.markdown #d5d5d5 —
punctuation.definition.heading.markdown #d5d5d5 —
punctuation.definition.list.begin.markdown #d5d5d5 —
markup.heading.setext #ffffff —
punctuation.definition.bold.markdown #bcbcbc —
markup.inline.raw.markdown #9f9f9f —
markup.inline.raw.string.markdown #9f9f9f —
punctuation.definition.list.markdown #d5d5d5 —
punctuation.definition.string.begin.markdown, punctuation.definition.string.end.markdown, punctuation.definition.metadata.markdown #d5d5d5 —
beginning.punctuation.definition.list.markdown #d5d5d5 —
punctuation.definition.metadata.markdown #d5d5d5 —
markup.underline.link.markdown,markup.underline.link.image.markdown #b4b4b4 —
string.other.link.title.markdown,string.other.link.description.markdown #9b9b9b —
constant.character.escape #717171 —
punctuation.section.embedded, variable.interpolation #d5d5d5 —
punctuation.section.embedded.begin,punctuation.section.embedded.end #b4b4b4 —
invalid.illegal.bad-ampersand.html #ffffff —
invalid.deprecated #ffffff —
invalid.unimplemented #ffffff —
source.json meta.structure.dictionary.json > string.quoted.json #d5d5d5 —
source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string #d5d5d5 —
source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation #9f9f9f —
source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json #717171 —
support.type.property-name.json #d5d5d5 —
support.type.property-name.json punctuation #d5d5d5 —
text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade #b4b4b4 —
text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade #b4b4b4 —
support.other.namespace.use.php,support.other.namespace.use-as.php,support.other.namespace.php,entity.other.alias.php,meta.interface.php #ffffff —
keyword.operator.error-control.php #b4b4b4 —
keyword.operator.type.php #b4b4b4 —
punctuation.section.array.begin.php #ffffff —
punctuation.section.array.end.php #ffffff —
invalid.illegal.non-null-typehinted.php #f44747 —
storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php #ffffff —
meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php #9b9b9b —
punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.terminator.expression.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php #ffffff —
support.constant.core.rust #bcbcbc —
support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php #bcbcbc —
entity.name.goto-label.php,support.other.php #9b9b9b —
keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php #717171 —
keyword.operator.regexp.php #b4b4b4 —
keyword.operator.comparison.php #717171 —
keyword.operator.heredoc.php,keyword.operator.nowdoc.php #b4b4b4 —
meta.function.decorator.python #9b9b9b —
support.token.decorator.python,meta.function.decorator.identifier.python #717171 —
function.parameter #ffffff —
function.parameter.ruby, function.parameter.cs #ffffff —
constant.language.symbol.ruby #717171 —
inline-color-decoration rgb-value #bcbcbc —
support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx #ffffff —
block.scope.end,block.scope.begin #ffffff —
entity.name.variable.local.cs #d5d5d5 —
token.error-token #f44747 —
token.debug-token #b4b4b4 —
punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end, punctuation.section.embedded #b4b4b4 —
meta.template.expression #ffffff —
keyword.operator.module #b4b4b4 —
support.type.type.flowtype #9b9b9b —
support.type.primitive #ffffff —
meta.property.object #d5d5d5 —
variable.parameter.function.js #d5d5d5 —
keyword.other.template.begin #9f9f9f —
keyword.other.template.end #9f9f9f —
keyword.other.substitution.begin #9f9f9f —
keyword.other.substitution.end #9f9f9f —
keyword.operator.assignment #717171 —
keyword.operator.assignment.go #ffffff —
keyword.operator.arithmetic.go, keyword.operator.address.go #b4b4b4 —
entity.name.package.go #ffffff —
support.type.prelude.elm #717171 —
support.constant.elm #bcbcbc —
punctuation.quasi.element #b4b4b4 —
constant.character.entity #d5d5d5 —
entity.other.attribute-name.pseudo-element, entity.other.attribute-name.pseudo-class #717171 —
entity.global.clojure #ffffff —
meta.symbol.clojure #d5d5d5 —
constant.keyword.clojure #717171 —
meta.arguments.coffee, variable.parameter.function.coffee #d5d5d5 —
meta.scope.prerequisites.makefile #d5d5d5 —
storage.modifier.import.groovy #ffffff —
meta.method.groovy #9b9b9b —
meta.definition.variable.name.groovy #d5d5d5 —
meta.definition.class.inherited.classes.groovy #9f9f9f —
support.variable.semantic.hlsl #ffffff —
support.type.texture.hlsl, support.type.sampler.hlsl, support.type.object.hlsl, support.type.object.rw.hlsl, support.type.fx.hlsl, support.type.object.hlsl #b4b4b4 —
text.variable, text.bracketed #d5d5d5 —
support.type.swift, support.type.vb.asp #ffffff —
entity.name.function.xi #ffffff —
entity.name.class.xi #717171 —
constant.character.character-class.regexp.xi #d5d5d5 —
constant.regexp.xi #b4b4b4 —
keyword.control.xi #717171 —
beginning.punctuation.definition.quote.markdown.xi #9f9f9f —
beginning.punctuation.definition.list.markdown.xi #606060 —
constant.character.xi #9b9b9b —
constant.other.color.rgb-value.xi #ffffff —
punctuation.definition.tag.xi #606060 —
entity.name.label.cs, entity.name.scope-resolution.function.call, entity.name.scope-resolution.function.definition #ffffff —
entity.name.label.cs, markup.heading.setext.1.markdown, markup.heading.setext.2.markdown #d5d5d5 —
meta.brace.square #ffffff —
comment, punctuation.definition.comment #606060 italic
markup.quote.markdown #606060 —
punctuation.definition.block.sequence.item.yaml #ffffff —
constant.language.symbol.elixir #717171 —
entity.other.attribute-name.js,entity.other.attribute-name.ts,entity.other.attribute-name.jsx,entity.other.attribute-name.tsx,variable.parameter,variable.language.super — italic
comment.line.double-slash,comment.block.documentation — italic
keyword.control.import.python,keyword.control.flow.python — italic
markup.italic.markdown — italic
export interface User {
id : string;
name : string;
role : "admin" | "member" ;
tags : string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser ( id : string): Promise<User | null> {
if ( ! id ) {
return null ;
}
const response = await fetch ( `/api/users/ ${ id } ` , {
method : "GET" ,
headers : { Accept : "application/json" },
});
if ( ! response . ok ) {
throw new Error ( `HTTP ${ response . status } ` );
}
return ( await response . json ()) as User;
}
function greet ( user : User): string {
// Simple greeting function that uses the user's name
return `Hello, ${ user . name } !` ;
}
fetchUser.ts
index.ts
README.md
src
components
fetchUser.ts
src
components
fetchUser.ts
fetchUser 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Problems1
Output
Debug Console
Terminal
Ports
~/my-project $ pnpm dev
▲ Next.js ready on http://localhost:3000
✓ compiled client and server successfully in 412ms
wait - compiling /theme/vscode...
main*
Button.tsx
31
~/my-project
$
export interface User {
id : string;
name : string;
role : "admin" | "member" ;
tags : string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser ( id : string): Promise<User | null> {
if ( ! id ) {
return null ;
}
const response = await fetch ( `/api/users/ ${ id } ` , {
method : "GET" ,
headers : { Accept : "application/json" },
});
if ( ! response . ok ) {
throw new Error ( `HTTP ${ response . status } ` );
}
return ( await response . json ()) as User;
}
function greet ( user : User): string {
// Simple greeting function that uses the user's name
return `Hello, ${ user . name } !` ;
}