Zero Build Setup
Just add a script tag and use the components. Works anywhere -- static sites, server-rendered apps, or simple HTML pages.
Add a Nostr username display with just one line:
<script src="https://cdn.jsdelivr.net/npm/nostr-web-components/dist/nostr-name.js"></script>
<nostr-name pubkey="npub..."></nostr-name>
Use CSS parts to style components:
nostr-name::part(name) {
color: blue;
font-weight: bold;
}
Or with Tailwind:
<nostr-name
class="part-[name]:text-blue-500 part-[name]:font-bold"
pubkey="npub..."
></nostr-name>
See the Tailwind installation guide, it's easy.