I wanted to put the CR10S filament sensor on top of my enclosure that I build myself. I could not find anything suitable so I remixed the design https://www.thingiverse.com/thing:2875859 to a simple but yet very effectief top filament sensor holder.
You simple remove the sensor PCB out of the standard CR10S filament holder by removing the 3 screws in it
Then you reuse these screws to screw together the new one
Drill a hole of 10mm diameter in the top plate, and press the sensor holder in it from the top
From the bottom you can press the grommet in it (this avoids pieces of wood dust contaminating the inside of the enclosure)