Sunan is the shorter version of "Susuhunan", both used as an honorific in Java Indonesia.
According to Hamka in his book Dari Perbendaharaan Lama the word derived from a Javanese word for position (susunan) of hands in reverential salutation, done with hands pressed together, palms touching and fingers pointed upwards, and bowing. This arrangement which has some similarities with Indian "namaste" is called "sembah", which is used to honor and praise. From this "Susuhunan" can mean someone to give the "susunan"/"sembah" to a revered person. Another word for "Susuhunan" is "Sesembahan".
This title is given by the Javanese and Sundanese to rulers, clerics and even deities. A common usage is for the 'Sunans', or the Nine Saints (Wali Songo), who were the spreaders of Islam in Java. Also, Sunan Ambu (Queen Mother/Goddess Mother) is a female deity revered by the Sundanese.