# MaterialTextField

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-themes-material/struct-materialtextfield/

**struct** · [`ferroui-themes-material`](/docs/0.5.0/api/ferroui-themes-material/) · v0.5.0

```rust
struct MaterialTextField
```

Attached Material text-field decoration. Works on the existing `TextBox`;
choosing a theme does not replace the editor or its automation peer.

```xml
<TextBox material:MaterialTextField.Label="Amount"
         material:MaterialTextField.Prefix="$"
         material:MaterialTextField.Suffix="USD"
         material:MaterialTextField.SupportingText="Before tax"
         PlaceholderText="0.00" />
```

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L26)

## Members

- [`TYPE`](#assoc_const-type)
- [`label_property`](#function-label_property)
- [`prefix_property`](#function-prefix_property)
- [`suffix_property`](#function-suffix_property)
- [`leading_icon_property`](#function-leading_icon_property)
- [`trailing_icon_property`](#function-trailing_icon_property)
- [`supporting_text_property`](#function-supporting_text_property)
- [`error_text_property`](#function-error_text_property)
- [`is_error_property`](#function-is_error_property)
- [`show_character_count_property`](#function-show_character_count_property)
- [`character_limit_property`](#function-character_limit_property)
- [`assistive_text_property`](#function-assistive_text_property)
- [`counter_text_property`](#function-counter_text_property)
- [`automation_description_property`](#function-automation_description_property)
- [`get_label`](#function-get_label)
- [`set_label`](#function-set_label)
- [`get_prefix`](#function-get_prefix)
- [`set_prefix`](#function-set_prefix)
- [`get_suffix`](#function-get_suffix)
- [`set_suffix`](#function-set_suffix)
- [`get_leading_icon`](#function-get_leading_icon)
- [`set_leading_icon`](#function-set_leading_icon)
- [`get_trailing_icon`](#function-get_trailing_icon)
- [`set_trailing_icon`](#function-set_trailing_icon)
- [`get_supporting_text`](#function-get_supporting_text)
- [`set_supporting_text`](#function-set_supporting_text)
- [`get_error_text`](#function-get_error_text)
- [`set_error_text`](#function-set_error_text)
- [`get_is_error`](#function-get_is_error)
- [`set_is_error`](#function-set_is_error)
- [`get_show_character_count`](#function-get_show_character_count)
- [`set_show_character_count`](#function-set_show_character_count)
- [`get_character_limit`](#function-get_character_limit)
- [`set_character_limit`](#function-set_character_limit)
- [`get_assistive_text`](#function-get_assistive_text)
- [`get_counter_text`](#function-get_counter_text)
- [`get_automation_description`](#function-get_automation_description)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L27)

<a id="function-label_property"></a>

### label_property

```rust
fn label_property() -> &'static AttachedProperty<Option<String>>
```

A label independent of the editor's placeholder. Empty labels are omitted.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-prefix_property"></a>

### prefix_property

```rust
fn prefix_property() -> &'static AttachedProperty<Option<String>>
```

Noneditable text before the editable value, with the native 2dp gap.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-suffix_property"></a>

### suffix_property

```rust
fn suffix_property() -> &'static AttachedProperty<Option<String>>
```

Noneditable text after the editable value, with the native 2dp gap.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-leading_icon_property"></a>

### leading_icon_property

```rust
fn leading_icon_property() -> &'static AttachedProperty<Option<BoxedValue>>
```

Leading content, centered in a minimum 48dp slot. Icons normally measure 24dp.
Use a real button as content when the icon performs an action.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-trailing_icon_property"></a>

### trailing_icon_property

```rust
fn trailing_icon_property() -> &'static AttachedProperty<Option<BoxedValue>>
```

Trailing content, centered in a minimum 48dp slot. Interactive content retains
its own keyboard and automation contracts.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-supporting_text_property"></a>

### supporting_text_property

```rust
fn supporting_text_property() -> &'static AttachedProperty<Option<String>>
```

Assistance displayed 4dp below the painted field, outside its container.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-error_text_property"></a>

### error_text_property

```rust
fn error_text_property() -> &'static AttachedProperty<Option<String>>
```

An application validation message. A nonempty message also activates the
error appearance; clearing it restores the supporting text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-is_error_property"></a>

### is_error_property

```rust
fn is_error_property() -> &'static AttachedProperty<bool>
```

Activates error appearance without changing FerroUI's validation errors.
Supply `ErrorText` for a specific, localized accessibility description.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-show_character_count_property"></a>

### show_character_count_property

```rust
fn show_character_count_property() -> &'static AttachedProperty<bool>
```

Displays the live UTF-16 count, consistent with TextBox positions and MaxLength.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-character_limit_property"></a>

### character_limit_property

```rust
fn character_limit_property() -> &'static AttachedProperty<i32>
```

Advisory UTF-16 limit. Exceeding it marks the field and counter as errors,
without truncating input or interfering with composition/undo. Zero uses
`TextBox.MaxLength`, or shows an unbounded count when MaxLength is also zero.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-assistive_text_property"></a>

### assistive_text_property

```rust
fn assistive_text_property() -> &'static AttachedProperty<Option<String>>
```

Computed message for the template. Applications should set SupportingText
or ErrorText instead of writing this output property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-counter_text_property"></a>

### counter_text_property

```rust
fn counter_text_property() -> &'static AttachedProperty<Option<String>>
```

Computed counter for the template; do not set directly.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-automation_description_property"></a>

### automation_description_property

```rust
fn automation_description_property() -> &'static AttachedProperty<Option<String>>
```

Computed assistance/error/counter description used as the theme's default
AutomationProperties.HelpText. An explicit application value takes priority.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L29)

<a id="function-get_label"></a>

### get_label

```rust
fn get_label(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L232)

<a id="function-set_label"></a>

### set_label

```rust
fn set_label(field: &TextBox, value: Option<&str>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L235)

<a id="function-get_prefix"></a>

### get_prefix

```rust
fn get_prefix(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L238)

<a id="function-set_prefix"></a>

### set_prefix

```rust
fn set_prefix(field: &TextBox, value: Option<&str>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L241)

<a id="function-get_suffix"></a>

### get_suffix

```rust
fn get_suffix(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L244)

<a id="function-set_suffix"></a>

### set_suffix

```rust
fn set_suffix(field: &TextBox, value: Option<&str>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L247)

<a id="function-get_leading_icon"></a>

### get_leading_icon

```rust
fn get_leading_icon(field: &TextBox) -> Option<BoxedValue>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L250)

<a id="function-set_leading_icon"></a>

### set_leading_icon

```rust
fn set_leading_icon(field: &TextBox, value: Option<BoxedValue>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L253)

<a id="function-get_trailing_icon"></a>

### get_trailing_icon

```rust
fn get_trailing_icon(field: &TextBox) -> Option<BoxedValue>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L256)

<a id="function-set_trailing_icon"></a>

### set_trailing_icon

```rust
fn set_trailing_icon(field: &TextBox, value: Option<BoxedValue>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L259)

<a id="function-get_supporting_text"></a>

### get_supporting_text

```rust
fn get_supporting_text(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L262)

<a id="function-set_supporting_text"></a>

### set_supporting_text

```rust
fn set_supporting_text(field: &TextBox, value: Option<&str>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L265)

<a id="function-get_error_text"></a>

### get_error_text

```rust
fn get_error_text(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L268)

<a id="function-set_error_text"></a>

### set_error_text

```rust
fn set_error_text(field: &TextBox, value: Option<&str>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L271)

<a id="function-get_is_error"></a>

### get_is_error

```rust
fn get_is_error(field: &TextBox) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L274)

<a id="function-set_is_error"></a>

### set_is_error

```rust
fn set_is_error(field: &TextBox, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L277)

<a id="function-get_show_character_count"></a>

### get_show_character_count

```rust
fn get_show_character_count(field: &TextBox) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L280)

<a id="function-set_show_character_count"></a>

### set_show_character_count

```rust
fn set_show_character_count(field: &TextBox, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L283)

<a id="function-get_character_limit"></a>

### get_character_limit

```rust
fn get_character_limit(field: &TextBox) -> i32
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L286)

<a id="function-set_character_limit"></a>

### set_character_limit

```rust
fn set_character_limit(field: &TextBox, value: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L289)

<a id="function-get_assistive_text"></a>

### get_assistive_text

```rust
fn get_assistive_text(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L292)

<a id="function-get_counter_text"></a>

### get_counter_text

```rust
fn get_counter_text(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L295)

<a id="function-get_automation_description"></a>

### get_automation_description

```rust
fn get_automation_description(field: &TextBox) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/text_field.rs#L298)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `CastableFrom<ST, Uninit, Uninit>`
- `CastableFrom<ST, Initialized, Initialized>`
- `Read<Exclusive, BecauseExclusive>`
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
