You may be interested in my Chat UI, it’s similar to what you want with books but is in the chat area instead.
As a quick experiment I rendered the UI inside a book. Some of the code for rendering in chat can be generalised to render in other places. Maybe I could provide utilities for drawing in books too.