Skip to main content

TagChip

Function TagChip 

Source
pub fn TagChip<R: Routable + Clone + PartialEq + 'static>(
    _: TagChipProps<R>,
) -> Element
Expand description

标签芯片组件:统一归档索引、软底标签、卡片胶囊与文字链接的展示。

收敛原本散落在标签云与文章卡片(post_card.rs 描边胶囊) 的两套手写 Link 样式——两者都是跳转到 [Route::TagDetail] 的可点击标签, 仅视觉变体不同,故合并为一个组件 + variant prop。

Props:

  • label:标签名
  • to:跳转目标路由(泛型,调用方传入具体 Route 变体,原子层不绑定 app 路由类型)
  • variant"archive"(归档标签索引)/ "solid"(软底)/ "outline"(卡片胶囊)/ "text"(紧凑文章流)
  • count:可选的文章计数,归档变体使用独立计数徽标,其余使用 <sup>
  • stop_propagation:是否阻止点击冒泡(卡片内覆盖层链接场景需要,见 PostCard

§Props

For details, see the props struct definition.