DefaultFontStyle
See source codeDefault font style property used by tldraw shapes for text styling. Controls which typeface is used for text content within shapes.
Available values:
draw
- Hand-drawn, sketchy font stylesans
- Clean sans-serif fontserif
- Traditional serif fontmono
- Monospace font for code-like text
DefaultFontStyle: import('./StyleProp').EnumStyleProp<
'draw' | 'mono' | 'sans' | 'serif'
>
Example
import { DefaultFontStyle } from '@tldraw/tlschema'
// Use in shape props definition
interface MyTextShapeProps {
font: typeof DefaultFontStyle
// other props...
}
// Create a text shape with monospace font
const textShape = {
// ... other properties
props: {
font: 'mono' as const,
// ... other props
},
}
Prev
DefaultFontFamiliesNext
DefaultHorizontalAlignStyle