PaperComponent

open class PaperComponent : Component<Unit>

This class combines the configuration and rendering of a PaperComponent.

A PaperComponent is simply an elevated card-like box with a solid background and corner radii / paddings that vary depending on the specified size of the component.

There are different types of paper:

  • normal (Types.NORMAL): Paper sheet appears card-like with a box-shadow.

  • outline (Types.OUTLINE): Paper sheet does not appear elevated but with an outline instead.

  • ghost (Types.GHOST): Paper sheet neither appears elevated nor outlined.

The content is specified via the content property. In addition to the atual content an optional styling parameter can be specified as well.

Usage example:

paper {
size { normal }
type { normal }
content {
span { +"This is paper." }
}
}

paper {
content({
// Custom styled content
}) {
span { +"This is paper." }
}
}

Constructors

Link copied to clipboard
fun PaperComponent()

Types

Link copied to clipboard
data class PaperContent(val styling: Style<BoxParams>, val value: RenderContext.() -> Unit)
Link copied to clipboard
enum Sizes : Enum<PaperComponent.Sizes>
Link copied to clipboard
object SizesContext
Link copied to clipboard
enum Types : Enum<PaperComponent.Types>
Link copied to clipboard
object TypesContext

Functions

Link copied to clipboard
fun content(styling: Style<BoxParams> = {}, value: RenderContext.() -> Unit)
Link copied to clipboard
open override fun render(    context: RenderContext,     styling: BoxParams.() -> Unit,     baseClass: StyleClass,     id: String?,     prefix: String)

Central method that should do the actual rendering of a component.

Properties

Link copied to clipboard
Link copied to clipboard