In the context of cancer, melanonychia can be a sign of melanoma, a serious form of skin cancer that can occur under the nails. This type of melanoma is known as subungual melanoma and typically presents as a dark stripe running vertically along the nail. Although less common than other forms of melanoma, it is crucial to identify and treat it early to prevent metastasis.