30 lines
538 B
Text
30 lines
538 B
Text
|
|
package ui
|
||
|
|
|
||
|
|
type TextareaProps struct {
|
||
|
|
ID string
|
||
|
|
Name string
|
||
|
|
Value string
|
||
|
|
Placeholder string
|
||
|
|
Rows int
|
||
|
|
Disabled bool
|
||
|
|
Required bool
|
||
|
|
Attrs templ.Attributes
|
||
|
|
}
|
||
|
|
|
||
|
|
templ Textarea(props TextareaProps) {
|
||
|
|
<textarea
|
||
|
|
id={ inputID(props.ID, props.Name) }
|
||
|
|
name={ props.Name }
|
||
|
|
placeholder={ props.Placeholder }
|
||
|
|
rows={ textareaRows(props.Rows) }
|
||
|
|
class="ui-textarea"
|
||
|
|
if props.Disabled {
|
||
|
|
disabled
|
||
|
|
}
|
||
|
|
if props.Required {
|
||
|
|
required
|
||
|
|
}
|
||
|
|
{ props.Attrs... }
|
||
|
|
>{ props.Value }</textarea>
|
||
|
|
}
|