thaw/demo_markdown/docs/anchor/mod.md
luoxiaozero f75b38f97d
Feat/anchor (#170)
* feat: Add Anchor component

* feat: Anchor collection Link

* feat: Anchor scroll view

* feat: Demo adds Toc

* fix: GuideDemo Toc

* feat: Anchor scroll

* feat: Anchor offset target
2024-04-19 14:42:30 +08:00

1.5 KiB

Anchor

view! {
    <Anchor>
        <AnchorLink title="Web API" href="#web">
            <AnchorLink title="DOM" href="#dom"/>
            <AnchorLink title="SVG" href="#svg"/>
            <AnchorLink title="File API" href="#file"/>
        </AnchorLink>
        <AnchorLink title="Rust" href="#rust"/>
        <AnchorLink title="Anchor Props" href="#anchor-props"/>
        <AnchorLink title="AnchorLink Props" href="#anchorlink-props"/>
    </Anchor>
}
view! {
    <Anchor>
        <AnchorLink title="Anchor" href="#anchor"/>
        <AnchorLink title="Anchor Props" href="#anchor-props"/>
        <AnchorLink title="AnchorLink Props" href="#anchorlink-props"/>
    </Anchor>
}

Anchor Props

Name Type Default Description
class OptionalProp<MaybeSignal<String>> Default::default() Additional classes for the anchor element.
offset_target Option<OffsetTarget> None The element or selector used to calc offset of link elements. If you are not scrolling the entire document but only a part of it, you may need to set this.
children Children Anchor's children.
Name Type Default Description
class OptionalProp<MaybeSignal<String>> Default::default() Additional classes for the anchor link element.
title MaybeSignal<String> The content of link.
href String The target of link.
children Option<Children> None AnchorLink's children.