Skip to content

Latest commit

 

History

History
105 lines (68 loc) · 2.12 KB

sharing-bar.md

File metadata and controls

105 lines (68 loc) · 2.12 KB

SharingBar

Source

A context menu for sharing a link and some text on various platforms.

Usage

You should have the chayns-components package installed. If that is not the case already, run

yarn add chayns-components

or

npm i chayns-components

After the chayns-components package is installed, you can import the component and use it with React:

import React from 'react'
import { SharingBar } from 'chayns-components';

// ...

<SharingBar {...} />

Props

The SharingBar-component takes the following props:

Name Type Default Required
link string
linkText string ''
className string
stopPropagation boolean false
style { [key: string]: string | number }
children ReactNode

link

link?: string

The link that should be shared.


linkText

linkText?: string

A text that will be added in front of the shared link.


className

className?: string

A classname string that will be applied to the container element.


stopPropagation

stopPropagation?: boolean

Wether click events should be prevented from propagating to parent elements.


style

style?: { [key: string]: string | number }

A React style object that will be applied to the container element.


children

children?: ReactNode

The children nodes of the SharingBar.