allows users to implement their own preview