0.1.1 • Published 5 years ago
react-iubenda-policy v0.1.1
React Component for Iubenda.com Cookie and Privacy Policy
This component will let you easily use the embedded Iubenda generated policies in your React project.
Install
npm i -S react-iubenda-policy
Usage
- Import the Iubenda component
- Find your policy id in your Iubenda dashboard. The policy id is the number at the end of the policy direct link.
- For example: https://www.iubenda.com/privacy-policy/123456
- Your policy id will be 123456
- Put the component in your page.
Properties
id
: the policy id.type
: one of the following options:privacy
to show the Privacy Policy button (default)cookie
to show the Cookie Policy buttonterms-and-conditions
to show the Terms and conditions button
style
: one of the following options:nostyle
: renders the link as text. You can style the link in the wrapping div or span. (default)black
: renders a black button with white text.white
: renders a white button with black text.
Note that for the Terms and Conditions you should use the internationalized type, for example termini-e-condizioni
for the Italian language or condiciones-de-uso
for Spanish. Check the Integration section in your Iubenda dashboard.
Example
import React from 'react'
import Iubenda from 'react-iubenda-policy'
const Policy = () => {
const myPolicy = 123 // your policy id
return (
<div>
{/* Renders the Privacy Policy link with the text 'Privacy Policy' */}
<Iubenda id={myPolicy}/>
<Iubenda id={myPolicy} type='terms-and-conditions' styling='nostyle'>
Terms and conditions
</Iubenda>
<Iubenda id={myPolicy} type='privacy' styling='white'>
Privacy Policy
</Iubenda>
<Iubenda id={myPolicy} type='cookie' styling='black'>
Cookie Policy
</Iubenda>
</div>
)
}