1.0.7 • Published 3 years 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
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.0.10
3 years ago
0.0.11
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.14
3 years ago
0.0.15
3 years ago
0.0.9
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.8
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago