DefaultHorizontalAlignStyle
See source codeDefault horizontal alignment style property used by tldraw shapes for text positioning. Controls how text content is horizontally aligned within shape boundaries.
Available values: - start - Align text to the start (left in LTR, right in RTL) - middle - Center text horizontally - end - Align text to the end (right in LTR, left in RTL) - start-legacy - Legacy start alignment (deprecated) - end-legacy - Legacy end alignment (deprecated) - middle-legacy - Legacy middle alignment (deprecated)
DefaultHorizontalAlignStyle: import('./StyleProp').EnumStyleProp<
'end-legacy' | 'end' | 'middle-legacy' | 'middle' | 'start-legacy' | 'start'
>Example
import { DefaultHorizontalAlignStyle } from '@tldraw/tlschema'
// Use in shape props definition
interface MyTextShapeProps {
align: typeof DefaultHorizontalAlignStyle
// other props...
}
// Create a shape with center-aligned text
const textShape = {
// ... other properties
props: {
align: 'middle' as const,
// ... other props
},
}Prev
DefaultFontStyleNext
DefaultLabelColorStyle