Skip to content

Commit c1360c6

Browse files
committed
docs: update textarea component page
1 parent 9d8762e commit c1360c6

6 files changed

Lines changed: 107 additions & 3 deletions

File tree

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1-
import { ComingSoon } from '@/components/ComingSoon'
1+
import { PropsTable } from '@/components/PropsTable'
22

3-
<ComingSoon />
3+
###### API
4+
5+
`Textarea` props extends the textarea HTML attributes.
6+
7+
<PropsTable
8+
componentProps={[
9+
{
10+
property: 'typography',
11+
description: 'Typography token applied to the textarea',
12+
type: '`keyof DevupThemeTypography`',
13+
default: '`undefined`',
14+
},
15+
{
16+
property: 'error',
17+
description: 'Whether the textarea is in an invalid state',
18+
type: '`boolean`',
19+
default: '`false`',
20+
},
21+
{
22+
property: 'errorMessage',
23+
description:
24+
'Validation message shown below the textarea when `error` is true',
25+
type: '`string`',
26+
default: '`undefined`',
27+
},
28+
{
29+
property: 'rows',
30+
description: 'Visible text rows',
31+
type: '`number`',
32+
default: '`3`',
33+
},
34+
{
35+
property: 'classNames',
36+
description: 'Custom class names for inner elements',
37+
type: '```{<br> container?: string<br> textarea?: string<br> errorMessage?: string<br>}```',
38+
default: '`undefined`',
39+
},
40+
{
41+
property: 'colors',
42+
description: 'Custom color variables for the textarea',
43+
type: '```{<br> primary?: string<br> error?: string<br> text?: string<br> border?: string<br> background?: string<br> placeholder?: string<br> focusRing?: string<br>}```',
44+
default: '`undefined`',
45+
},
46+
]}
47+
/>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Textarea } from '@devup-ui/components'
2+
3+
/**
4+
* **Default**
5+
* Basic textarea for multi-line user input.
6+
*/
7+
export default function Default() {
8+
return <Textarea placeholder="Enter your message..." />
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Textarea } from '@devup-ui/components'
2+
3+
/**
4+
* **Error**
5+
* Use `error` and `errorMessage` to show validation feedback.
6+
*/
7+
export default function Error() {
8+
return (
9+
<Textarea
10+
error
11+
errorMessage="Please enter at least 10 characters."
12+
placeholder="Describe your request..."
13+
/>
14+
)
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Textarea } from '@devup-ui/components'
2+
3+
/**
4+
* **Disabled**
5+
* Disabled textareas keep the value visible while preventing edits.
6+
*/
7+
export default function Disabled() {
8+
return (
9+
<Textarea
10+
defaultValue="This message is read-only."
11+
disabled
12+
placeholder="Disabled textarea"
13+
/>
14+
)
15+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Textarea } from '@devup-ui/components'
2+
3+
/**
4+
* **Colors**
5+
* Override the component color variables to match a custom theme.
6+
*/
7+
export default function Colors() {
8+
return (
9+
<Textarea
10+
colors={{
11+
primary: '#2563EB',
12+
border: '#BFDBFE',
13+
background: '#EFF6FF',
14+
placeholder: '#60A5FA',
15+
focusRing: 'rgba(37, 99, 235, 0.18)',
16+
}}
17+
placeholder="Custom themed textarea"
18+
rows={4}
19+
/>
20+
)
21+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
`Textarea` component is used for multi-line text input.
1+
`Textarea` component is used for multi-line text input, such as messages, comments, and descriptions.

0 commit comments

Comments
 (0)