Keep the summary concise and actionable.
<script setup>
import { ref } from "vue";
import { InputArea } from "@dicehub/kappa/components/input-area";
import { Label } from "@dicehub/kappa/components/label";
const description = ref("");
</script>
<template>
<Label for="project-description">Project description</Label>
<InputArea
id="project-description"
v-model="description"
aria-describedby="project-description-help"
placeholder="Describe the goals and constraints..."
rows="4"
/>
<p id="project-description-help">Keep the summary concise and actionable.</p>
</template>Installation
Input Area is part of the main Kappa package. It composes Ark UI Field.Textarea so Ark owns value updates, field context, attribute forwarding, and automatic resizing.
Barrel
import { InputArea } from "@dicehub/kappa";Granular
import { InputArea } from "@dicehub/kappa/components/input-area";Usage
Input Area forwards native textarea attributes, classes, styles, and event listeners. Use v-model for controlled text, and always provide an accessible name.
<script setup>
import { ref } from "vue";
import { InputArea } from "@dicehub/kappa/components/input-area";
const message = ref("");
</script>
<template>
<InputArea
v-model="message"
aria-label="Message"
placeholder="Write a message..."
rows="3"
/>
</template>Composition
Field.Root (optional)
├── Field.Label
├── InputArea <textarea>
│ ├── native value, attributes, and events
│ └── Ark UI autoresize (optional)
├── Field.HelperText
└── Field.ErrorTextLabels, helper text, and validation messages belong to Kappa Field instead of Input Area. The autoresize prop preservesArk UI Field.Textarea behavior.
Examples
Field Composition
Place Input Area inside Field to connect its label, required state, and helper text.
<script setup>
import { ref } from "vue";
import { Field } from "@dicehub/kappa/components/field";
import { InputArea } from "@dicehub/kappa/components/input-area";
const notes = ref("");
</script>
<template>
<Field id="simulation-notes" required>
<Field.Label>
Simulation notes
<Field.RequiredIndicator />
</Field.Label>
<InputArea v-model="notes" rows="3" />
<Field.HelperText>Record assumptions that affect the result.</Field.HelperText>
</Field>
</template>Sizes
Use the same four density names as Input while preserving a practical writing area.
<script setup>
import { InputArea } from "@dicehub/kappa/components/input-area";
</script>
<template>
<InputArea size="xs" aria-label="Extra-small notes" value="Compact note" />
<InputArea size="sm" aria-label="Small notes" value="Small note" />
<InputArea size="base" aria-label="Base notes" value="Base note" />
<InputArea size="lg" aria-label="Large notes" value="Large note" />
</template>Controlled Value
Use v-model when application state owns the current text.
<script setup>
import { ref } from "vue";
import { InputArea } from "@dicehub/kappa/components/input-area";
import { Label } from "@dicehub/kappa/components/label";
const notes = ref("Review the boundary conditions.");
</script>
<template>
<Label for="controlled-notes">Review notes</Label>
<InputArea id="controlled-notes" v-model="notes" rows="3" />
<output for="controlled-notes">{{ notes.length }} characters</output>
</template>Auto Resize
Enable Ark UI measurement to grow with content and disable the manual resize handle.
Add lines to grow the control. Manual resizing is disabled in this mode.
<script setup>
import { ref } from "vue";
import { InputArea } from "@dicehub/kappa/components/input-area";
import { Label } from "@dicehub/kappa/components/label";
const log = ref("Initial residual: 2.1e-05");
</script>
<template>
<Label for="solver-log">Solver log</Label>
<InputArea id="solver-log" v-model="log" autoresize rows="2" />
</template>Form States
Disabled, read-only, and invalid states remain distinct in both themes.
Add at least 20 characters.
<script setup>
import { InputArea } from "@dicehub/kappa/components/input-area";
import { Label } from "@dicehub/kappa/components/label";
</script>
<template>
<Label for="disabled-notes" data-disabled>Disabled</Label>
<InputArea id="disabled-notes" disabled value="Editing is unavailable." />
<Label for="readonly-notes">Read only</Label>
<InputArea id="readonly-notes" readonly value="Approved for release." />
<Label for="invalid-notes">Invalid</Label>
<InputArea
id="invalid-notes"
invalid
aria-describedby="invalid-notes-error"
value="Too short"
/>
<p id="invalid-notes-error">Add at least 20 characters.</p>
</template>Character Limit
Pair native maxlength with a live counter when the limit helps the user.
<script setup>
import { computed, ref } from "vue";
import { InputArea } from "@dicehub/kappa/components/input-area";
import { Label } from "@dicehub/kappa/components/label";
const summary = ref("");
const remaining = computed(() => 180 - summary.value.length);
</script>
<template>
<Label for="release-summary">Release summary</Label>
<InputArea id="release-summary" v-model="summary" maxlength="180" rows="3" />
<output for="release-summary" aria-live="polite">{{ remaining }} remaining</output>
</template>With Button
Compose a native form and submit action without hiding textarea semantics.
<script setup>
import { ref } from "vue";
import { Button } from "@dicehub/kappa/components/button";
import { InputArea } from "@dicehub/kappa/components/input-area";
import { Label } from "@dicehub/kappa/components/label";
const feedback = ref("");
const send = () => {};
</script>
<template>
<form @submit.prevent="send">
<Label for="feedback">Feedback</Label>
<InputArea id="feedback" v-model="feedback" required rows="3" />
<Button type="submit">Send feedback</Button>
</form>
</template>Right to Left
Logical sizing and padding follow the surrounding text direction.
أضف التفاصيل المهمة للمراجعة.
<script setup>
import { InputArea } from "@dicehub/kappa/components/input-area";
import { Label } from "@dicehub/kappa/components/label";
</script>
<template>
<div dir="rtl" lang="ar">
<Label for="arabic-notes">ملاحظات</Label>
<InputArea
id="arabic-notes"
aria-describedby="arabic-notes-help"
placeholder="اكتب ملاحظاتك..."
rows="3"
/>
<p id="arabic-notes-help">أضف التفاصيل المهمة للمراجعة.</p>
</div>
</template>Accessibility
- Use a visible Label, Field.Label,
aria-label, oraria-labelledby. - Native
required,maxlength, disabled, and read-only behavior passes through. - The invalid prop adds
aria-invalid="true"; connect error text witharia-describedby. - Field composition supplies the control id and description relationships through Ark UI context.
- Focus remains visible, forced colors remain usable, and transitions honor reduced motion.
API Reference
InputArea
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Merges behavior and styling onto one child element through Ark UI. |
autoresize | boolean | false | Uses Ark UI automatic height measurement and disables manual resizing. |
invalid | boolean | false | Sets invalid presentation and aria-invalid=true. |
modelValue | string | number | — | Controlled value used by Vue v-model. Updates emit strings. |
size | "xs" | "sm" | "base" | "lg" | "base" | Sets padding, radius, text size, and minimum height. |
$attrs | TextareaHTMLAttributes | — | Native attributes such as rows, maxlength, required, readonly, and name. |
Events
| Event | Payload | Description |
|---|---|---|
update:modelValue | string | Emitted on native input events for Vue v-model. |
input / change | Event | Native listeners pass through to the textarea element. |
Data Attributes
| Attribute | Value | Description |
|---|---|---|
data-slot | "input-area" | Stable root-part selector. |
data-size | "xs" | "sm" | "base" | "lg" | Resolved density. |
data-autoresize | "" | Present when Ark autoresize is active. |
data-invalid | "" | Present for invalid prop or ARIA state. |
Exports
| Export | Description |
|---|---|
InputArea | Styled Ark UI textarea control. |
InputAreaProps / InputAreaEmits / InputAreaSlots | Public textarea prop, event, and slot contracts. |
InputAreaModelValue / InputAreaSize | Controlled-value and density types. |
INPUT_AREA_SIZES | Supported density values. |
INPUT_AREA_DEFAULT_SIZE | Default base density. |
isInputAreaSize | Supported-size type guard. |
resolveInputAreaSize | Safe size resolver with base fallback. |