Skip to main content

Components

The koestlich components make the primitives from which more complex layout structures can be composed. All components share the default flexbox properties and event handlers. In addition, all components have properties for their individual functionality.

Shared Properties

All properties are optional. The defaults are set in the yoga flexbox implementation.

PropertyType
indexnumber
idnumber
classesArray\<Properties>
insetnumber, Percentage
paddingnumber, Percentage
paddingXnumber, Percentage
paddingYnumber, Percentage
marginnumber, Percentage, "auto"
marginXnumber, Percentage, "auto"
marginYnumber, Percentage, "auto"
marginTopnumber, Percentage, "auto"
marginLeftnumber, Percentage, "auto"
marginRightnumber, Percentage, "auto"
marginBottomnumber, Percentage, "auto"
translateXnumber
translateYnumber
translateZnumber
scaleXnumber
scaleYnumber
scaleZnumber
positionType"absolute", "relative", "count"
positionTopnumber, Percentage
positionLeftnumber, Percentage
positionRightnumber, Percentage
positionBottomnumber, Percentage
alignContent"count", "space-around", "space-between", "baseline", "stretch", "flex-end", "center", "flex-start", "auto"
alignItems"count", "space-around", "space-between", "baseline", "stretch", "flex-end", "center", "flex-start", "auto"
alignSelf"count", "space-around", "space-between", "baseline", "stretch", "flex-end", "center", "flex-start", "auto"
flexDirection"count", "row-reverse", "row", "column-reverse", "column"
flexWrap"count", "wrap-reverse", "wrap", "no-wrap"
justifyContent"count", "space-around", "space-between", "flex-end", "center", "flex-start", "space-evenly"
flexBasisnumber, Percentage
flexGrownumber
flexShrinknumber
widthnumber, Percentage, "auto"
heightnumber, Percentage, "auto"
minWidthnumber, Percentage
minHeightnumber, Percentage
maxWidthnumber, Percentage
maxHeightnumber, Percentage
aspectRationumber
borderTopnumber
borderLeftnumber
borderRightnumber
borderBottomnumber
overflow"visible", "count", "scroll", "hidden"
paddingTopnumber, Percentage
paddingLeftnumber, Percentage
paddingRightnumber, Percentage
paddingBottomnumber, Percentage

Event Properties

PropertyType
onWheel(event: ThreeEvent\<WheelEvent>) => void
onPointerUp(event: ThreeEvent\<PointerEvent>) => void
onPointerOver(event: ThreeEvent\<PointerEvent>) => void
onPointerOut(event: ThreeEvent\<PointerEvent>) => void
onPointerMove(event: ThreeEvent\<PointerEvent>) => void
onPointerLeave(event: ThreeEvent\<PointerEvent>) => void
onPointerEnter(event: ThreeEvent\<PointerEvent>) => void
onPointerDown(event: ThreeEvent\<PointerEvent>) => void
onPointerCancel(event: ThreeEvent\<PointerEvent>) => void
onDoubleClick(event: ThreeEvent\<MouseEvent>) => void
onContextMenu(event: ThreeEvent\<MouseEvent>) => void
onClick(event: ThreeEvent\<MouseEvent>) => void

Root Properties

PropertyType
precisionnumber
loadYogafunction to load yoga
anchorX"left" , "center" , "right"
anchorY"top", "center", "bottom"
sizeXnumber - size of the container in three.js units
sizeYnumber - size of the container in three.js units
pixelSizenumber - size of one pixel in relation to three.js units
dragThresholdnumber - defines the threshold that differentiates a scroll from a click
positionVector3
rotationEuler

Object

Renders any Three.js 3d Mesh.

ParameterDescription
objectThe Three.js mesh to be rendered.
depthThe depth property sets the size of the 3d Object along the z-Axis. Negative values are not possible. If no depth value is provided for a 3D model, the depth will be set according to the original width/depth ratio.

Container

The container renders a 2D plane with a special shader for borderRadius, borderSize, and borderColor in the background. The Image and Text component can also render a 2D plane with the same properties in the background.

PropertyType
borderRadiusTopLeftnumber
borderRadiusTopRightnumber
borderRadiusBottomRightnumber
borderRadiusBottomLeftnumber
borderOpacitynumber
borderColorColorRepresentation
backgroundColorColorRepresentation
backgroundOpacitynumber
borderRadiusnumber
borderRadiusLeftnumber
borderRadiusRightnumber
borderRadiusTopnumber
borderRadiusBottomnumber
bordernumber
borderXnumber
borderYnumber
borderBendnumber
materialMaterial class

Image

The image renders a 2D plane with an image. The image also has the properties of the container to render a background.

ParameterDescription
urlThe url to the image.
fitThe values can be "cover", "contain", or "fill". The fit property will only be effective if the element has a aspect ratio that differs from the image source aspect ratio. To force an image to a specific size that violate the aspect ratio of the image source, use the "maxWidth", "minWidth", "maxHeight", and "minHeight" properties.

Text

Renders a string or array of strings into individual glyphs based on a multi-channel signed distance function. The text requires the provision of a FontFamilyProvider. The text also has the properties of the container to render a background.

ParameterDescription
fontFamilyThe name of the font family specified in the FontFamilyProvider. If none is provided, the default fontFamily from the font family provider is used
fontSizeThe maximum height of the rendered glyphs. The default is 0.1.
letterSpacingThe additional spacing between the letters/glyphs. The default is 0.
lineHeightMultiplierThe multiplier of the line height. Influences the spacing between lines. The default is 1.2.
wrapperThe wrapping behavior for the text layouting. Values can be "breakall", "nowrap", "breakword", or a custom glyph wrapper. The default is "breakword".
horizontalAlignThe horizontal alignment of the text. Values can be "left", "center", "right", or "block". The default is "left".
verticalAlignThe vertical alignment of the text. Values can be "top", "center", or "bottom".

GLTF

The GLTF component renders a .gltf file into the 3D layout. All children are placed in front of the 3D model.

ParameterDescription
urlThe url to the gltf.
depthThe depth property sets the size of the 3d Object along the z-Axis. Negative values are not possible. If no depth value is provided for a 3D model, the depth will be set according to the original width/depth ratio.

SVG

The SVG component renders a .svg file into the 3D layout.

ParameterDescription
urlThe URL to the svg file.
depthThe size of the rendered SVG in the z-Axis (yes SVGs are 3D Models). Negative values are not possible. A flat SVG can be rendered via depth={0}.

Box

The Box component renders a simple 3D box into the layout.

ParameterDescription
depthThe size of the box along the z-Axis. Negative values are not possible.