* Adding textbox with no props * Fixing namings and adding shape style * simplify usage * Fix linting issues * Re-name demo * Use new shape authoring style * Add tests Simplify API * Add better types for styles * Add more options to TextBox and add documentation --------- Co-authored-by: zohar11 <zohar@sumit-ai.com> Co-authored-by: Dolan <dolan_miu@hotmail.com>
27 lines
735 B
Markdown
27 lines
735 B
Markdown
# Text Box
|
|
|
|
Similar `Text Frames`, but the difference being that it is `VML` `Shape` based.
|
|
|
|
!> `Text Boxes` requires an understanding of [Paragraphs](usage/paragraph.md).
|
|
|
|
> `Text boxes` 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.
|
|
|
|
## Intro
|
|
|
|
To make a `Text Box`, simply create a `Textbox` object inside the `Document`:
|
|
|
|
```ts
|
|
new Textbox({
|
|
alignment: "center",
|
|
children: [
|
|
new Paragraph({
|
|
children: [new TextRun("Hi i'm a textbox!")],
|
|
}),
|
|
],
|
|
style: {
|
|
width: "200pt",
|
|
height: "auto",
|
|
},
|
|
});
|
|
```
|