Skip to content

Commit 7ba2d97

Browse files
committed
docs: update feature list and fix jsdelivr links
1 parent d57cf27 commit 7ba2d97

5 files changed

Lines changed: 61 additions & 72 deletions

File tree

‎README.md‎

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,12 @@
1313
</h6>
1414

1515
<p align="center">
16-
<a href="https://choosealicense.com/licenses/mit/"><img
17-
alt="License MIT"
18-
src="https://img.shields.io/badge/license-MIT-ae15cc.svg"></a>
19-
<img alt="No dependencies"
20-
src="https://img.shields.io/badge/dependencies-none-8115cc.svg">
21-
<a href="https://github.com/sponsors/Simonwep"><img
22-
alt="Support me"
23-
src="https://img.shields.io/badge/github-support-6a15cc.svg"></a>
24-
<img alt="version" src="https://img.shields.io/github/lerna-json/v/simonwep/viselect?color=%233d24c9&label=version">
25-
<a href="https://www.buymeacoffee.com/aVc3krbXQ"><img
26-
alt="Buy me a coffee"
27-
src="https://img.shields.io/badge/%F0%9F%8D%BA-buy%20me%20a%20beer-%23FFDD00"></a>
28-
<a href="https://github.com/simonwep/viselect/actions/workflows/test.yml"><img
29-
alt="Build Status"
30-
src="https://github.com/simonwep/viselect/actions/workflows/test.yml/badge.svg"></a>
31-
<a href="https://github.com/simonwep/viselect/actions/workflows/deploy.yml"><img
32-
alt="Docs"
33-
src="https://github.com/simonwep/viselect/actions/workflows/docs.yml/badge.svg"></a>
16+
<img alt="No dependencies" src="https://img.shields.io/badge/dependencies-none-46a50f.svg">
17+
<a href="https://github.com/sponsors/simonwep"><img alt="Support me" src="https://img.shields.io/badge/github-support-46a50f.svg"></a>
18+
<img alt="downloads" src="https://raw.githubusercontent.com/simondump/static/refs/heads/master/apps/npm-viselect-downloads/dist/viselect.svg">
19+
<a href="https://github.com/simonwep/viselect/actions/workflows/test.yml"><img alt="Build Status" src="https://github.com/simonwep/viselect/actions/workflows/test.yml/badge.svg"></a>
3420
<img alt="gzip size" src="https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@viselect/vanilla/dist/viselect.umd.js?compression=gzip">
3521
<img alt="brotli size" src="https://img.badgesize.io/https://cdn.jsdelivr.net/npm/@viselect/vanilla/dist/viselect.umd.js?compression=brotli">
36-
<a href="https://v3.vuejs.org"><img
37-
alt="Vue support"
38-
src="https://img.shields.io/badge/✔-vue-%2340B581"></a>
39-
<a href="https://preactjs.com/"><img
40-
alt="Preact support"
41-
src="https://img.shields.io/badge/✔-preact-%236337B1"></a>
42-
<a href="https://reactjs.org"><img
43-
alt="React support"
44-
src="https://img.shields.io/badge/✔-react-%2359D7FF"></a>
4522
</p>
4623

4724
<p align="center">
@@ -50,14 +27,13 @@
5027

5128
### Features 🤘
5229

53-
* 🌟 Modern bundle
54-
* 🔩 Ultra tiny (~4kb)
55-
* 👌 Simple usage
56-
* ⚡ Highly optimized
57-
* ✔ Zero dependencies
58-
* 📱 Mobile / touch support
59-
* 🖱 Vertical and horizontal scroll support
60-
* 💪 Battle tested (over 6 years old and used in many apps)
30+
* 🧩 **Framework-ready** - a dependency-free core plus first-party React, Preact, and Vue 3 packages.
31+
* 🖱️ **Natural interactions** - drag, click/tap, and `Shift` range selection.
32+
* 🎯 **Configurable behavior** - selection triggers, thresholds, intersections, and overlap handling.
33+
* 📱 **Touch and scroll aware** - works with touch input and two-axis scrollable containers.
34+
* 🔄 **Lifecycle events** - observe or cancel interactions at every selection stage.
35+
* 🛠️ **Programmatic API** - manage selections, refresh selectable elements, or enable/disable selection.
36+
* ...and much more!
6137

6238
### Getting started
6339

‎docs/index.md‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,32 @@ hero:
2020
link: pages/examples
2121

