Crystal Shards are a placeable crafting material which may be naturally found in the Underground Hallow on Pearlstone or Pink Ice Blocks, requiring a Pickaxe or a Drill to harvest. They come in several different shapes and colors before they've been harvested. After being harvested, however, their inventory image is always that of a purple crystal. Placing Crystal Shards will result in randomly-colored versions, in a manner similar to the randomized graphics created when placing Books and Coral.
Crystal shards give off a very small amount of light and brightens occasionally, which makes them somewhat easier to find. The light it emits depends on the color of the crystal. Crystal shards also regenerate after a short period of time, hence one can easily make a farm with a long bridge of pearlstone blocks.

Bugs

Crystal shards can spawn on halfblocks.

On the Mobile devices and 3DS you can get Crystal Shards by killing a Demon or a Arch Demon, NOT always, but sometimes, in the underworld Pre-Hardmode