list-bar-search
一覧画面 一般的な一覧画面。タイトル、ツールバー、行があり、デスクトップでもモバイルでも動きます。
検索だけの一覧のための、単独の検索フォーム。ふつうの method="get" フォームです。
どの例も実際に動きますが、リンクはどこにも移動しません。 HTML にはコピーできるマークアップがあります。
検索語あり
✕ はリンクで、検索語を外した同じ画面に移ります。状態の絞り込みは隠し入力に乗っているので残ります。
これは <div rst-list> の中に置きます。
<search >
<form rst-search method ="get" action ="/comments" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="11" cy ="11" r ="8" /><path d ="m21 21-4.3-4.3" /></svg >
<input type ="search" name ="q" value ="spam" placeholder ="コメントを検索" aria-label ="コメントを検索" >
<a rst-search-clear href ="/comments?status=held" aria-label ="検索をクリア" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</a >
<input type ="hidden" name ="status" value ="held" >
<button class ="rst-sr-only" type ="submit" >検索</button >
</form >
</search >
アプリの中なら、これは /comments, /comments?status=held に届きます。ここではリンクもフォームもどこにも行きません。
検索語あり、4 ページ目
ページ番号は隠し入力に乗っているので、新しい検索は、もう 4 ページもない結果に page=4 を持ち込みます。✕ リンクはそれを外します。一覧の最初のページに向けてください。
これは <div rst-list> の中に置きます。
<search >
<form rst-search method ="get" action ="/comments" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="11" cy ="11" r ="8" /><path d ="m21 21-4.3-4.3" /></svg >
<input type ="search" name ="q" value ="spam" placeholder ="コメントを検索" aria-label ="コメントを検索" >
<a rst-search-clear href ="/comments" aria-label ="検索をクリア" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</a >
<input type ="hidden" name ="page" value ="4" >
<button class ="rst-sr-only" type ="submit" >検索</button >
</form >
</search >
アプリの中なら、これは /comments に届きます。ここではリンクもフォームもどこにも行きません。
空、アクセシブルな名前はカタログから
placeholder なし。入力欄のアクセシブルな名前は aria-label で、アプリがページの言語で書きます。
これは <div rst-list> の中に置きます。
<search >
<form rst-search method ="get" action ="/comments" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="11" cy ="11" r ="8" /><path d ="m21 21-4.3-4.3" /></svg >
<input type ="search" name ="q" aria-label ="検索" >
<button class ="rst-sr-only" type ="submit" >検索</button >
</form >
</search >
アプリの中なら、これは /comments に届きます。ここではリンクもフォームもどこにも行きません。