Package-level declarations

The reader UI: the all-in-one EpubReader and its EpubReaderState, plus the building blocks (EpubContent, TableOfContents, CoverImage, MetadataCard) and the LinkClick model for handling link taps.

Types

Link copied to clipboard

State holder for EpubReader. Wraps the core Navigator and exposes its current position as snapshot state so Compose recomposes on chapter changes.

Link copied to clipboard
class LinkClick

The result of a user clicking an <a> tag inside a chapter rendered by EpubContent.

Functions

Link copied to clipboard
fun CoverImage(book: Book, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit)

Renders book's cover image, if it has one. Renders nothing if the book has no cover.

Link copied to clipboard
fun EpubContent(book: Book, resource: Resource, modifier: Modifier = Modifier, backgroundColor: Color = MaterialTheme.colorScheme.surface, textColor: Color = MaterialTheme.colorScheme.onSurface, fragmentId: String? = null, onLinkClicked: (LinkClick) -> Unit? = null)

Renders a single XHTML resource from book in a platform WebView.

Link copied to clipboard
fun EpubReader(book: Book, modifier: Modifier = Modifier, state: EpubReaderState = rememberEpubReaderState(book))

Batteries-included EPUB reader. Wires the TOC, prev/next controls, and the EpubContent WebView surface around a Navigator. Use the building-block composables (EpubContent, TableOfContents, CoverImage, MetadataCard) if you want to compose your own layout.

Link copied to clipboard
fun MetadataCard(book: Book, modifier: Modifier = Modifier)

Shows a Material 3 card with the book's cover, title, and authors.

Link copied to clipboard

Remembers a EpubReaderState tied to book. A new state is created when book changes.

Link copied to clipboard
fun TableOfContents(book: Book, onSelect: (TOCReference) -> Unit, modifier: Modifier = Modifier)

Renders book's table of contents as a nested Material 3 list. Tapping an entry invokes onSelect.