First, install the package in your project:
npm install @singulio/singulor
yarn add @singulio/singulimport { SingulJS } from '@singulio/singul/react';
const AUTH_TOKEN = 'replace-with-your-token';
const CUSTOM_STYLES = { container: { width: '400px' } };
export default function App() {
return (
<section>
<h1>Singul Search</h1>
<SingulJS
authToken={AUTH_TOKEN}
placeholder="Your placeholder.."
customStyles={CUSTOM_STYLES}
/>
</section>
);
}import { SingulJS } from '@singulio/singul/react';
const AUTH_TOKEN = 'replace-with-your-token';
const CUSTOM_STYLES = { container: { width: '400px' } };
export default function page() {
return (
<section>
<h1>Singul Search</h1>
<SingulJS
authToken={AUTH_TOKEN}
placeholder="Your placeholder.."
customStyles={CUSTOM_STYLES}
/>
</section>
);
}<template>
<SingulJS
auth="dasd"
placeholder="Search apps..."
:customStyles="{ input: { width: '4000px' } }"
@appSelected="handleAppSelected"
/>
</template>
<script>
import { SingulJS } from '@singulio/singul/vue';
export default {
name: 'HelloWorld',
props: { msg: String },
components: { SingulJS },
methods: {
handleAppSelected(detail) {
console.log('selected app', detail);
},
},
};
</script>