logo

Anchor

Hyperlinks to scroll on one page.

When To Use

For displaying anchor hyperlinks on page and jumping between them.

Examples

The simplest usage.

expand code expand code

Clicking on an anchor does not record history.

expand code expand code

Anchor target scroll to screen center.

expand code expand code

Do not change state when page is scrolling.

expand code expand code

Customize the anchor highlight.

expand code expand code

Listening for anchor link change.

expand code expand code

Anchor API#

Property Description Type Default Value
Key Parameterused to refresh links list when the key changed. String --
ChildContent ParameterThe content of the component. RenderFragment --
Affix ParameterFixed mode of Anchor Boolean true
Bounds ParameterBounding distance of anchor area Int32 5
GetContainer ParameterScrolling container Func<String> window
OffsetBottom ParameterPixels to offset from bottom when calculating position of scroll Int32? --
OffsetTop ParameterPixels to offset from top when calculating position of scroll Int32? 0
ShowInkInFixed ParameterWhether show ink-balls in Fixed mode Boolean false
OnClick Parameterset the handler to handle click event EventCallback<Tuple<MouseEventArgs, AnchorLink>> --
GetCurrentAnchor ParameterCustomize the anchor highlight Func<String> --
TargetOffset ParameterAnchor scroll offset, default as AntDesign.Anchor.OffsetTop Int32? --
OnChange ParameterCallback executed when the anchor changes, either by click or scrolling EventCallback<String> --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --
Property Description Type Default Value
ChildContent ParameterAdditional content. Does not override Title. RenderFragment --
Href ParameterTarget of hyperlink String --
Title ParameterContent of hyperlink String --
Target ParameterSpecifies where to display the linked URL String --
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --
Watermark BackTop
文档已更新,请点击 此处 更新。
A new version of this app is available. Click here to update.