DefaultTextAlignStyle
Default text alignment style property used by tldraw text shapes. Controls how text content is aligned within text-based shapes like text boxes and notes.
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)
DefaultTextAlignStyle: import("./StyleProp").EnumStyleProp<
"end" | "middle" | "start"
>;Example
import { DefaultTextAlignStyle } from "@tldraw/tlschema";
// Use in text shape props definition
interface MyTextShapeProps {
textAlign: typeof DefaultTextAlignStyle;
// other props...
}
// Create a text shape with center alignment
const textShape = {
// ... other properties
props: {
textAlign: "middle" as const,
// ... other props
},
};Prev
DefaultSizeStyleNext
DefaultVerticalAlignStyle