DefaultFontStyle

See source code

Default 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 style
  • sans - Clean sans-serif font
  • serif - Traditional serif font
  • mono - 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
DefaultFontFamilies
Next
DefaultHorizontalAlignStyle