@jswork/react-kbar
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

react-kbar

React kbar wrapper.

version license size download

installation

npm install -S @jswork/react-kbar

usage

  1. import css
@import "~@jswork/react-kbar/dist/style.css";

// or use sass
@import "~@jswork/react-kbar/dist/style.scss";

body {
  font-family: Arial, Helvetica, sans-serif;
}

// customize your styles:
$react-kbar-options: ()
  1. import js
import React from 'react';
import ReactKbar from '../../src/main';
import { createGlobalStyle } from 'styled-components';
// import styled from 'styled-components';
const GlobalStyleComp = createGlobalStyle`
  body{
    font-family: Arial, Helvetica, sans-serif;
  }
`;

const actions = [
  {
    id: 'blog',
    name: 'Blog',
    shortcut: ['b'],
    keywords: 'writing words',
    perform: () => (window.location.pathname = 'blog')
  },
  {
    id: 'contact',
    name: 'Contact',
    shortcut: ['c'],
    keywords: 'email',
    perform: () => (window.location.pathname = 'contact')
  }
];

export default () => {
  return (
    <>
      <ReactKbar actions={actions}>
        <button>Cmd + K active ME 🦄</button>
      </ReactKbar>
      <GlobalStyleComp />
    </>
  );
};

preview

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/react-kbar

Homepage

js.work

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

12.6 kB

Total Files

9

Last publish

Collaborators

  • afeiship
  • yujiao.luo