Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
import { ComingSoon } from '@/components/ComingSoon'
import { PropsTable } from '@/components/PropsTable'

<ComingSoon />
###### API

`Textarea` props extends the textarea HTML attributes.

<PropsTable
componentProps={[
{
property: 'typography',
description: 'Typography token applied to the textarea',
type: '`keyof DevupThemeTypography`',
default: '`undefined`',
},
{
property: 'error',
description: 'Whether the textarea is in an invalid state',
type: '`boolean`',
default: '`false`',
},
{
property: 'errorMessage',
description:
'Validation message shown below the textarea when `error` is true',
type: '`string`',
default: '`undefined`',
},
{
property: 'rows',
description: 'Visible text rows',
type: '`number`',
default: '`3`',
},
{
property: 'classNames',
description: 'Custom class names for inner elements',
type: '```{<br> container?: string<br> textarea?: string<br> errorMessage?: string<br>}```',
default: '`undefined`',
},
{
property: 'colors',
description: 'Custom color variables for the textarea',
type: '```{<br> primary?: string<br> error?: string<br> text?: string<br> border?: string<br> background?: string<br> placeholder?: string<br> focusRing?: string<br>}```',
default: '`undefined`',
},
]}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Textarea } from '@devup-ui/components'

/**
* **Default**
* Basic textarea for multi-line user input.
*/
export default function Default() {
return <Textarea placeholder="Enter your message..." />
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Textarea } from '@devup-ui/components'

/**
* **Error**
* Use `error` and `errorMessage` to show validation feedback.
*/
export default function Error() {
return (
<Textarea
error
errorMessage="Please enter at least 10 characters."
placeholder="Describe your request..."
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Textarea } from '@devup-ui/components'

/**
* **Disabled**
* Disabled textareas keep the value visible while preventing edits.
*/
export default function Disabled() {
return (
<Textarea
defaultValue="This message is read-only."
disabled
placeholder="Disabled textarea"
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Textarea } from '@devup-ui/components'

/**
* **Colors**
* Override the component color variables to match a custom theme.
*/
export default function Colors() {
return (
<Textarea
colors={{
primary: '#2563EB',
border: '#BFDBFE',
background: '#EFF6FF',
placeholder: '#60A5FA',
focusRing: 'rgba(37, 99, 235, 0.18)',
}}
placeholder="Custom themed textarea"
rows={4}
/>
)
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
`Textarea` component is used for multi-line text input.
`Textarea` component is used for multi-line text input, such as messages, comments, and descriptions.
Loading