-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(Autocomplete): add RAC Autocomplete docs #7784
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
somehow we need to find a way to emphasize that Autocomplete works with both TextField and SearchField, and with both Menu and ListBox. Right now the examples suggest it works only with SearchField and Menu. Maybe we should mix them up a bit and provide some more varied examples that people might google for as well? Searchable menu, Command palette, Filterable Select (like the story we have), etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* A autocomplete combines a text input with a menu, allowing users to filter a list of options to items matching a query. |
unrelated to the changes here but i noticed that the description says "a autocomplete..." instead of "an autocomplete"
packages/react-aria-components/docs/examples/command-palette.mdx
Outdated
Show resolved
Hide resolved
|
||
return ( | ||
<div className="bg-linear-to-r from-indigo-500 to-violet-500 p-8 h-[340px] rounded-lg flex flex-col items-center justify-center"> | ||
<div className="flex flex-col gap-1 w-[320px] rounded-md bg-white shadow-lg"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to make this into a Dialog that you could open with Command K (or by clicking a button)?
This reverts commit 4710c1b.
…um into rac-autocomplete-docs
packages/react-aria-components/docs/examples/command-palette.mdx
Outdated
Show resolved
Hide resolved
packages/react-aria-components/docs/examples/command-palette.mdx
Outdated
Show resolved
Hide resolved
packages/react-aria-components/docs/examples/command-palette.mdx
Outdated
Show resolved
Hide resolved
packages/react-aria-components/docs/examples/command-palette.mdx
Outdated
Show resolved
Hide resolved
## API Changes
react-aria-components/react-aria-components:UNSTABLE_Autocomplete-UNSTABLE_Autocomplete {
- children: ReactNode
- defaultInputValue?: string
- filter?: (string, string) => boolean
- inputValue?: string
- onInputChange?: (string) => void
- slot?: string | null
-} /react-aria-components:UNSTABLE_AutocompleteContext-UNSTABLE_AutocompleteContext {
- UNTYPED
-} /react-aria-components:UNSTABLE_AutocompleteStateContext-UNSTABLE_AutocompleteStateContext {
- UNTYPED
-} /react-aria-components:Autocomplete+Autocomplete {
+ children: ReactNode
+ defaultInputValue?: string
+ filter?: (string, string) => boolean
+ inputValue?: string
+ onInputChange?: (string) => void
+ slot?: string | null
+} /react-aria-components:AutocompleteContext+AutocompleteContext {
+ UNTYPED
+} /react-aria-components:AutocompleteStateContext+AutocompleteStateContext {
+ UNTYPED
+} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna merge this so we can get the code changes in for testing. I will send another PR to add a Searchable Select component.
|
||
This example shows an `AutocompleteClearButton` component that can be placed within an `Autocomplete` to allow the user to clear the input. | ||
|
||
```tsx example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is still a little weird because the search field already has a clear button too. 🤔
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: