In the <head> tag
Note that you need to change the {VERSION} part as
appropriate (e.g. 0.1.2).
Please check the version information here:
<script src="https://cdn.jsdelivr.net/npm/@konemono/nostr-share-component@{VERSION}/dist/nostr-share-component.min.js"></script>
In the <body> tag
<nostr-share></nostr-share>
If empty, the title and URL of the current site will be shared.
default, icon, or mini. This changes the button style
as shown in the example.
icon-size:
For the icon type, you can specify the icon size using the icon-size attribute.
Customize the style of specific parts of the nostr-share component using the ::part
pseudo-element. The component includes two primary parts that can be styled:
nostr-share element.nostr-share element.For example, you can style the button part as follows:
nostr-share::part(button) {
background-color: rgb(0, 136, 255);
}
nostr-share::part(button):hover {
background-color: rgb(255, 0, 0);
}
And you can style the text part like this:
nostr-share::part(text) {
font-style: italic;
font-family: 'Courier New', Courier, monospace;
font-size: medium;
}
(In v0.3 and earlier, custom styles were defined using the data-style field.)