"String concatenation in the type layer. Combined with mapped types, it builds key transformations."
Template literal types
Template literal types use the same backtick syntax as runtime template literals, but they operate on string-literal types. `Hello, ${string}` is a type that matches any string starting with 'Hello, '. `${'a' | 'b'}-${1 | 2}` is the union of 'a-1' | 'a-2' | 'b-1' | 'b-2'.
This is type-level string manipulation. The compiler can concatenate, pattern-match, and union string literals at the type level — and combined with key remapping in mapped types, you can transform property names systematically.
Built-in string utility types
TypeScript ships four built-ins for case manipulation:
Uppercase<S>Lowercase<S>Capitalize<S>— uppercase first letterUncapitalize<S>— lowercase first letter
Combined with template literals, these let you build types like 'event handler names': `on${Capitalize<EventName>}` — from a union of event names like 'click' | 'hover', you get 'onClick' | 'onHover'.
Where template literal types win
The classic use is library APIs that derive method names from data shapes. React's useState setter is one: from a hook named useUser, the setter is conventionally setUser. Template literal types let library authors express this as a type — and the compiler verifies the convention is followed.
on${Capitalize<...>} in a library's types, it's building event-handler names from event types — and the compiler is checking your code uses the right names.