Code Monkey home page Code Monkey logo

scoutbar's Introduction


ScoutBar

⌨️ Spotlight for your app



npm

NPM

⚡️Overview

It has been observed that users who are familiar with the CMD + K shortcut for searching and performing complex actions within applications like Slack and Workspace by Facebook are able to navigate these apps more efficiently by 21%. This highlights the value of providing users with effective search and navigation tools.

With this in mind, we are excited to introduce Scoutbar - an easy-to-install React component that automates the CMD + K experience. Scoutbar is portable and extensible, making it a convenient solution for improving the search and navigation capabilities of your application. Give your users the ability to quickly find what they are looking for and increase their productivity with Scoutbar.

🔧 Installation

You can easily install this package with yarn or npm:

$ yarn add scoutbar

or

$ npm install scoutbar

✨ Features

  • 🤘 Super easy to install
  • 📦 It's tiny, only 400b gzipped
  • 🙅‍♂️ It's got keyboard nav support
    • And keyboard shortcuts to configure specific actions
  • 🔧 Flexible API
    • A simple data structure and function helper to customize your experience
  • 💪 Fully tested, typed, and reliable
  • 🌍 Works in CommonJS, ESM, and the browser
  • 🤓 Handy helpers included
  • 🧑 Zero dependencies

📖 Usage

One of the best things about it is that it is as simple as integrating one component. you have scoutbar on your app.

import React from 'react';
import { ScoutBar } from 'scoutbar';

export default function App() {
  return (
    <div className="App">
      <ScoutBar
        actions={({ createScoutAction }) => [
          createScoutAction({
            label: 'Get Started',
            description: 'Get started with scoutbar',
            href: '/',
          }),
        ]}
      />
    </div>
  );
}

Seeing is believing! There are clear descriptions of each utility, as well as instructions on how to use them, in the documentation.

🍷 Documentation See All

tutorial

Type -> Boolean

Default -> true

Allows you the ability to disable / hide scoutbar tutorial hints. i'e the section that tells users to navigate with the arrows or tabs. e.g

  <ScoutBar
    tutorial={false}
    ...
  />

noAnimation

Type -> Boolean

Default -> false

Allows you to disable every animation on scoutbar Disables every animations on scoutbar. this is by default true if scoutbar detects that the user has requested that the system minimize the amount of non-essential motion it uses.

  <ScoutBar
    noAnimation={false}
    ...
  />

theme

Type -> 'light' | 'dark' | 'auto'

Default -> 'light'

Allows you to switch the theme of the scoutbar depending on how you want it. auto switches to the theme of the current system.

  <ScoutBar
    theme="light"
    ...
  />

acknowledgement

Type -> Boolean

Default -> true

Show the scoutbar acknowledgement logo on the top right of the input bar.

  <ScoutBar
   acknowledgement={true}
    ...
  />

brandColor

Type -> String

Default -> #000

Allows you to set the official scoutbar brand color. it helps to match the color grade on your application

  <ScoutBar
   brandColor="red"
    ...
  />

placeholder

Type -> String | String[]

Default -> ['What would you like to do today ?','What do you need?', 'Lets help you navigate'],

Allows you to switch between different placeholder texts or just a single one.

  <ScoutBar
    placeholder={[
      'What products do you need ? ',
      'Whats the name of your phone ?'
    ]}

    or

    placeholder="What do you need ?"
    ...
  />

revealScoutbar

Type -> boolean

Default -> false

Reveal the scoutbar with an external action. PS forcefully opens the scoutbar

  <ScoutBar
revealScoutbar={// your state hook here }
    ...
  />

See All Documentation

🤔Thought Process

Contributing

When contributing to this repository, please first discuss the change you wish to make via an issue. This can be a feature request or a bug report. After a maintainer has triaged your issue, you are welcome to collaborate on a pull request. If your change is small or uncomplicated, you are welcome to open an issue and pull request simultaneously.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Running Scoutbar Locally

A local test environment has been setup for developers that wants to develop and contribute to scoutbar. to start up the dev server do the following

$ yarn install
$ yarn run dev // server running on http://localhost:3008

Linking Scoutbar Locally

Run

$ npm link

This will create a symbolic link in the /usr/local/lib/node_modules/ folder, that contains the global npm packages in the system, the ones installed using npm -g.

npm link scoutbar

Then we run this in the project we want to link scoutbar locally to

See More on contributing

🤝 License

MIT © codewonders.dev  ·  GitHub @adenekan41 / codewonders

scoutbar's People

Contributors

adenekan41 avatar daniel-encord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

scoutbar's Issues

Shortcut doesnt work well on windows

Trying to trigger this using WIN + K on windows 11 results in windows trying to open the mirrorcast app
I have not been able to find a reliable shortcut to trigger this without triggering OS level shortcuts and cant find a way of specifying a custom shortcut to bypass the issue.

Am i doing something wrong?

shortcut behavior unexpected in firefox

Shortcut focus problem

Steps to reproduce the issue

  1. press cmd + k in firefox and macOS

What's the expected result?

cursor focus in scoutbar input field

What's the actual result?

cursor focus in firefox search box (built-in shortcut)

Additional details / screenshot

圖issue

Add callback to action fn to close scoutbar

Problem
We want to close the scoutbar after performing some action programmatically.

Proposed Solution
Add some close callback in action fn:

action: ({ close }) => {
  // do something

  close()
}

Scoutbar scrolling disables on firefox

Scoutbar scrolling disables on firefox

Steps to reproduce the issue

  1. press cmd + k in firefox and macOS

What's the expected result?

Users can scroll through scoutbar

What's the actual result?

the bar is stuck

Additional details / screenshot

image

Input field behavior is wierd when typing character `k`

Input field behavior is wierd when typing character k

Steps to reproduce the issue

  1. press cmd + k (chrome, firefox, safari on macOS)
  2. key in character k anywhere, oops

What's the expected result?

key in character k immediately

What's the actual result?

k appears only when the key is pressed and held

Additional details / screenshot

bug-report-scoutbar-k-key

latest release breaks NextJS app

I have updated to the latest release and it has broken my app.
I havent looked into the issue in detail but it seems to be trying to access the window object when it doesnt exist

ReferenceError: window is not defined
    at Object.<anonymous> (\node_modules\scoutbar\dist\bundle-cjs\helpers\use-keyboard-navigation.js:24:16)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\Daniel\dev\flashcrm\node_modules\scoutbar\dist\bundle-cjs\index-5f7b1e16.js:19:37)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
111

Allow adding of custom components to createScoutAction

Description

Whilst going through this interface

export interface IScoutAction {

I discovered there is only a limited amount of things to be able to do with an action, and since the introduction of action customization https://www.scoutbar.co/docs/customization. I'll be a nice addition to be able to add on your custom components with our prefilled classes and your endless use of accessibility properties.

Reviewers note

  • N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.