Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

attach-live/attach-embeds-react

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Attach Embeds React

React components for Attach Embeds

Installation

npm

$ npm install --save attach-embeds attach-embeds-react

yarn

$ yarn add attach-embeds attach-embeds-react

Usage

import React from 'react'
import { attach, Reactions, Preview } from 'attach-embeds-react'

class App extends React.Component {
	componentDidMount() {
		if (!attach.isInitialized()) {
			attach.setProperties({
				'attach:item': `https://www.attach.live`,
				'attach:reactions:hide-sections': ['comments', 'videos'],
			})

			attach.initialize()
		}
	}

	render() {
		return (
			<>
				<div>
					<Reactions item="https://developers.attach.live" />
				</div>
				<div>
					<Reactions properties={{ hide-sections: 'videos' }} />
				</div>
				<div>
					<Preview />
				</div>
			</>
		)
	}
}

attach

Embeds API, convenient re-export from attach-embeds

Components

All components accept these common props:

  • className, style
  • properties - object, set properties local to the embed
  • item - same as setting properties={{ 'attach:item': '...' }}

Reactions

Renders the reactions embed.

Preview

Renders the preview embed.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.