Skip to content
fandhe-frontend
GitHub

Download Trigger

fandhe-frontend-pre-styled-uidownload_trigger mod が提供するスタイル済み Download Trigger 部品です。

関連 API: fandhe-frontend-pre-styled-ui API / fandhe-frontend-headless-ui API

Demo

a[download] 属性による宣言的ダウンロードトリガー(JS 不要の静的部品)。variant・size・colorPalette は Button recipe を流用します。

Features

  • ダウンロードリンク(<a download>)を button 部品と同じ variant/size/colorPalette 軸で styled 化する
  • button::ButtonVariant を再利用するため見た目は Button と統一される

Anatomy

root

API Reference

Arguments

NameTypeDefaultDescription
variantButtonVariantSolid見た目 variant(button と共通)。
sizeSizeMdサイズ variant。
paletteColorPaletteAccentcolorPalette 軸。
href&str(必須)ダウンロード対象のリソース URL。
file_nameOption<&str>Nonedownload 属性へ指定するファイル名。
attrsVec<(&str, &str)>root(<a>)パーツへ合成する追加属性。
childrenVec<Node>リンクラベルとなる子ノード。

Examples

variant の切り替え

Solid/Outline の 2 種を並べます。