npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mintlify/widget-react

v0.0.11

Published

A React component for the Mintlify chat widget

Downloads

3,566

Readme

Mintlify Widget

A React component for the Mintlify chat widget

Installation

To install the @mintlify/widget-react component in your app, use npm/yarn/pnpm:

npm install @mintlify/widget-react
yarn add @mintlify/widget-react
pnpm add @mintlify/widget-react

Usage

Here is a basic example of how to use the component in your React application:

<MintlifyWidget
    connection={{
        apiKey: 'your api key',
    }}
/>

You can get an API key by visiting the Mintlify dashboard and generating a new API key.

Props

The MintlifyWidget component accepts the following props:

| Prop | Type | Description | | ------------ | ------------------------------------------------------------------- | ---------------------------------------------------------- | | connection | MintlifyWidgetConnectionProps | Information needed to connect to our API. Required. | | display? | MintlifyWidgetDisplayProps | Configurations for the widget appearance and interactions. | | tracking? | MintlifyWidgetTrackingFunctions | Callback functions for tracking analytics. |

MintlifyWidgetConnectionProps

| Prop | Type | Description | | -------- | -------- | ----------------------------------------------------------- | | apiKey | string | Widget API key generated from Mintlify dashboard. Required. |

MintlifyWidgetDisplayProps

| Prop | Type | Description | | ------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------- | | trigger? | MintlifyWidgetDisplayTriggerProps | Appearance of the trigger. | | colors? | MintlifyWidgetDisplayColorsProps | Colors used across the widget. | | chat? | MintlifyWidgetDisplayChatProps | Configs specific to AI chat. | | isDarkMode? | boolean | Controlled dark mode appearance. Defaults to OS preference. |

MintlifyWidgetDisplayTriggerProps

| Prop | Type | Description | | ------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | | type? | 'button'|'input' | Type of the trigger to display. Defaults to button. | | label? | string | Label displayed in the trigger. Defaults to Get help for the button trigger and Ask anything... for the input trigger. | | buttonIcon? | 'chat'|'sparkles'|'mintlify' | Icon used in the trigger. Only available for the button trigger. Defaults to chat. | | iconOnly? | boolean | Only show icon in the trigger or not. Defaults to false. |

Here is an overview of what the trigger looks like with different configurations.

| type='input' | | | -------------- | ------------------------------------------------------------ | | | image |

| type='button' | 'chat' | 'sparkles' | 'mintlify' | | ---------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | iconOnly=false | image | image | image | | iconOnly=true | image | image | image |

MintlifyWidgetDisplayColorsProps

| Prop | Type | Description | | --------------- | -------- | -------------------------------------------------------- | | primary? | string | Primary color used in the widget. Defaults to #0D9373. | | primaryLight? | string | Primary color in dark mode. Defaults to #55D799. |

MintlifyWidgetDisplayChatProps

| Prop | Type | Description | | ------------------------ | ---------- | ------------------------------------------------------------------ | | openCitationInSameTab? | boolean | Open the citation url in the same tab or not. Defaults to false. | | exampleQueries? | string[] | Example queries to prompt the user to ask. Defaults to []. |

MintlifyWidgetTrackingFunctions

| Prop | Type | Description | | --------------------- | ------------------------------------------ | -------------------------------------------------- | | trackChatEnter | ()=> void | Triggered when the user opens the chat widget. | | trackCitationClick | (title: string, url: string)=> void | Triggered when the user clicks on a citation. | | trackChatThumbsUp | (query: string, response: string)=> void | Triggered when the user thumbs up on a response. | | trackChatThumbsDown | (query: string, response: string)=> void | Triggered when the user thumbs down on a response. | | trackChatFollowup | (query: string)=> void | Triggered when the user asks a question. | | trackChatClose | (queriesCount: number)=> void | Triggered when the user exits the chat widget. |

Questions and Support

If you have any questions or need support on using the widget, please reach out to us via [email protected].

If you're new to Mintlify, sign up today at mintlify.com.