The Sun Shard (Japanese: たいようのかけらSun Fragment) and Moon Shard (Japanese: つきのかけらMoon Fragment) are special Key Items present in Pokémon XD. Their only use is to evolve Eevee into Espeon or Umbreon, respectively, as the usual necessary evolution method was not possible to achieve in XD.
In Gateon Port's Machine Parts Shop, a man will give the player a choice between five items: the Fire Stone, the Water Stone, the Thunderstone, the Sun Shard, and the Moon Shard. This is essentially where the player decides what they will evolve their Eevee into.
The Sun Shard and Moon Shard passively apply while in the player's Bag. If the player's Eevee levels up and has high enough friendship, it will evolve after the battle (or immediately if it leveled up using a Rare Candy) into Espeon (if the Sun Shard is in the Bag) or Umbreon (if the Moon Shard is in the Bag).
These items were included in XD due to Eevee's (then) unique method of evolution: leveling up when at a sufficient friendship level at a specific time of day. While Eevee can become an Espeon or Umbreon in other games through use of the realtime clock, this was not possible in XD. This game, like Pokémon Colosseum, was not programmed to use the GameCube's clock, meaning that time-based events cannot occur in this game. As the developers wanted players to have Espeon and Umbreon available as choices at the same time as the other Eeveelutions, these items were made available to the player as a choice at the same time as the Fire Stone, Water Stone, and Thunderstone, which allow the player to evolve Eevee into its Generation I evolutions.
An odd shard that makes Eevee evolve into Umbreon.
Though Pokémon Colosseum has the same lack of connection with the GameCube's clock as XD, the Sun and Moon Shards do not exist in that game. This is likely due to the fact that the player starts the game with an already evolved pair of Espeon and Umbreon, as well as Eevee's complete absence from said game.