Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Actions

ShareButton <pm-share-button>

Share button: opens the device's share sheet (phones, Safari, Edge) and copies the link where there is none.

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/share-button'; </script> <pm-share-button share-title="Prismora" text="One seed, every theme." url="https://prismora.design"></pm-share-button> <pm-share-button icon-only variant="ghost" label="Share this page"></pm-share-button>

Variants

Set with the variant attribute.

variant="solid"
variant="soft"
variant="outline"
variant="ghost"

Sizes

Set with the size attribute; controls keep touch-sized targets on phones.

size="xs"
size="sm"
size="md"
size="lg"

Tones

Set tone on the element, or data-tone on any ancestor to tone a whole area.

tone="accent"
tone="secondary"
tone="neutral"
tone="success"
tone="warning"
tone="danger"
tone="info"

States

Each state is one attribute.

Disabled

Overview

The page address is shared unless url is set. After a copy the button says so, visibly and to screen readers.

Attributes

AttributeTypeDefaultDescription
urlstring—Address to share (default: this page).
share-title
prop: shareTitle
string—Title passed to the share sheet (default: the page title).
textstring—Short text passed to the share sheet.
labelstringShareButton text (default "Share").
variant'solid' | 'soft' | 'outline' | 'ghost'—Visual style.
size'xs' | 'sm' | 'md' | 'lg'—Size: xs, sm, md or lg (md when not set).
icon-only
prop: iconOnly
booleanfalseShow only the icon; the label becomes the accessible name.
disabledbooleanfalseNot interactive.

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-shareonPmShareShared or copied.
pm-erroronPmErrorSharing and copying both failed.

CSS parts

PartDescription
::part(base)The button.

Methods

share()