getInitials
getInitials(
name):string
Defined in: packages/ui/src/components/avatar-with-initials.tsx:17
Extracts up to two uppercase initials from a full name.
Splits the name on spaces and takes the first character of each part.
Parameters
Section titled “Parameters”string
The full name to extract initials from.
Returns
Section titled “Returns”string
A string of 1-2 uppercase characters (e.g. "DS" for "Daniel Schmidt").
Example
Section titled “Example”getInitials("Daniel Schmidt"); // "DS"getInitials("Alice"); // "A"