added documentation and a closeComponent option