TLDefaultTextAlignStyle

See source code

Type representing a default text alignment style value. This is a union type of all available text alignment options.

type TLDefaultTextAlignStyle = T.TypeOf<typeof DefaultTextAlignStyle>;

Example

import { TLDefaultTextAlignStyle } from "@tldraw/tlschema";

// Valid text alignment values
const leftAlign: TLDefaultTextAlignStyle = "start";
const centerAlign: TLDefaultTextAlignStyle = "middle";
const rightAlign: TLDefaultTextAlignStyle = "end";

// Use in a function parameter
function setTextAlignment(align: TLDefaultTextAlignStyle) {
  // Apply text alignment to text shape
}
Prev
TLDefaultSizeStyle
Next
TLDefaultVerticalAlignStyle