michaelharley.net sysop: michael · est. 2012

michaelharley.net sysop: michael · est. 2012

▓ POWER APPS · DOXIPEDIA

Naming Conventions

There are only two hard things in Computer Science: cache invalidation and naming things.— Phil Karlton

The single source of truth for how things are named in this template — controls, containers, components, variables, and design tokens. If a naming question comes up while you’re building, this doc answers it. Read it once before your first build, then reference it any time two things of the same kind are named differently in a way that isn’t intentional.

Scope: in-app naming (Power Apps objects and Power Fx variables). SharePoint-side naming — list columns, the Name/Email person pairing, IsDeleted — lives in STANDARDS.md, not here.

The control naming pattern

Every control on a screen is named:

Pattern

<type>_<Name>_<Screen>

Anatomy

btntype
_
FiltersActiveResetrole name
_
Galleryscreen

Examples from the template

lbl_AppName_Loadingtmr_LoadingDelay_Loadingbtn_FiltersActiveReset_Galleryico_FiltersActive_Gallery

Inside a component, the suffix is the component

Controls inside a component are scoped to the component instead of a screen. For field components the <Component> suffix is the field type (Field<Type>).

htmtype
_
Labelrole name
_
FieldTextcomponent

The full field-component naming table lives in the field-styleguide.md; this doc governs the control-type prefixes it draws from.

Control-type prefix registry

The authoritative list. Every prefix here is one actually in use in the template source. When you add a control, use the matching prefix; if a control type isn’t listed, add a row here in the same PR so the next dev inherits the decision.

lbl_Label / text display (ModernText, classic Label)
htm_HtmlViewer
btn_Button
txt_Text input (ModernTextInput, single or multi-line)
num_Number input
dte_Date picker
cmb_Combobox / dropdown
rdo_Radio group
img_Image
ico_Icon
avt_Avatar / persona
lnk_Hyperlink
spn_Spinner / loading indicator
att_Attachments control
tmr_Timer
gal_Gallery
tab_Tab list
col_Gallery / data-table column
con_Layout container (see below)
shp_Shape (rectangle, divider, line)
cmp_Component instance (see below)

Containers and shapes

con_ names a layout region by its role: con_Screen_ItemForm (the root), con_Body_ItemForm, con_Toolbar_Gallery; inside a component, con_Wrapper_FieldText. Insert containers from the Studio toolbar as “Vertical container” or “Horizontal container” (the orientation-named items), not “GroupContainer” or “AutoLayout.” shp_ covers rectangles used as dividers and rules, e.g. shp_RowDivider_FieldText.

con_<Region>_<Screen>shp_<Name>_<Screen>

Components

A component definition is cmp_<Name> (cmp_Header, cmp_FieldText, cmp_ConfirmDialog). A placed instance keeps the same cmp_ name; on a form, field instances are named for their role: cmp_Title_ItemForm, cmp_Status_ItemForm.

Variable and token prefixes

fx_

Named App formula / design token (App.Formulas) — fx_Colors, fx_Spacing, fx_BlankProject

ctx_

Context (screen-scoped) variable — ctx_SelectedItem, ctx_FormMode

gbl_

Global variable — gbl_CurrentUser

ds_

Data source reference — ds_Projects

Casing rules

Known inconsistencies (grandfathered)

The template has a little legacy drift. New work follows the canonical choice; existing stragglers are flagged for cleanup, not left as precedent.

icn_ico_ is canonical

A few older controls use icn_ (icn_Avatar_Picker, icn_EmptyState_Picker in cmp_PersonPickerModal). Rename them to ico_ in Studio when that component is next touched — do the rename in Studio, not by editing .fx.yaml, so the capture stays clean.

dp_dte_ for date input

Earlier docs showed a dp_Input_FieldDate example; the source uses dte_. dte_ is canonical.

When to update this doc

Update this styleguide whenever:

Related: field-styleguide.md (field-component naming), STANDARDS.md (SharePoint-side naming), CLAUDE.md and the docs README (both point here for naming).