🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-ajala

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ajala

### A lightweight React wrapper built around ajala.js

0.2.8
latest
Source
npm
Version published
Weekly downloads
13
-95.9%
Maintainers
1
Weekly downloads
 
Created
Source

React-Àjàlá.js

A lightweight React wrapper built around ajala.js


checkout ajala.js here


Quick start

npm i react-ajala
import { AjalaJourneyProvider } from "react-ajala";
import YourComponent from "./where-ever-it-kept";
import "ajala.js/dist/ajala.css";

function App() {
  return (
    <AjalaJourneyProvider
      steps={[
        {
          target: ".random",
          id: "1",
          title: "Step 2 Title",
          content: "step 2 content lorem ipson",
          tooltip_placement: "left_top",
          enable_target_interaction: true,
        },
      ]}
    >
      <YourComponent />
    </AjalaJourneyProvider>
  );
}

Please note: That you only need import "ajala.js/dist/ajala.css"; when you are using ajala default tooltip, you don't need it if you provide your own CustomTooltip component.

AjalaJourneyProvider Props

PropertyTypeDescription
stepsTStepAn array of object that's passed down as ajala.js steps, for a full description of this props please check ajala.js doc here
optionsTAjalaOptionsAn object that's passed down to to customize ajala.js, for a full description of this props please check ajala.js doc here
CustomTooltipJSX.Element or ReactNodeA React component that get's render as ajala.js custom_tooltip, this component will accept a prop of TReactAjalaCustomTooltipProps which is the active step and an ajala instance
CustomArrowJSX.Element or ReactNodeA React component that get's render as ajala.js custom_arrow.
getInstanceFunctionA callback function that gets called with ajala.js instance, can be used to get ajala instance at the parent file where AjalaJourneyProvider is being used.

useAjalaJourneyContext

react-ajala also export a useAjalaJourneyContext hook that can be used to get ajala instance down your component tree. Please note that your component must be wrapped with AjalaJourneyProvider to use useAjalaJourneyContext

Example using useAjalaJourneyContext

import { useAjalaJourneyContext } from "react-ajala";

function YourComponentWrappedWithAjalaJourneyProvider() {
  const ajalaInstance = useAjalaJourneyContext();
  return <div> ...Some content </div>;
}

Example using CustomTooltip and CustomArrow

import { AjalaJourneyProvider } from "react-ajala";
import YourComponent from "./where-ever-it-kept";
import YourCustomTooltipComponent from "./where-ever-it-kept";
import YourCustomArrowComponent from "./where-ever-it-kept";

function App() {
  return (
    <AjalaJourneyProvider
      steps={[
        {
          target: ".random",
          id: "1",
          title: "Step 2 Title",
          content: "step 2 content lorem ipson",
        },
      ]}
      CustomTooltip={YourCustomTooltipComponent}
      CustomArrow={YourCustomArrowComponent}
    >
      <YourComponent />
    </AjalaJourneyProvider>
  );
}

TReactAjalaCustomTooltipProps Shape

export interface TReactAjalaCustomTooltipProps {
  active_step: TSteps | undefined | null;
  ajala: AjalaJourney | null;
}

Contributions

Feel free to submit pull requests, create issues or spread the word.

License

MIT © Adeyanju Adeyemi

Keywords

walkthrough

FAQs

Package last updated on 19 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts