Fireworks are a nonessential gadget that can be used for cinematic effect or general entertainment. They can be crafted with one Explosive Powder or found underground on dead astroneers. When interacted with, It'll launch itself into the air and explode, creating a large ball of a random color after the player activates them. This does not affect the world or player in any way.
Fireworks can be placed on the ground and activated from there. It is also possible to launch fireworks from moving vehicles - this could be used for entertainment, races, celebrations, and even as a beacon to help players locate their friends (for actual beacons, see here). To launch a firework from a moving vehicle, place the firework in a vehicle storage slot and press Z (on keyboard) or X (on controller).