|
1 | 1 | <img src="./assets/intro.gif" alt="">
|
2 | 2 |
|
3 |
| -Discover `vue-smart-suggest`, a compact (<3KB) vue library offering dynamic, context-sensitive suggestions for your text areas. |
| 3 | +Vue Smart Suggest is a lightweight vue library offering dynamic, context-sensitive suggestions for your text areas. It can be fully customized with custom components and weights less than `3kb` minified and gzipped. |
4 | 4 |
|
5 |
| -## Features |
| 5 | +Check out the [documentation website](https://7ph.github.io/vue-smart-suggest/#/) to try it out 😊 |
6 | 6 |
|
7 |
| -- Lightweight |
8 |
| -- Easy to integrate |
9 |
| -- Context-sensitive suggestions based on user input |
10 |
| -- Customizable triggers (e.g., "@", ":") |
| 7 | +<p align="right"> |
| 8 | + Like this project? Give a star 🌟 |
| 9 | +</p> |
11 | 10 |
|
12 |
| -## Installation |
| 11 | +## Getting started |
13 | 12 |
|
14 |
| -```bash |
15 |
| -npm install --save vue-smart-suggest |
16 |
| -``` |
| 13 | +1. Install using a package manager |
17 | 14 |
|
18 |
| -## Usage |
| 15 | + ```bash |
| 16 | + npm i --save vue-smart-suggest |
| 17 | + # or |
| 18 | + yarn add vue-smart-suggest |
| 19 | + ``` |
19 | 20 |
|
20 |
| -Here's a quick example on how to use `vue-smart-suggest` in your project: |
| 21 | +2. Import `SmartSuggest` and define suggestion trigger(s) |
21 | 22 |
|
22 |
| -```vue |
23 |
| -<script setup lang="ts"> |
24 |
| -import { SmartSuggest, Trigger } from 'vue-smart-suggest'; |
| 23 | + ```ts |
| 24 | + import { SmartSuggest, Trigger } from 'vue-smart-suggest'; |
25 | 25 |
|
26 |
| -const userTrigger: Trigger = { |
27 |
| - char: '@', |
28 |
| - items: [ |
29 |
| - { value: 'joe', searchText: 'joe' }, |
30 |
| - { value: 'jane', searchText: 'jane' }, |
31 |
| - ], |
32 |
| -}; |
33 |
| -</script> |
| 26 | + const userMentionTrigger: Trigger = { |
| 27 | + char: '@', |
| 28 | + items: [{ value: 'Joe' }, { value: 'Jane' }], |
| 29 | + }; |
| 30 | + ``` |
34 | 31 |
|
35 |
| -<template> |
36 |
| - <SmartSuggest :trigger="userTrigger"> |
37 |
| - <textarea /> |
38 |
| - </SmartSuggest> |
39 |
| -</template> |
40 |
| -``` |
41 |
| - |
42 |
| -For detailed usage and options, please refer to [Documentation Link]. |
43 |
| - |
44 |
| -## Contributing |
| 32 | + \*minimal example, check Trigger type definition to see all options |
45 | 33 |
|
46 |
| -We welcome contributions to `vue-smart-suggest`! If you're interested in helping improve this project, here's how you can contribute: |
| 34 | +3. Enhance a text area with `<SmartSuggest />` |
47 | 35 |
|
48 |
| -### Reporting Issues |
49 |
| - |
50 |
| -- Ensure the issue has not already been reported. |
51 |
| -- Use the GitHub Issues tab to report the issue. Provide detailed steps to reproduce, what you expected to happen, and what actually happened. |
| 36 | + ```html |
| 37 | + <SmartSuggest :triggers="[userMentionTrigger]"> |
| 38 | + <textarea /> |
| 39 | + </SmartSuggest> |
| 40 | + ``` |
52 | 41 |
|
53 |
| -### Submitting Pull Requests |
| 42 | +4. That's it, your textarea will show up suggestions as you type `@`! |
| 43 | +5. Check-out the [customization guide](https://7ph.github.io/vue-smart-suggest/#/customize) or the [API](https://7ph.github.io/vue-smart-suggest/api-docs/) to get the most of this library |
54 | 44 |
|
55 |
| -1. Fork the repository on GitHub. |
56 |
| -2. Clone your fork to your local machine. |
57 |
| -3. Create a new branch for your feature or fix. |
58 |
| -4. Make your changes, ensuring you adhere to the existing code style. |
59 |
| -5. Write or adapt tests as needed. |
60 |
| -6. Commit your changes with a clear and descriptive message. |
61 |
| -7. Push your branch to your GitHub fork. |
62 |
| -8. Submit a pull request to the main repository. |
63 |
| -9. Ensure your pull request description clearly describes the problem and solution. Include the relevant issue number if applicable. |
| 45 | +## Dependencies |
64 | 46 |
|
65 |
| -### Coding Guidelines |
| 47 | +- This library requires `vue 3.x`. |
| 48 | +- This library has a single dependency, `textarea-caret` which helps finding the position of the cursor inside a text area. |
66 | 49 |
|
67 |
| -- Write code in TypeScript. |
68 |
| -- Follow existing coding style for consistency. |
69 |
| -- Ensure your code passes all existing tests and write new tests as needed. |
| 50 | +## Useful links |
70 | 51 |
|
71 |
| -### Community |
| 52 | +Documentation |
72 | 53 |
|
73 |
| -Join our [Community Forum or Slack/Discord Channel] to discuss development, features, and ideas. |
| 54 | +- Try out a simple [demo](https://7ph.github.io/vue-smart-suggest/) on the documentation website. |
| 55 | +- For styling tips, check the [customization guide](https://7ph.github.io/vue-smart-suggest/#/customize). |
| 56 | +- Check out the [api documentation](https://7ph.github.io/vue-smart-suggest/api-docs/) for reference. |
| 57 | +- Admire the [>98% coverage report](https://7ph.github.io/vue-smart-suggest/coverage/) |
74 | 58 |
|
75 |
| -## License |
| 59 | +## Contributing |
76 | 60 |
|
77 |
| -`vue-smart-suggest` is open-sourced software licensed under the [MIT license](LICENSE.md). |
| 61 | +Having trouble? Found a bug? Want to contribute? Any kind of contribution is welcome. If you have any questions, please open an issue or create a pull request. |
0 commit comments