{"slug":"textarea","name":"Textarea","category":"Form & Input","summary":"A multi-line text field with an optional count and error state.","status":"stable","since":"0.1.0","import":"import { Textarea } from '@elluzion/iv-ui';","usage":["Bind `value` for two-way state; `oninput` receives the native event.","`showCount` needs `maxlength` and renders the used and total characters.","`resizable` controls which axes the user may drag."],"props":[{"name":"value","type":"string","default":"''","description":"Current value. Bind with `bind:value`.","required":false,"bindable":true},{"name":"placeholder","type":"string","default":"''","description":"Placeholder shown while the field is empty.","required":false,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Disables interaction and applies the disabled treatment.","required":false,"bindable":false},{"name":"readonly","type":"boolean","default":"false","description":"Prevents editing while keeping the value focusable and readable.","required":false,"bindable":false},{"name":"required","type":"boolean","default":"false","description":"Marks the field as required.","required":false,"bindable":false},{"name":"name","type":"string","default":"''","description":"Form field name submitted with the surrounding form.","required":false,"bindable":false},{"name":"id","type":"string","default":"''","description":"Element id. A generated id is used when omitted.","required":false,"bindable":false},{"name":"rows","type":"number","default":"4","description":"Visible number of text lines.","required":false,"bindable":false},{"name":"maxlength","type":"number","default":null,"description":"Maximum number of characters.","required":false,"bindable":false},{"name":"label","type":"string","default":"''","description":"Visible label for the control.","required":false,"bindable":false},{"name":"error","type":"string","default":"''","description":"Error message. Switches the control to the error treatment.","required":false,"bindable":false},{"name":"helper","type":"string","default":"''","description":"Helper text shown below the control.","required":false,"bindable":false},{"name":"resizable","type":"'none' | 'vertical' | 'horizontal' | 'both'","default":"'vertical'","description":"Which axes the user may resize.","required":false,"bindable":false},{"name":"showCount","type":"boolean","default":"false","description":"Shows the character count when `maxlength` is set.","required":false,"bindable":false}],"events":[{"name":"input","type":"(e: Event) => void","default":null,"description":"Called on every keystroke with the native event.","required":false,"bindable":false},{"name":"change","type":"(e: Event) => void","default":null,"description":"Called when the value changes; the new value is in `event.detail`.","required":false,"bindable":false},{"name":"focus","type":"(e: FocusEvent) => void","default":null,"description":"Called when the control receives focus.","required":false,"bindable":false},{"name":"blur","type":"(e: FocusEvent) => void","default":null,"description":"Called when the control loses focus.","required":false,"bindable":false},{"name":"keydown","type":"(e: KeyboardEvent) => void","default":null,"description":"Called on keydown with the native keyboard event.","required":false,"bindable":false}],"snippets":[],"types":[],"manual":[],"tokens":["--iv_border","--iv_border-focus","--iv_border-hover","--iv_control-pad-x","--iv_control-pad-y","--iv_cursor","--iv_disabled-opacity","--iv_ease-in-out","--iv_error","--iv_error-surface","--iv_font-mono","--iv_font-ui","--iv_foreground","--iv_foreground-dim","--iv_leading-base","--iv_radius-sm","--iv_ring","--iv_ring-width","--iv_spacing-2xs","--iv_spacing-sm","--iv_surface-raised","--iv_text-base","--iv_text-label","--iv_text-sm","--iv_text-xs","--iv_transition-base"],"cssHooks":["iv-char-count","iv-disabled","iv-error-message","iv-footer-row","iv-has-error","iv-helper-message","iv-label","iv-message","iv-over-limit","iv-required-mark","iv-textarea-container","iv-textarea-wrapper"],"accessibility":{"keyboard":[["Tab","Moves focus into the textarea."],["Enter","Inserts a new line."]],"notes":["The label is associated with the textarea through a generated id, or pass `id`.","Error text is linked through `aria-describedby`; the control gets `aria-invalid`.","The character count is part of the described-by content when `showCount` is on."]},"related":[{"title":"Input","summary":"A single-line text field with an optional label, helper, and error state.","url":"/components/input","kind":"Component"},{"title":"Field","summary":"Labels a custom control and renders its helper or error message.","url":"/components/field","kind":"Component"},{"title":"NativeSelect","summary":"A native select element with the library field treatment.","url":"/components/native-select","kind":"Component"},{"title":"Article","summary":"A readable page body with an optional title and standfirst.","url":"/components/article","kind":"Component"}],"examples":[{"id":"basic","title":"Basic","description":"A labelled textarea with helper text.","code":"<script lang=\"ts\">\n\timport { Textarea } from '@elluzion/iv-ui';\n\n\tlet notes = $state('');\n</script>\n\n<div class=\"field-row\">\n\t<Textarea\n\t\tlabel=\"Release notes\"\n\t\tplaceholder=\"What changed in this deploy?\"\n\t\tbind:value={notes}\n\t\thelper=\"Markdown is supported.\"\n\t/>\n</div>\n\n<style>\n\t.field-row {\n\t\twidth: 100%;\n\t\tmax-width: 420px;\n\t}\n</style>"},{"id":"count","title":"Character count","description":"`maxlength` and `showCount` expose the remaining budget.","code":"<script lang=\"ts\">\n\timport { Textarea } from '@elluzion/iv-ui';\n\n\tlet summary = $state('Tightened the focus ring and reduced the dialog entry by 40 ms.');\n</script>\n\n<div class=\"field-row\">\n\t<Textarea label=\"Summary\" maxlength={120} showCount bind:value={summary} />\n</div>\n\n<style>\n\t.field-row {\n\t\twidth: 100%;\n\t\tmax-width: 420px;\n\t}\n</style>"},{"id":"states","title":"States","description":"Error, disabled, and read-only treatments.","code":"<script lang=\"ts\">\n\timport { Textarea } from '@elluzion/iv-ui';\n\n\tlet description = $state('');\n</script>\n\n<div class=\"stack\">\n\t<Textarea label=\"Description\" bind:value={description} error=\"A description is required.\" />\n\t<Textarea label=\"Read only\" value=\"Generated by the pipeline.\" readonly />\n\t<Textarea label=\"Disabled\" value=\"Locked.\" disabled />\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-lg);\n\t\twidth: 100%;\n\t\tmax-width: 420px;\n\t}\n</style>"}],"markdown":"/components/textarea.md","page":"/components/textarea"}