行動呼籲是頁面最後一次邀請。說明理由後,再給訪客一次採取行動的機會。獨立的表面讓這一段看起來像是頁面的結尾。這裡用反相面板,將全頁視覺最醒目的表面留給最後的邀請。
行動呼籲
<section class="container-inline px-lg py-4xl" aria-labelledby="cta-title"> <div class="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 class="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p class="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M17.2077 9.4105A0.6234 0.6234 0 0 0 17 9.375L2.9693 9.3758A0.625 0.625 0 0 0 2.9083 10.6182L3 10.625H17A0.6234 0.6234 0 0 0 17.2077 10.5895A0.8258 0.8258 0 0 0 17.2077 9.4105Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M10 5.5L16.7383 9.8318A0.2 0.2 0 0 1 16.7383 10.1682L10 14.5" /> </svg> </a> </div> </div></section>import ArrowRightIcon from '@master/icons-react/native/20/soft/arrow-right'<section className="container-inline px-lg py-4xl" aria-labelledby="cta-title"> <div className="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 className="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p className="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div className="flex flex-wrap justify-center gap-sm"> <a className="btn btn-lg" href="#">Start deploying</a> <a className="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<ArrowRightIcon className="icon" /> </a> </div> </div></section><script> import ArrowRightIcon from '@master/icons-svelte/native/20/soft/arrow-right'</script><section class="container-inline px-lg py-4xl" aria-labelledby="cta-title"> <div class="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 class="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p class="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<ArrowRightIcon class="icon" /> </a> </div> </div></section><script setup>import ArrowRightIcon from '@master/icons-vue/native/20/soft/arrow-right'</script><template> <section class="container-inline px-lg py-4xl" aria-labelledby="cta-title"> <div class="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 class="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p class="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<ArrowRightIcon class="icon" /> </a> </div> </div> </section></template>區塊提供可直接複製的標記,沿用頁面的文字顏色和大小。預覽在 body 上設定 fg-text-body text-sm。每個區塊都是尺寸查詢容器,因此會依自身寬度調整版面配置。
#組成
sheet sheet-inverse。 Moonstone 使用墨色,Obsidian 使用珍珠色,光影與主要按鈕相同。每頁只用一個。- 文字採用反相色。 標題和導言使用
fg-text-inverse,將這個 utility 放在標題原有的顏色設定之後。 - 使用預設按鈕作為行動按鈕。 在墨色表面上,一般的凸起按鈕是畫面中最亮的元素。主要按鈕的墨色會和背景融在一起。
- 一句話搭配一項行動,再為還沒準備好的訪客提供一個低調的次要選項。
#低調樣式
如果頁面已有鮮明的收尾,或每一頁都會提出同樣的邀請,就採用一般材質。在托盤內放一個面板,文字放在起始端,按鈕放在末端。當同一列放不下時,flex flex-wrap justify-between 會讓按鈕換到文字下方。
低調樣式
<section class="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div class="tray max-w(1040) mx-auto"> <div class="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div class="flex flex-col gap-xs"> <h2 class="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p class="m(0) leading-md">Deploy your first project in under a minute. No card needed.</p> </div> <div class="flex flex-wrap gap-sm"> <a class="btn btn-primary" href="#">Start deploying</a> <a class="btn" href="#">Read the docs</a> </div> </div> </div></section><section className="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div className="tray max-w(1040) mx-auto"> <div className="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div className="flex flex-col gap-xs"> <h2 className="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p className="m(0) leading-md"> Deploy your first project in under a minute. No card needed. </p> </div> <div className="flex flex-wrap gap-sm"> <a className="btn btn-primary" href="#">Start deploying</a> <a className="btn" href="#">Read the docs</a> </div> </div> </div></section><section class="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div class="tray max-w(1040) mx-auto"> <div class="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div class="flex flex-col gap-xs"> <h2 class="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p class="m(0) leading-md">Deploy your first project in under a minute. No card needed.</p> </div> <div class="flex flex-wrap gap-sm"> <a class="btn btn-primary" href="#">Start deploying</a> <a class="btn" href="#">Read the docs</a> </div> </div> </div></section><template> <section class="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div class="tray max-w(1040) mx-auto"> <div class="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div class="flex flex-col gap-xs"> <h2 class="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p class="m(0) leading-md"> Deploy your first project in under a minute. No card needed. </p> </div> <div class="flex flex-wrap gap-sm"> <a class="btn btn-primary" href="#">Start deploying</a> <a class="btn" href="#">Read the docs</a> </div> </div> </div> </section></template>#搭配輸入欄位
如果要請訪客填寫電子郵件地址,把欄位和按鈕放在可換行的同一列。grow(1) basis(200) 讓欄位填滿可用空間,並以 200px 為基準。放不下兩者時,按鈕會換到下一列。
搭配輸入欄位
<section class="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div class="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 class="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p class="lead">The changelog, about twice a month. Nothing else, and one click to stop.</p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Subscribe</button> </form> </div></section><section className="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div className="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 className="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p className="lead">The changelog, about twice a month. Nothing else, and one click to stop.</p> <form className="flex flex-wrap gap-xs w-full max-w(420)"> <input className="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autoComplete="email" required /> <button className="btn btn-primary">Subscribe</button> </form> </div></section><section class="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div class="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 class="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p class="lead">The changelog, about twice a month. Nothing else, and one click to stop.</p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Subscribe</button> </form> </div></section><template> <section class="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div class="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 class="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p class="lead">The changelog, about twice a month. Nothing else, and one click to stop.</p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Subscribe</button> </form> </div> </section></template>#無障礙
- 反相面板在明暗兩種配色下都能維持文字與背景之間的高對比,因為背景和文字採用主題配對好的反相色。
- 欄位需要有名稱。這裡使用
aria-label="Email",有空間時優先使用可見的標籤。 - 讓訪客知道點擊後會發生什麼事。「開始部署」說明了接下來的動作,「送出」則沒有說明。