Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nostr-components/nostr-event

nostr-event
https://github.com/nostr-components/nostr-event

component nostr webcomponent webcomponents

Last synced: about 1 month ago
JSON representation

nostr-event

Awesome Lists containing this project

README

        


nostr-event



nostr-event

---


Documentation


---

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nostr-components/nostr-event/blob/gh-pages/LICENSE)
[![npm](https://img.shields.io/npm/v/nostr-event)](https://npmjs.com/package/nostr-event)
[![npm](https://img.shields.io/npm/dw/nostr-event.svg)](https://npmjs.com/package/nostr-event)
[![Github Stars](https://img.shields.io/github/stars/nostr-components/nostr-event.svg)](https://github.com/nostr-components/nostr-event/)

# Nostr-Event Web Component

## Description

`nostr-event` is a reusable Web Component that displays Nostr events with rich media support including images, videos and YouTube embeds. It takes an event as a JSON string, rendering it beautifully in any HTML document.

## Features

- Displays user content including text, images, videos and YouTube links.
- Offers responsive design, adapting media size to the available space.
- Includes raw event data, giving insight into the underlying structure of Nostr events.

## Installation

To use the `nostr-event` web component, include it via a `` tag:

```html
<script type="module" src="nostr-event.js">
```

Replace "nostr-event.js" with the actual path to your JavaScript file that contains the definition for `nostr-event` web component.

## Usage

Include the `nostr-event` element in your HTML and provide an event as a JSON string via the `event` attribute:

```html

```

The `event` attribute should contain a JSON string with `content` and `pubkey` properties at a minimum.

## Example

Here is a simple HTML page that imports and uses the `nostr-event` web component:

```html

Nostr Event


```

## Support

For support or any questions, open an issue on this repository.

## License

This project is open source under the [MIT license](LICENSE).