1.0.0-beta.13 • Published 2 months ago

@orama/searchbox-legacy v1.0.0-beta.13

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

Orama Searchbox

This webcomponent follows the open-wc recommendation.

Installation

npm i @orama/searchbox

Usage

<script type="module">
  import '@orama/searchbox/orama-searchbox-component.js';
</script>

<orama-searchbox-component
  colorScheme='light'
  apiEndpointConfig='https://cloud.orama.foo/searchbox/{your-searchbox-name}/'
  apiKeyConfig='xxx'
>
  some placeholder
</orama-searchbox-component>

Properties/Attributes

PropertyTypeDescription
colorSchemeStringIt can be one among light, dark, auto. Choose auto if you want the color scheme to depend to the color system preferences
apiEndpointConfigStringThis is the endpoint that you can use to fetch the configuration object for your searchbox component
apiKeyConfigStringThis is the api key that will be used to authenticate your request to the `apiEndpointConfig
showFullscreenOnMobileStringThis will set the mobile version to fullscreen mode

Events

NameDescription
orama-wc-searchbox:see-allTriggered when clicking the See all link
orama-wc-searchbox:see-itemTriggered when clicking each search result item

Linting and formatting

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

Tooling configs

For most of the tools, the configuration is in the package.json to reduce the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.

Local Demo with web-dev-server

npm start

To run a local development server that serves the basic demo located in demo/index.html