2222
features:
23-
- icon: 🌟
24-
title: Modern Bundle
25-
details: A cutting-edge bundle for modern web development, ensuring compatibility with the latest standards and practices.
26-
- icon: 🔩
27-
title: Ultra Tiny
28-
details: Extremely lightweight, around 4kb in size, making it perfect for performance and size-critical applications.
29-
- icon: 👌
30-
title: Simple Usage
31-
details: Easy to use with minimal setup required, allowing developers to integrate it quickly into any kind of project.
32-
- icon: ⚡
33-
title: Highly Optimized
34-
details: Performance-focused and highly efficient, designed to handle large amounts of DOM elements with ease.
35-
- icon: 🚀
36-
title: Zero Dependencies
37-
details: No external dependencies required, reducing the risk of conflicts and simplifying the build process.
23+
- icon: 🧩
24+
title: Framework-ready
25+
details: First-party React, Preact, and Vue 3 package as well as a vanilla package for any other framework.
26+
- icon: 📦
27+
title: Dependency-free core
28+
details: The vanilla package has no runtime dependencies keeping it ultra-tiny and highly optimized.
29+
- icon: 🖱️
30+
title: Drag selection
31+
details: Select elements by drawing a visual selection area (click and drag).
32+
- icon: 👆
33+
title: Click and tap
34+
details: Select individual elements with a single click or tap.
35+
- icon: ↔️
36+
title: Range selection
37+
details: Extend a selection with Shift or select a range of elements with Shift + click/tap.
38+
- icon: 🎯
39+
title: Configurable behavior
40+
details: Control triggers, thresholds, intersections, overlap and much more!
3841
- icon: 📱
39-
title: Mobile / Touch Support
40-
details: Fully compatible with mobile and touch devices, providing a seamless experience across all platforms.
41-
- icon: 🖱
42-
title: Scroll Support
43-
details: Supports both vertical and horizontal scrolling, ensuring smooth navigation and interaction.
44-
- icon: 💪
45-
title: Battle Tested
46-
details: Over 6 years of development and widely used in many applications, demonstrating its reliability and robustness.
47-
- icon: 🖼
48-
title: Framework Support
49-
details: Compatible with major frameworks and easy to "hack" for custom integrations, providing flexibility and versatility.
42+
title: Touch support
43+
details: Handle visual selections on touch-enabled devices.
44+
- icon: ↕️
45+
title: Scroll support
46+
details: Supports vertical and horizontal scrollable containers.
47+
- icon: 🛠️
48+
title: Events and API
49+
details: Observe, cancel, and manage selections programmatically.
5050
---
5151

‎docs/pages/faq.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ If you don't care about text-selection, add the following to the container where
2929

3030
```css
3131
.container {
32-
user-select: none;
32+
user-select: none;
3333
}
3434
```
3535

3636
Another solution is to make the document during a selection non-selectable:
3737

3838
```ts
3939
selection
40-
.on('beforestart', () => document.body.style.userSelect = 'none')
41-
.on('stop', () => document.body.style.userSelect = 'unset');
40+
.on('beforestart', () => document.body.style.userSelect = 'none')
41+
.on('stop', () => document.body.style.userSelect = 'unset');
4242
```
4343

4444
Issues: [#103](https://github.com/simonwep/viselect/issues/103)

‎docs/pages/frameworks/vanilla.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ yarn add -D @viselect/vanilla
2323
```
2424

2525
```js [module]
26-
import SelectionArea from "https://cdn.jsdelivr.net/npm/@viselect/vanilla/dist/viselect.mjs"
26+
import SelectionArea from "https://cdn.jsdelivr.net/npm/@viselect/vanilla/dist/viselect.js"
2727
```
2828

2929
:::

‎docs/pages/quickstart.md‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Quickstart
22

3-
> [!NOTE]
4-
> This documentation is brand new ✨
5-
> If you have any questions or something's missing, feel free to [open an issue](https://github.com/simonwep/viselect/issues) 💖
6-
73
Viselect can be used with [vue 3](./frameworks/vue.md), [preact](./frameworks/preact.md), [react](./frameworks/react.md), or [without](./frameworks/vanilla.md) any framework.
84
All its variants are available as separate packages under the `@viselect` namespace.
95

@@ -13,11 +9,28 @@ All its variants are available as separate packages under the `@viselect` namesp
139
1410
For the following we'll use the vanilla package, an `index.html`, `styles.css`, and `main.mjs` file to demonstrate how to set up a selection area.
1511

12+
::: code-group
13+
14+
```sh [npm]
15+
npm install @viselect/vanilla --save-exact
16+
```
17+
18+
```sh [pnpm]
19+
pnpm add @viselect/vanilla --save-exact
20+
```
21+
22+
```sh [lerna]
23+
lerna add @viselect/vanilla --save-exact
24+
```
25+
26+
:::
27+
28+
29+
1630
::: code-group
1731

1832
```js [main.mjs]
19-
import SelectionArea from 'https://cdn.jsdelivr.net/npm/@viselect/vanilla/dist/viselect.mjs';
20-
// or import SelectionArea from '@viselect/vanilla';
33+
import SelectionArea from '@viselect/vanilla';
2134

2235
// Generate some divs to select later on
2336
[
@@ -97,7 +110,7 @@ const selection = new SelectionArea({
97110

98111
:::
99112

100-
Which will give you something like this:
113+
Which will give you:
101114

102115
<div ref="container" :class="[$style.container, $style.purple]"/>
103116
<div :class="[$style.container, $style.blue]"/>

0 commit comments

Comments
 (0)