I have a pretty set way of doing it that I got from Microsoft's naming conventions starting with VB script in the early 90's when I did lots of drag/drop Windows app development very similar to Retool now. The IDE would do it for you with their standards.
Abbreviate the type to three letters (2 is ok, 4 if you must) all lower case and then camel case the rest.
Text components start with txt, so the name component is txtName. txtFirstName and txtLastName if applicable. Keep it descriptive.
-
tbl: Table
-
frm: Form
-
sel: Select
-
dt: Date
-
tm: Time
-
dt: DateTime
- etc. Just pick one and stick with it.
I do not distinguish between Text Input and Text Area and Editable Text as they are too similar to care.
I used to make all labels lblWhatever but as @DavidD pointed out, I have gotten lazy (or smart?) and don't bother naming static components I have no reason to interact with.
Now you may have more than one select in your app for say state - one for selecting your record's state field and one for selecting a filter for your table. I always add filter to the name of that is what is is used for: selFilterState while the other one would be just selState.
Or you may have one for editing your state and one for adding a new record: I would do selEditState and selNewState
These prefixes give me hints about which properties and methods are available to me when I am interacting with my components. I know that txtName is a text field and curPrice will have a decimal number, and I should look at the selectedItem
when using selProjectType rather than value
when I use txtProjectType
For my queries I use these prefixes and then describe what it does:
-
qry: SQL queries. I also add the table and action to the query name: qryCustomersSelect and qryCustomersBulkUpdate. If a query is a SQL JSON query that filters one of the others I append _filtered: qryCustomersSelect_filtered. sql seems like a better choice but I made my bed and am sleeping in it.
-
js: Javascript queries (jsExpandRowToggle)
-
rest: REST queries (restSTAddEvent)
-
tr: Tranformers (trDuration)
If a query if performing a specific function, like behaving as an event I prefix it with on what it is acting on and the action like onJobLinkClick.
I treat my Temp State vars like global variables and just give them a descriptive name. I should probably prefix them with ts or g or something to indicate their nature, but I have not so far.
I think that is a pretty thorough overview of my naming convention guidelines. It may be old school but seems appropriate to the platform.