Textarea field
v0.0.10
mix mishka.ui.gen.component textarea_field
Form textarea component
Form textarea component
The textarea_field component is used for capturing multi-line text input from users, making it ideal for longer content such as comments, descriptions, or feedback. Unlike a standard text input, textarea allows users to enter and edit multiple lines of text, offering greater flexibility for larger inputs. It can be customized in size and appearance to fit various form designs, ensuring an optimal user experience for entering extended information.
Form textarea component
<.textarea_field
name=""
value=""
label="Message"
placeholder="Your message"
/>Textarea disable resize prop
The disable_resize prop is a boolean. It adds resize-none, so the user cannot drag the corner of the textarea to change its size. Use it when the layout needs a fixed size.
Textarea disable resize prop
<.textarea_field
name=""
value=""
label="Message"
placeholder="Your message"
disable_resize
/>Textarea rows prop
The rows prop sets the number of visible lines. When you leave it out, the browser default applies, which is two lines in most browsers.
Textarea rows prop
<.textarea_field
name=""
value=""
label="Message"
placeholder="Your message"
rows="6"
/>Attributes
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
id
|
string
| — | — | No | A unique identifier is used to manage state and interaction |
class
|
any
| — | — | No | Custom CSS class for additional styling |
color
|
string
|
natural
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfomiscdawnsilver
| No | Determines color theme |
border
|
string
|
extra_small
| — | No | Determines border style |
rounded
|
string
|
small
|
extra_smallsmallmediumlargeextra_largefullnone
| No | Determines the border radius |
variant
|
string
|
base
|
outlinedefaultshadowborderedtransparentbase
| No | Determines the style |
description
|
string
| — | — | No | Determines a short description |
space
|
string
|
medium
|
extra_smallsmallmediumlargeextra_largenone
| No | Space between items |
placeholder
|
string
| — | — | No | Specifies text for placeholder |
description_class
|
string
|
text-[12px]
| — | No | Custom classes for description |
label_class
|
string
| — | — | No | Custom CSS class for the label styling |
field_wrapper_class
|
string
| — | — | No | Custom CSS class field wrapper |
textarea_class
|
string
| — | — | No | Custom CSS class for the input |
floating_label_class
|
string
| — | — | No | Custom CSS class for the floating label |
description_wrapper_class
|
string
| — | — | No | Custom classes for description wrapper |
size
|
string
|
extra_large
|
extra_smallsmallmediumlargeextra_largeauto
| No | Determines the overall size of the elements, including padding, font size, and other items |
disable_resize
|
boolean
|
false
| — | No | Disables the resize functionality for the textarea |
rows
|
string
| — | — | No | Determines count of textarea rows |
ring
|
boolean
|
true
| — | No | Determines a ring border on focused input, utilities for creating outline rings with box-shadows. |
floating
|
string
|
none
| — | No | none, inner, outer |
error_icon
|
string
| — | — | No | Icon to be displayed alongside error messages |
label
|
string
| — | — | No | Specifies text for the label |
errors
|
list
|
[]
| — | No | List of error messages to be displayed |
name
|
any
| — | — | No | Name of input |
value
|
any
| — | — | No | Value of input |
field
|
Phoenix.HTML.FormField
| — | — | No | a form field struct retrieved from the form |
rest
|
global
| — | — | No | Global attributes can define defaults which are merged with attributes provided by the caller |
Slots
| Name | Required | Description |
|---|---|---|
start_section
| No | Renders heex content in start of an element |
end_section
| No | Renders heex content in end of an element |
Attributes of the start_section slot
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
class
|
any
| — | — | No | Custom CSS class for additional styling |
icon
|
string
| — | — | No | Icon displayed alongside of an item |
Attributes of the end_section slot
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
class
|
any
| — | — | No | Custom CSS class for additional styling |
icon
|
string
| — | — | No | Icon displayed alongside of an item |
Options
Each option takes one or more of its values, separated by commas.
| Option | Values |
|---|---|
--variant
|
outlinedefaultshadowborderedtransparentbase
|
--color
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfomiscdawnsilver
|
--size
|
extra_smallsmallmediumlargeextra_largeauto
|
--rounded
|
extra_smallsmallmediumlargeextra_largefullnone
|
--space
|
extra_smallsmallmediumlargeextra_largenone
|
--module
| A module name of your own |
What it generates
mix mishka.ui.gen.component textarea_field