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

PaperComponent
Link copied to clipboard
js
fun PaperComponent()

Types

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

Functions

content
Link copied to clipboard
js
fun content(styling: Style<BoxParams> = {}, value: RenderContext.() -> Unit)
render
Link copied to clipboard
js
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

size
Link copied to clipboard
js
type
Link copied to clipboard
js