For a user-defined type T, the rich rendering in the notebook and JupyterLab can be enabled by by implementing the function xeus::xjson mime_bundle_repr(const T& im), which returns the JSON mime bundle for that type.