!> Text Frames requires an understanding of [Paragraphs](usage/paragraph.md).
> Text frames are paragraphs of text in a document which are positioned in a separate region or frame in the document, and can be positioned with a specific size and position relative to non-frame paragraphs in the current document.
A text frame is a paragraph with a position, written as `w:framePr`. It is not the text box Word makes when you insert one: Word draws that as a shape with text in it. Not every application positions text frames: Google Docs leaves them in line with the paragraphs around them, as wide as the column.
For a text box like Word's, use a [`ShapeRun`](usage/shapes.md#text-in-shapes) from `docx/shapes`, with paragraphs in `children` and [`floating`](usage/shapes.md#inline-and-floating) to position it:
```ts live
import { Document, HorizontalPositionRelativeFrom, Paragraph, VerticalPositionRelativeFrom } from "docx";
import { ShapeRun } from "docx/shapes";
const doc = new Document({
sections: [
{
children: [
new Paragraph({
children: [
new ShapeRun({
type: "rectangle",
transformation: { width: 200, height: 80 },
children: [new Paragraph("Hello from a text box!")],
import { Document, DropCapType, FrameAnchorType, Paragraph, TextRun } from "docx";
const doc = new Document({
sections: [
{
children: [
new Paragraph({
frame: {
type: "absolute",
position: { x: 0, y: 0 },
width: 1440,
height: 1440,
anchor: {
horizontal: FrameAnchorType.TEXT,
vertical: FrameAnchorType.TEXT,
},
dropCap: DropCapType.DROP,
lines: 3,
},
children: [new TextRun({ text: "O", size: 72 })],
}),
new Paragraph(
"nce upon a time, there was a paragraph that began with a large letter. The letter dropped down three lines into the text, and the rest of the paragraph flowed around it, the way the first page of a chapter in a book often begins.",