ant-design/components/anchor/index.en-US.md

38 lines
1.6 KiB
Markdown
Raw Normal View History

2016-10-28 14:02:55 +08:00
---
category: Components
type: Other
2016-11-18 17:02:57 +08:00
cols: 2
2016-10-28 14:02:55 +08:00
title: Anchor
---
2016-11-09 21:06:43 +08:00
Hyperlinks to scroll on one page.
2016-10-28 14:02:55 +08:00
## When To Use
2016-11-29 17:13:24 +08:00
For displaying anchor hyperlinks on page and jumping between them.
2016-10-28 14:02:55 +08:00
## API
2016-11-03 16:45:13 +08:00
### Anchor Props
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| affix | Fixed mode of Anchor | boolean | true | |
| bounds | Bounding distance of anchor area | number | 5(px) | |
2019-11-21 19:58:41 +08:00
| getContainer | Scrolling container | () => HTMLElement | () => window | |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - | |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false | |
2019-11-21 19:58:41 +08:00
| onClick | set the handler to handle `click` event | Function(e: Event, link: Object) | - | |
| getCurrentAnchor | Customize the anchor highlight | () => string | - | |
| targetOffset | Anchor scroll offset, default as `offsetTop`, [example](#components-anchor-demo-targetOffset) | number | `offsetTop` | |
| onChange | Listening for anchor link change | (currentActiveLink: string) => void | | |
2016-11-03 16:45:13 +08:00
2016-11-07 11:04:36 +08:00
### Link Props
2016-10-28 14:02:55 +08:00
| Property | Description | Type | Default | Version |
| -------- | ----------------------------------------- | ----------------- | ------- | ------- |
| href | target of hyperlink | string | | |
| title | content of hyperlink | string\|ReactNode | | |
| target | Specifies where to display the linked URL | string | | |