My App
BoardKitCore

Styles

Style types for strokes, shapes, fills, and text

StrokeStyle

Used by StrokeElement and ConnectorElement for line rendering.

interface StrokeStyle {
    color: string;
    width: number;
    opacity: number;
    lineCap: 'round' | 'butt' | 'square';
    lineJoin: 'round' | 'bevel' | 'miter';
}

Default values (from DEFAULT_STROKE_STYLE):

PropertyDefault
color'#000000'
width2
opacity1
lineCap'round'
lineJoin'round'

FillStyle

Used within ShapeStyle for shape fill rendering.

interface FillStyle {
    type: 'solid' | 'none';
    color: string;
    opacity: number;
}

Default values (from DEFAULT_FILL_STYLE):

PropertyDefault
type'none'
color'#000000'
opacity1

ShapeStyle

Combined stroke and fill for shapes.

interface ShapeStyle {
    stroke: StrokeStyle;
    fill: FillStyle;
}

TextStyle

Used by TextElement and StickyNoteElement.

interface TextStyle {
    fontFamily: string;
    fontSize: number;
    fontWeight: 'normal' | 'bold';
    fontStyle: 'normal' | 'italic';
    color: string;
    textAlign: 'left' | 'center' | 'right';
}

Default values (from DEFAULT_TEXT_STYLE):

PropertyDefault
fontFamily'sans-serif'
fontSize16
fontWeight'normal'
fontStyle'normal'
color'#000000'
textAlign'left'

On this page