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):
| Property | Default |
|---|---|
color | '#000000' |
width | 2 |
opacity | 1 |
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):
| Property | Default |
|---|---|
type | 'none' |
color | '#000000' |
opacity | 1 |
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):
| Property | Default |
|---|---|
fontFamily | 'sans-serif' |
fontSize | 16 |
fontWeight | 'normal' |
fontStyle | 'normal' |
color | '#000000' |
textAlign | 'left' |