/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
docs/pages/ui/components/autosize.mdx
28 строк
1 KB
Paweł Kuna
Improve docs SEO, performance and content quality (#2841)
11 авг 2026, 15:45
Не верифицирован
11 авг 2026, 15:45
39634cb
Код
Авторство
О чём код?
--- title: Autosize summary: The autosize element will automatically adjust the textarea height and make it easier for users to follow as they type. docs-libs: [autosize] description: Make textareas grow automatically as users type with the autosize plugin, so longer text stays visible without manual resizing. related: [/ui/forms/form-elements] layout: '@layouts/DocsMdxLayout.astro' --- import Example from '@components/Example.astro'; import CodeDocs from '@components/CodeDocs.astro'; To be able to use the autosize in your application you will need to install the autosize dependency with `npm install autosize`. ## Default markup Add the autosize element to your input to make it automatically adjust to the length of a text as a user types it. To create autosize textarea, add the `data-bs-toggle="autosize"` attribute to the textarea element: <Example column vertical> <label class="form-label">Autosize example</label> <textarea class="form-control" data-bs-toggle="autosize" placeholder="Type something…"></textarea> </Example> ## JavaScript Tabler automatically initializes all elements with `data-bs-toggle="autosize"` on page load. This is the code that runs: <CodeDocs name="autosize-init" file="core/js/src/autosize.ts" />