Skip to content

Commit e73e93f

Browse files
committed
chore: update readme
1 parent 4c188e0 commit e73e93f

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed
Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
# SkipLink Web Widget
1+
# Skip Link
22

3-
A simple accessibility widget that adds a skip link to the top of the page. The link is only visible when focused and allows users to jump directly to the main content.
3+
Adds a skip navigation link for keyboard accessibility. The link is hidden until focused and allows users to jump directly to the main content.
44

55
## Usage
66

7-
1. Place the `<SkipLink />` component at the very top of your page or layout.
8-
2. Ensure your main content container has `id="main-content"`.
7+
1. Add the Skip Link widget anywhere on your page, preferrably at the top or in a layout.
8+
2. Configure the **Link Text** and **Main Content ID** properties.
9+
3. Ensure your main content element has the specified ID, or there's a main tag on the page.
910

10-
```jsx
11-
<SkipLink />
12-
<main id="main-content">Main content here</main>
13-
```
11+
The widget automatically inserts the skip link as the first child of the `#root` element.
1412

15-
## Accessibility
13+
## Properties
1614

17-
- The skip link is visually hidden except when focused, making it accessible for keyboard and screen reader users.
15+
- **Link Text**: Text displayed for the skip link (default: "Skip to main content").
16+
- **Main Content ID**: ID of the main content element to focus (optional).
1817

19-
## End-to-End Testing
18+
If the target element is not found, the widget will focus the first `<main>` element instead.
2019

21-
E2E tests are located in the `e2e/` folder and use Playwright. Run them with:
20+
## Accessibility
2221

23-
```
24-
npm install
25-
npx playwright install
26-
npm test
27-
```
22+
The skip link is positioned absolutely at the top-left of the page, hidden by default with `transform: translateY(-120%)`, and becomes visible when focused via keyboard navigation.

0 commit comments

Comments
 (0)