Appearance
NostrNote Component
Displays a Nostr note (kind:1 or kind:1111 or any other similar kind) with NIP-27 text formatting (the same as in <nostr-text>) as well as metadata about the note author, parent and root, formatted time and permalink.
Usage
html
<nostr-note ref="nevent..." />Attributes
ref: Note reference (nevent format)event: Raw event JSONrelays: Comma-separated list of relay URLstemplate: ID of template element to use for custom rendering
Styling Parts
container: The main containerheader: Note header sectionauthor-link: Author name/profile linkauthor-name: Author's display nameauthor-npub-short: Shortened npubparent-link: Link to parent notelink: Note permalinkcontent: Note contenttext: Text contentreference: Referenced contenturl: URL linksimage: Imagesvideo: Video contentaudio: Audio contentrelay: Relay references
External Templates
This component supports external templates through the template attribute:
html
<template id="my-note-template">
<div part="container">
<header part="header">
<!-- Custom template structure -->
</header>
<div part="content"></div>
</div>
</template>
<nostr-note template="my-note-template" ref="nevent..." />