Skip to content

tryfoobar/react-native-commandbar

Repository files navigation

CommandBar Logo

React Native CommandBar

CI

Copilot & HelpHub in React Native

About

React Native CommandBar was built as a wrapper around CommandBarIOS and CommandBarAndroid repos and uses both as dependencies.

Installation

Minimum iOS Version: 13.0 Minimum Android Version: 28

yarn add @commandbar/react-native
npm install @commandbar/react-native

Usage

Run the Example App

  1. Clone the repo: git clone https://github.com/tryfoobar/react-native-commandbar && cd react-native-commandbar
  2. Install dependencies: yarn
  3. Run the example: yarn example ios or yarn example android

Open HelpHub Bottom Sheet

import { Button, View } from 'react-native';
import { CommandBar } from '@commandbar/react-native';

const MyComponent = () => {
  return (
    <View>
      <Button
        title="Open"
        onPress={() => CommandBar.openHelpHub({ orgId: 'your_org_id' })}
      />
    </View>
  );
};

Open HelpHub Bottom Sheet to a specific Article

import { Button, View } from 'react-native';
import { CommandBar } from '@commandbar/react-native';

const MyComponent = () => {
  return (
    <View>
      <Button
        title="Open Support Article"
        onPress={() => CommandBar.openHelpHub({ orgId: 'your_org_id' }, 123456)}
      />
    </View>
  );
};

Render a HelpHub View

import { Button, View } from 'react-native';

const MyComponent = () => {
  return (
    <View style={{ flex: 1 }}>
      <HelpHubView orgId="your_org_id" />
    </View>
  );
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library