> For the complete documentation index, see [llms.txt](https://cardstock-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cardstock-studio.gitbook.io/docs/design/templates-design-your-cards/components/fit-layer-to-text.md).

# Fit Layer to Text

Can be added to a [Text Layer](/docs/design/templates-design-your-cards/layers/text-layer.md), and <mark style="color:$success;">**Fit Layer to Text**</mark> will set the Text layer Transform to grow or shrink to fit the text, based on the pivot position of the layer. You can choose to allow the area to grow wider, taller, or both.

For example, if you want text to only grow the content down, with the top lines staying where they are, set the pivot to the top, and choose "Taller".

<figure><img src="https://2449056524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK6BdQXak9wiY4BdSf9Rq%2Fuploads%2FiwtfSYMJos8zKEKqWtgf%2FScreen%20Recording%202026-05-20%20at%2010.43.26%E2%80%AFPM.gif?alt=media&amp;token=c7d63273-4770-4bcc-8b0f-f89eb2f62698" alt=""><figcaption><p>This is combined with <strong>Content Size Fitter</strong> to keep the background growing too.</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cardstock-studio.gitbook.io/docs/design/templates-design-your-cards/components/fit-layer-to-text.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
