1.0.7 • Published 1 year ago
@illa-design/anchor v1.0.7
Anchor
You can quickly find the location of the information through the anchor component.
Installation
yarn add @illa-design/anchor
Import component
import { Anchor } from "@illa-design/anchor"
API
Anchor Basic Properties
Props | Desc | Type | Default |
---|---|---|---|
animation | Whether to scroll smoothly | boolean | true |
scrollContainer | The scroll container | string | HTMLElement | Window | - |
boundary | The scroll boundary value. After setting this value to a number, it will stop scrolling when it is a distance from the scroll container boundary | number | "end" | "start" | "center" | "nearest" | "start" |
hash | Whether to change the hash | boolean | true |
affix | Whether to used the Affix component | boolean | true |
lineless | Whether to show the left side line | boolean | - |
Anchor Events
Props | Desc | Type | Default |
---|---|---|---|
onChange | Callback when the anchor changes when scrolling | (newLink: string, oldLink: string) => void | - |
onSelect | Callback when the anchor is clicked | (newLink: string, oldLink: string) => void | - |
AnchorLink Basic Properties
Props | Desc | Type | Default | |
---|---|---|---|---|
href | Link of the anchor | string | "#" | |
title | Title of anchor link | string | React.ReactNode | - |
Example
Basic usage
<Anchor />
Set Anchor link
<Anchor>
<AnchorLink title="anchor" href="#anchor" />
</Anchor>
1.0.7
1 year ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.0.10
2 years ago
0.0.11
2 years ago
0.0.12
2 years ago
0.0.13
2 years ago
0.0.14
2 years ago
0.0.15
2 years ago
0.0.9
2 years ago
0.0.16
2 years ago
0.0.17
2 years ago
0.0.8
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago