Skip to content

Commit 1458281

Browse files
committed
restructure and condense content
1 parent 5091933 commit 1458281

File tree

1 file changed

+19
-32
lines changed
  • fern/products/docs/pages/component-library/default-components

1 file changed

+19
-32
lines changed
Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
11
---
2-
title: 'Anchor'
3-
description: 'Create custom anchor links within your documentation pages'
2+
title: Anchor
3+
description: Create linkable anchors for paragraphs, tables, and other content without headings
44
---
55

6-
The Anchor component allows you to create custom anchor points within your documentation that can be linked to directly. This is useful for creating deep links to specific sections of content that don't have headings.
6+
Use the `<Anchor>` component to create links to specific paragraphs, tables, and other sections of content that don't have headings. Wrap your content with the `<Anchor>` tag and assign it a custom anchor ID, which you can link to in URLs using the hash symbol (example: `https://website.com/page#data`).
77

8-
## Usage
9-
10-
Use the `<Anchor>` component to wrap content and assign it a custom anchor ID. The anchor ID can then be referenced in URLs using the hash symbol (`#`).
8+
<Note>
9+
Headings automatically generate anchor links based on their text content, so you don't need to use the `<Anchor>` component for headings.
10+
</Note>
1111

1212
<Tabs>
13-
<Tab title="Rendered">
14-
<Anchor id="data">This content has a custom anchor</Anchor>
13+
<Tab title="Basic anchor">
14+
15+
<Anchor id="data">This sentence has a custom anchor</Anchor>
1516

1617
You can link to it using `#data` in the URL.
1718
</Tab>
1819
<Tab title="Markdown">
20+
1921
```jsx
20-
<Anchor id="data">This content has a custom anchor</Anchor>
22+
<Anchor id="data">This sentence has a custom anchor</Anchor>
2123

2224
You can link to it using `#data` in the URL.
2325
```
2426
</Tab>
2527
</Tabs>
2628

27-
## Properties
28-
29-
<ParamField path="id" type="string" required={true}>
30-
The anchor ID to assign to this content. This will be used in the URL hash (e.g., `#data`)
31-
</ParamField>
32-
33-
## Examples
34-
35-
### Anchor with a table
36-
3729
<Tabs>
38-
<Tab title="Rendered">
30+
<Tab title="Anchor a table">
3931
<Anchor id="api-endpoints">
4032

4133
| Endpoint | Method | Description |
@@ -49,6 +41,7 @@ You can link to it using `#data` in the URL.
4941
You can link directly to the [API endpoints table](#api-endpoints).
5042
</Tab>
5143
<Tab title="Markdown">
44+
5245
```jsx
5346
<Anchor id="api-endpoints">
5447

@@ -65,10 +58,8 @@ You can link directly to the [API endpoints table](#api-endpoints).
6558
</Tab>
6659
</Tabs>
6760

68-
### Anchor with a code block
69-
7061
<Tabs>
71-
<Tab title="Rendered">
62+
<Tab title="Anchor a Code Block">
7263
<Anchor id="example-code">
7364

7465
```python
@@ -83,6 +74,7 @@ def authenticate(api_key):
8374
Reference the [authentication code example](#example-code) in your implementation.
8475
</Tab>
8576
<Tab title="Markdown">
77+
8678
````jsx
8779
<Anchor id="example-code">
8880

@@ -100,15 +92,10 @@ Reference the [authentication code example](#example-code) in your implementatio
10092
</Tab>
10193
</Tabs>
10294

103-
## Use Cases
95+
## Properties
10496

105-
The Anchor component is particularly useful for:
97+
<ParamField path="id" type="string" required={true}>
98+
The anchor ID for this content. Reference it in URLs using the hash (example: `#data`)
99+
</ParamField>
106100

107-
- Creating links to specific paragraphs or content blocks that don't have headings
108-
- Providing deep links to important information within a page
109-
- Building table of contents or navigation that references specific content
110-
- Enabling users to share links to exact locations in your documentation
111101

112-
<Note>
113-
Headings automatically generate anchor links based on their text content, so you don't need to use the Anchor component for headings. Use Anchor for non-heading content that you want to make linkable.
114-
</Note>

0 commit comments

Comments
 (0)