@docsearch/js
Advanced tools
Comparing version 3.0.0-alpha.40 to 3.0.0-alpha.41
{ | ||
"name": "@docsearch/js", | ||
"description": "JavaScript package for DocSearch, the best search experience for docs.", | ||
"version": "3.0.0-alpha.40", | ||
"version": "3.0.0-alpha.41", | ||
"license": "MIT", | ||
@@ -24,3 +24,3 @@ "homepage": "https://docsearch.algolia.com", | ||
"scripts": { | ||
"build:clean": "rimraf ./dist", | ||
"build:clean": "rm -rf ./dist", | ||
"build:esm": "cross-env BUILD=esm rollup --config", | ||
@@ -35,5 +35,5 @@ "build:types": "tsc -p ./tsconfig.declaration.json --outFile ./dist/esm/index.d.ts", | ||
"dependencies": { | ||
"@docsearch/react": "3.0.0-alpha.40", | ||
"@docsearch/react": "3.0.0-alpha.41", | ||
"preact": "^10.0.0" | ||
} | ||
} |
@@ -13,4 +13,35 @@ # @docsearch/js | ||
## Get started | ||
If you don’t want to use a package manager, you can use a standalone endpoint: | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script> | ||
``` | ||
To get started, you need a [`container`](https://docsearch.algolia.com/docs/api#container) for your DocSearch component to go in. If you don’t have one already, you can insert one into your markup: | ||
```html | ||
<div id="docsearch"></div> | ||
``` | ||
Then, insert DocSearch into it by calling the [`docsearch`](https://docsearch.algolia.com/docs/api) function and providing the container. It can be a [CSS selector](https://developer.mozilla.org/en-us/docs/web/css/css_selectors) or an [Element](https://developer.mozilla.org/en-us/docs/web/api/htmlelement). | ||
Make sure to provide a [`container`](https://docsearch.algolia.com/docs/api#container) (for example, a `div`), not an `input`. DocSearch generates a fully accessible search box for you. | ||
```js app.js | ||
import docsearch from '@docsearch/js'; | ||
import '@docsearch/css'; | ||
docsearch({ | ||
container: '#docsearch', | ||
appId: 'YOUR_APP_ID', | ||
indexName: 'YOUR_INDEX_NAME', | ||
apiKey: 'YOUR_SEARCH_API_KEY', | ||
}); | ||
``` | ||
## Documentation | ||
[Read documentation →](https://autocomplete-experimental.netlify.app/docs/docsearch-js) | ||
[Read documentation →](https://docsearch.algolia.com/docs/DocSearch-v3) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47
760299
774
+ Added@docsearch/css@3.0.0-alpha.41(transitive)
+ Added@docsearch/react@3.0.0-alpha.41(transitive)
- Removed@docsearch/css@3.0.0-alpha.40(transitive)
- Removed@docsearch/react@3.0.0-alpha.40(transitive)