Clayアラート
Clayアラートには、埋め込みとストライプの2つのタイプがあります。 両方のタイプと、それぞれのいくつかの例を以下に示します。
埋め込みアラート
埋め込みアラートは通常、フォーム内で使用されます。 埋め込みアラートを含む要素によって、埋め込みアラートの幅が決定します。 埋め込みアラートには、クローズアクションは必要ありません。 次の埋め込みアラートは、Clay taglibを使用して作成できます。
危険アラート(埋め込み):
<clay:alert
displayType="danger"
message="This is an error message."
title="Error"
/>
成功アラート(埋め込み):
<clay:alert
displayType="success"
message="This is a success message."
title="Success"
/>
情報アラート(埋め込み):
<clay:alert
displayType="info"
message="This is an info message."
title="Info"
/>
注意アラート(埋め込み):
<clay:alert
displayType="warning"
message="This is a warning message."
title="Warning"
/>
ストライプアラート
ストライプアラートは、最後のナビゲーション要素(ヘッダまたはナビゲーションバーのいずれか)の下に配置され、通常は [保存] アクションで表示され、サーバーから受信したアクションのステータスを通知します。 埋め込みアラートとは異なり、ストライプアラートにはクローズアクションが必要です。 ストライプアラートは常にコンテナの全幅であり、すべてのコンテンツをその下にプッシュします。 次のストライプアラートは、Clay taglibを使用して作成できます。
危険アラート(ストライプ):
<clay:stripe
displayType="danger"
message="This is an error message."
title="Error"
/>
成功アラート(ストライプ):
<clay:stripe
displayType="success"
message="This is a success message."
title="Success"
/>
情報アラート(ストライプ):
<clay:stripe
displayType="info"
message="This is an info message."
title="Info"
/>
注意アラート(ストライプ):
<clay:stripe
displayType="warning"
message="This is a warning message."
title="Warning"
/>
これで、ユーザーに警告する方法がわかりました。