Mercoa React Component Library
Setup
npm install --save @mercoa/react
yarn add @mercoa/react
Usage
The Mercoa React component library ships with a CSS stylesheet (based on tailwindcss) that needs to be imported.
The Mercoa React component library uses a React Context called MercoaSession
. You can wrap your full app with this context, or only include it on specific routes and pages. All Mercoa components need to be inside a valid MercoaSession
component.
Basic Usage
import '@mercoa/react/dist/tailwind.base.css'
import '@mercoa/react/dist/style.css'
import { MercoaSession } from '@mercoa/react'
export default function Index() {
const token = 'YOUR_ENTITY_TOKEN'
return <MercoaSession token={token} />
}
Components
Components are documented at react.mercoa.com!