• 文本框外观要让用户知道可以点击输入
  • 有两种样式:带背景色的和只有边框的
  • 用户能清楚看到文本框当前状态:是空的、已输入内容,还是有错误
  • 使用简单清晰的提示文字和错误提醒
  • 这些文本框主要用在填写表格和弹窗中

Filled text field  填充文本字段

1 Container 2 Leading icon (optional) 3 Label text (empty) 4 Label text (populated) 5 Trailing icon (optional) 6 Active lndicator (focused) 7 Caret 8 Input text 9 Supporting text (optional) 10 Active Indicator (enabled)
1 Container 2 Leading icon (optional) 3 Label text (empty) 4 Label text (populated) 5 Trailing icon (optional) 6 Active lndicator (focused) 7 Caret 8 Input text 9 Supporting text (optional) 10 Active Indicator (enabled)

Filled text field states  填充文本字段状态

1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Disabled (empty)禁用(空) 5 Enabled (populated)启用(已填充) 6 Focused (populated)聚焦(已填充) 7 Hovered (populated)悬停(已填充) 8 Disabled (populated)禁用(已填充)
1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Disabled (empty)禁用(空) 5 Enabled (populated)启用(已填充) 6 Focused (populated)聚焦(已填充) 7 Hovered (populated)悬停(已填充) 8 Disabled (populated)禁用(已填充)

Filled text field error states填充式文本框错误状态

错误状态用红色显示提醒用户有问题。系统会在文本框下方显示如何解决问题的提示,这些提示会一直显示,直到问题解决为止。

1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Enabled (populated)启用(已填充) 5 Focused (populated)聚焦 6 Hovered (populated)悬停(已填充)
1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Enabled (populated)启用(已填充) 5 Focused (populated)聚焦 6 Hovered (populated)悬停(已填充)
Attribute  属性Value  值
Default container height默认容器高度56dp
Label alignment (unpopulated)标签对齐(未填充)Vertically centered  垂直居中
Top/bottom padding  上下填充8dp
Left/right padding without icons无图标时的左右边距16dp
Left/right padding with icons带有图标的左右内边距12dp
Icon alignment  图标对齐Vertically centered  垂直居中
Padding between icons and text16dp
Supporting text and character counter top padding4dp
Padding between supporting text and character counter16dp
Target size  目标大小56dp

Filled text field configurations 填充文本字段配置

1 With supporting text 带有辅助文本 2 With trailing icon 带有尾随图标 3 With leading icon 带前置图标 4 With leading and trailing icon带有前置和后置图标 5 With prefix 带有前缀 6 With suffix 带有后缀 7 Multi-line text field 多行文本字段
1 With supporting text 带有辅助文本 2 With trailing icon 带有尾随图标 3 With leading icon 带前置图标 4 With leading and trailing icon带有前置和后置图标 5 With prefix 带有前缀 6 With suffix 带有后缀 7 Multi-line text field 多行文本字段

Outlined text field  轮廓文本框

1 Container outline (enabled) 2 Leading icon (optional) 3 Label text (unpopulated) 4 Label text (populated) 5 Trailing icon (optional) 6 Container outline (focused) 7 Caret 8 Input text 9 Supporting text (optional)
1 Container outline (enabled) 2 Leading icon (optional) 3 Label text (unpopulated) 4 Label text (populated) 5 Trailing icon (optional) 6 Container outline (focused) 7 Caret 8 Input text 9 Supporting text (optional)

Outlined text field states轮廓文本字段状态

1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Disabled (empty)禁用(空) 5 Enabled (populated)启用(已填充) 6 Focused (populated)聚焦(已填充) 7 Hovered (populated)悬停(已填充) 8 Disabled (populated)禁用(已填充)
1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Disabled (empty)禁用(空) 5 Enabled (populated)启用(已填充) 6 Focused (populated)聚焦(已填充) 7 Hovered (populated)悬停(已填充) 8 Disabled (populated)禁用(已填充)

Outlined text field error states轮廓文本字段错误状态

当文本框出现错误时,系统会用红色显示提醒。在文本框下方会显示简单的解决方法说明,让用户知道如何修正问题。这些提示会一直保持显示,直到用户解决了问题。

1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Enabled (populated)启用(已填充) 5 Focused (populated)聚焦(已填充) 6 Hovered (populated)悬停(已填充)
1 Enabled (empty)已启用(空白) 2 Focused (empty)聚焦(空) 3 Hovered (empty)悬停(空) 4 Enabled (populated)启用(已填充) 5 Focused (populated)聚焦(已填充) 6 Hovered (populated)悬停(已填充)
Attribute  属性Value  值
Container height  容器高度56dp
Left/right padding without icons无图标时的左右边距16dp
Left/right padding with icons带有图标的左右内边距12dp
Padding between icons and text图标和文本之间的填充16dp
Icon alignment  图标对齐Vertically centered  垂直居中
Supporting text and character counter top padding支持文本和字符计数器顶部填充4dp
Padding between supporting text and character counter支持文本和字符计数器之间的填充16dp
Label alignment  标签对齐方式Vertically centered  垂直居中
Left/right padding populated label text左/右填充标签文本4dp
Target size  目标大小56dp

Outlined text field configurations 轮廓文本字段配置

1 With supporting text 带有辅助文本 2 With trailing icon 带有尾随图标 3 With leading icon 带前置图标 4 With leading and trailing icon带有前置和后置图标 5 With prefix 带有前缀 6 With suffix 带有后缀 7 Multi-line text field 多行文本字段
1 With supporting text 带有辅助文本 2 With trailing icon 带有尾随图标 3 With leading icon 带前置图标 4 With leading and trailing icon带有前置和后置图标 5 With prefix 带有前缀 6 With suffix 带有后缀 7 Multi-line text field 多行文本字段