field-text
表單 人會打字入去嘅欄位,處於真正表格會令佢哋出現嘅狀態。每個都放喺一個有留白嘅 rst-box 入面,因為表格就係放喺呢種卡片入面。
一個有標籤嘅文字輸入框。必填標記嘅星號係 aria-hidden;程式讀到嘅訊號係輸入框嘅 required 屬性。
每個例子都真係用得,不過入面啲連結唔會帶你去邊度。 HTML 顯示可以複製嘅標記。
最簡單
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="ft_bare" >標題</label >
<input rst-input id ="ft_bare" name ="ft_bare" type ="text" >
</div >
帶一句提示
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="ft_hint" >大標題</label >
<input rst-input id ="ft_hint" name ="ft_hint" type ="text" aria-describedby ="ft_hint-hint" >
<small rst-field-hint id ="ft_hint-hint" >會喺列表度顯示。</small >
</div >
必填
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="ft_required" >顯示名稱 <span rst-field-required aria-hidden ="true" >*</span ></label >
<input rst-input id ="ft_required" name ="ft_required" type ="text" autocomplete ="nickname" required >
</div >
帶一個錯誤
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="ft_error" >標題</label >
<input rst-input id ="ft_error" name ="ft_error" type ="text" value ="發佈說明" aria-invalid ="true" aria-describedby ="ft_error-error" >
<small rst-field-error id ="ft_error-error" >已經有篇文用咗呢個標題。</small >
</div >
主要欄位
畀表格嘅主要欄位,例如標題或者名,加上 rst-input="primary",個輸入框會更醒目。
將呢段放入 <section rst-box><form rst-form> 入面。
<div rst-field >
<label rst-field-label for ="ft_primary" >係咩嚟?</label >
<input rst-input ="primary" id ="ft_primary" name ="ft_primary" type ="text" value ="季度董事會會議" >
</div >