string-manipulation

Uncapitalize<S>

Intrinsic type utility that lowercases the first character of literal S, leaving the rest unchanged. The inverse of Capitalize and widely used for PascalCase-to-camelCase mappings.

type Uncapitalize<S extends string> = intrinsic

Usage patterns

Pattern Purpose
Uncapitalize<'Foo'> Basic first-letter lowercase
`on${Capitalize<E>}` Event handler naming pattern (paired inverse of Uncapitalize)
Uncapitalize<K & string> Narrow keyof T to string before transform
Uncapitalize<Capitalize<S>> Normalize to a guaranteed leading-lowercase form

Examples

type U = Uncapitalize<'Foo'>;

Result: 'foo'

type CamelKeys<T> = { [K in keyof T as Uncapitalize<K & string>]: T[K] };

Rewrites PascalCase keys to camelCase

type Events = 'Click' | 'Focus';
type E = Uncapitalize<Events>;

Result: 'click' | 'focus'

type S = Uncapitalize<string>;

Result: string when input is not a literal

Gotcha

Only mutates the first character — subsequent characters remain untouched, so ALLCAPS becomes aLLCAPS not allcaps. Non-literal inputs widen to `string`.

Related utility types

← All TS utility types · TypeScript vs JavaScript · any vs unknown vs never