Package-level declarations

Types

Link copied to clipboard

A composable function that draws the gutter beside a BlockQuote.

Link copied to clipboard
data class CodeBlockStyle(val textStyle: TextStyle? = null, val modifier: Modifier? = null, val padding: TextUnit? = null, val wordWrap: Boolean? = null)

Defines how CodeBlocks are rendered.

Link copied to clipboard
typealias HeadingStyle = (level: Int, textStyle: TextStyle) -> TextStyle

Function that computes the TextStyle for the given header level, given the current TextStyle for this point in the composition. Note that the TextStyle passed into this function will be fully resolved. The returned style will then be merged with the passed-in text style, so any unspecified properties will be inherited.

Link copied to clipboard
data class InfoPanelStyle(val contentPadding: PaddingValues? = null, val background: @Composable (InfoPanelType) -> Modifier? = null, val textStyle: @Composable (InfoPanelType) -> TextStyle? = null)
Link copied to clipboard
Link copied to clipboard
data class ListStyle(val markerIndent: TextUnit? = null, val contentsIndent: TextUnit? = null, val itemSpacing: TextUnit? = null, val orderedMarkers: RichTextScope.() -> OrderedMarkers? = null, val unorderedMarkers: RichTextScope.() -> UnorderedMarkers? = null)

Defines how FormattedLists should look.

Link copied to clipboard
Link copied to clipboard
interface OrderedMarkers

Defines how to draw list markers for FormattedLists that are Ordered.

Link copied to clipboard

Scope object for composables that can draw rich text.

Link copied to clipboard
data class RichTextStyle(val paragraphSpacing: TextUnit? = null, val headingStyle: HeadingStyle? = null, val listStyle: ListStyle? = null, val blockQuoteGutter: BlockQuoteGutter? = null, val codeBlockStyle: CodeBlockStyle? = null, val tableStyle: TableStyle? = null, val infoPanelStyle: InfoPanelStyle? = null, val stringStyle: RichTextStringStyle? = null)

Configures all formatting attributes for drawing rich text.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class TableStyle(val headerTextStyle: TextStyle? = null, val cellPadding: TextUnit? = null, val borderColor: Color? = null, val borderStrokeWidth: Float? = null)

Defines the visual style for a Table.

Link copied to clipboard

Defines how to draw list markers for FormattedLists that are Unordered.

Functions

Link copied to clipboard
fun BasicRichText(modifier: Modifier = Modifier, style: RichTextStyle? = null, children: @Composable RichTextScope.() -> Unit)

Draws some rich text. Entry point to the compose-richtext library.

Link copied to clipboard

Draws a block quote, with a BlockQuoteGutter drawn beside the children on the start side.

Link copied to clipboard
fun RichTextScope.CodeBlock(wordWrap: Boolean? = null, children: @Composable RichTextScope.() -> Unit)
fun RichTextScope.CodeBlock(text: String, wordWrap: Boolean? = null)

A specially-formatted block of text that typically uses a monospace font with a tinted background.

Link copied to clipboard

Contextually disables scrollbar for Desktop CodeBlocks under content tree.

Link copied to clipboard
inline fun RichTextScope.FormattedList(listType: ListType, vararg children: @Composable RichTextScope.() -> Unit)
fun <T> RichTextScope.FormattedList(listType: ListType, items: List<T>, startIndex: Int = 0, drawItem: @Composable RichTextScope.(T) -> Unit)

Creates a formatted list such as a bullet list or numbered list.

Link copied to clipboard

A section heading.

Link copied to clipboard

A simple horizontal line drawn with the current content color.

Link copied to clipboard
fun RichTextScope.InfoPanel(infoPanelType: InfoPanelType, content: @Composable () -> Unit)

A panel to show content similar to Bootstrap alerts, categorized as InfoPanelType.

A panel to show content similar to Bootstrap alerts, categorized as InfoPanelType. This composable is a shortcut to show only text in an info panel.

Link copied to clipboard
Link copied to clipboard

Creates an UnorderedMarkers that will cycle through the values in painters for each indentation level.

Link copied to clipboard
fun RichTextThemeProvider(textStyleProvider: @Composable () -> TextStyle? = null, textStyleBackProvider: @Composable (TextStyle, @Composable () -> Unit) -> Unit? = null, contentColorProvider: @Composable () -> Color? = null, contentColorBackProvider: @Composable (Color, @Composable () -> Unit) -> Unit? = null, content: @Composable () -> Unit)

Entry point for integrating app's own typography and theme system with RichText.

Link copied to clipboard
fun RichTextScope.Table(modifier: Modifier = Modifier, headerRow: RichTextTableCellScope.() -> Unit? = null, bodyRows: RichTextTableRowScope.() -> Unit)

Draws a table with an optional header row, and an arbitrary number of body rows.

Link copied to clipboard
fun RichTextScope.textOrderedMarkers(vararg markers: (index: Int) -> String): OrderedMarkers

Creates an OrderedMarkers that will cycle through the values in markers for each indentation level given the index.

Link copied to clipboard

Creates an UnorderedMarkers that will cycle through the values in markers for each indentation level.

Link copied to clipboard

Properties