Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>ui5-snippetsNew to Visual Studio Code? Get it now.
ui5-snippets

ui5-snippets

UI5 Snippets

|
31 installs
| (0) | Free
Useful SAPUI5 snippets for JavaScript and XML development in Visual Studio Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

SAPUI5 VS Code Snippets Reference

Custom SAPUI5 snippets for JavaScript and XML files in VS Code.

Type the prefix and press Tab to expand. All prefixes follow a flat lowercase naming convention grouped by category: ctrl, fmt, model, imp, frag, view, table, ns, wizard, form.


JavaScript — Controllers

Prefix Description
ctrlbasic Controller with auto namespace and name
ctrlformatter Controller with formatter import
ctrlobject Generic object controller with route binding and loadObject pattern
ctrlbase BaseController with router, i18n helpers, navigation and MessageToast
routematch Attach route matched handler and read route arguments
loadfragment Lazy-load and cache fragment dialog with async open
onbeforerender onBeforeRendering lifecycle hook
onafterrender onAfterRendering lifecycle hook

JavaScript — Model Helpers

Prefix Description
modelgetview Get model from view
modelgetowner Get model from owner component
modeljsoninit Create and set a JSONModel on the view
modelrefresh Refresh a model with optional force update
modelsaferead Safely read model data with null checks and fallback values
busyasync Wrap async logic with view busy state and try/catch/finally
asynctoast Reusable async wrapper with optional success/error toasts

JavaScript — Formatters

Prefix Description
fmtfile Formatter file template
fmtdate Date formatter using Intl.DateTimeFormat
fmtdatetime Date-time formatter using Intl.DateTimeFormat
fmtcurrency Formatter for amount and currency code
fmtnumber Formatter for locale-aware decimal numbers
fmtstatusstate Map status text to UI5 ValueState string
fmtboolean Format boolean to display text
fmtfallback Return fallback text for empty values

JavaScript — Imports

Prefix Description
impcontroller Single-line import for sap/ui/core/mvc/Controller
impformatter Single-line import for a formatter module
impjsonmodel Single-line import for sap/ui/model/json/JSONModel
impfilteroperator Single-line import for sap/ui/model/Filter + sap/ui/model/FilterOperator
impfragment Single-line import for sap/ui/core/Fragment
impmessagetoast Single-line import for sap/m/MessageToast
showtoast Show a MessageToast notification
filtercontains Apply contains filter from SearchField event
navtoroute Navigate to a route with parameters

XML — Views

Prefix Description
viewsmart XML View with auto controller name
viewobjectpage Generic ObjectPage view template

XML — Fragments

Prefix Description
fragbasic Empty Fragment definition
fragdialog Dialog Fragment with configurable id, type, state, title and button
dialogconfirm Confirmation dialog fragment template

XML — Tables

Prefix Description
tablebasic Table with toolbar, search field and column template
tablecurrency ObjectNumber with currency type binding
tablestatus ObjectStatus with formatter-based text and state
tablegrowing Table with growing and infinite scroll pattern
tablegrowadv Advanced growing table with search, noDataText and busyIndicatorDelay

XML — UI Controls

Prefix Description
toolbarsearch Toolbar with Title, Spacer and SearchField
searchfield SearchField with liveChange and search handlers
msgstrip MessageStrip with type, icon and close option
objectstatus ObjectStatus with formatter-based text and state
listbasic Basic list with StandardListItem binding
nodataillu IllustratedMessage empty-state block
selectbind Select with bound items and selectedKey
controllername controllerName attribute for XML view

XML — Formatter Bindings

Prefix Description
fmtbind Full formatter binding for any UI5 control
fmtquick Inline quick formatter binding string

XML — Forms

Prefix Description
formsimple SimpleForm inside a WizardStep
formgrid ResponsiveGridLayout SimpleForm template

XML — Wizard

Prefix Description
wizardstep Single WizardStep
wizardview Generic Wizard XML View with one step and footer buttons

XML — Namespaces

Prefix Description
nsm xmlns="sap.m"
nsmvc xmlns:mvc="sap.ui.core.mvc"
nscore xmlns:core="sap.ui.core"
nsf xmlns:f="sap.f"
nsform xmlns:form="sap.ui.layout.form"
nsunified xmlns:u="sap.ui.unified"
nssemantic xmlns:semantic="sap.f.semantic"
nsall All common namespaces + controllerName in one block
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft