Skip to content

Commit 0cff6f9

Browse files
committed
feat: start autocomplete pattern
1 parent 1d695df commit 0cff6f9

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
import { BrowserSupport } from "@app/_components/browser-support";
2+
import { Callout } from "nextra/components";
3+
4+
# Autocomplete
5+
6+
**_(Also called )_**
7+
8+
- Autosuggest
9+
10+
<Callout type="warning">
11+
This page is a work in progress. Don't consider it complete yet.
12+
</Callout>
13+
14+
## Overview
15+
16+
The **Autocomplete** is an interactive input component that help users quickly find and select values from a predefined list of options as they type.
17+
18+
They combine the flexibility of text input with dropdown-style selection, providing suggestions that match the user's input in real-time. This pattern reduces errors, speeds up data entry, and improves the overall form completion experience.
19+
20+
## Use Cases
21+
22+
### When to use:
23+
24+
- [Use case 1]
25+
- [Use case 2]
26+
- [Use case 3]
27+
28+
### When not to use:
29+
30+
- [Anti-pattern 1]
31+
- [Anti-pattern 2]
32+
- [Anti-pattern 3]
33+
34+
### Common scenarios and examples
35+
36+
- [Example 1]
37+
- [Example 2]
38+
- [Example 3]
39+
40+
## Benefits
41+
42+
- [Benefit 1]
43+
- [Benefit 2]
44+
- [Benefit 3]
45+
46+
## Anatomy
47+
48+
```mermaid
49+
50+
```
51+
52+
### Component Structure
53+
54+
1. **Container**
55+
56+
2. **Input**
57+
58+
3. **Label**
59+
60+
4. **Clear Button**
61+
62+
## Best Practices
63+
64+
### Content
65+
66+
**Do's ✅**
67+
68+
- [Best practice 1]
69+
- [Best practice 2]
70+
71+
**Don'ts ❌**
72+
73+
- [Anti-pattern 1]
74+
- [Anti-pattern 2]
75+
76+
### Accessibility & UX
77+
78+
**Do's ✅**
79+
80+
- [Best practice 1]
81+
- [Best practice 2]
82+
83+
**Don'ts ❌**
84+
85+
- [Anti-pattern 1]
86+
- [Anti-pattern 2]
87+
88+
### Visual Design
89+
90+
**Do's ✅**
91+
92+
- [Best practice 1]
93+
- [Best practice 2]
94+
95+
**Don'ts ❌**
96+
97+
- [Anti-pattern 1]
98+
- [Anti-pattern 2]
99+
100+
### Layout & Positioning
101+
102+
**Do's ✅**
103+
104+
- [Best practice 1]
105+
- [Best practice 2]
106+
107+
**Don'ts ❌**
108+
109+
- [Anti-pattern 1]
110+
- [Anti-pattern 2]
111+
112+
## Code Examples
113+
114+
### Basic Implementation
115+
116+
```html
117+
<!-- Basic implementation example -->
118+
```
119+
120+
## SEO
121+
122+
- [SEO consideration 1]
123+
- [SEO consideration 2]
124+
125+
## Testing Guidelines
126+
127+
### Functional Testing
128+
129+
**Should ✓**
130+
131+
- [Test case 1]
132+
- [Test case 2]
133+
134+
## Design Tokens
135+
136+
These design tokens follow the [Design Tokens Format](https://design-tokens.github.io/community-group/format/) specification and can be used with various token transformation tools to generate platform-specific variables.
137+
138+
### Autocomplete Tokens in DTF Format
139+
140+
```json:.json
141+
{
142+
"$schema": "https://design-tokens.org/schema.json",
143+
"Autocomplete": {}
144+
}
145+
```
146+
147+
## Resources
148+
149+
### Articles
150+
151+
- [9 UX Best Practice Design Patterns for Autocomplete Suggestions](https://baymard.com/blog/autocomplete-design) by Baymard Institute
152+
- [Best Practices: Designing autosuggest experiences](https://uxmag.com/articles/best-practices-designing-autosuggest-experiences)
153+
154+
### Libraries
155+
156+
- [Library 1]
157+
- [Library 2]

templates/docs/component.mdx.hbs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class {{name}} container
4747
end
4848
```
4949

50+
### Component Structure
51+
52+
1. **Container**
53+
5054
## Best Practices
5155

5256
### Content

0 commit comments

Comments
 (0)