GitHub

Social Share Button

Social media share buttons

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { SocialShareButton } from "@corew500/ui/social-share-button"

<SocialShareButton>Content</SocialShareButton>

Variants

socialShareButtonVariants

AxisValuesDefault
variant
defaultoutlineghost
default
size
smmdlgicon
md

API Reference

Props

PropTypeDefaultDescription
platform*enumSocial platform to share to
url*stringURL to share
titlestringShare title/text (used for Twitter title, Email subject)
hashtagstringFacebook hashtag (include the #)
bodystringEmail body text
iconenumCustom icon to override the default platform icon
hideIconenumfalseHide the icon completely
classNamestringAdditional CSS classes
variantenumdefault
sizeenummd

Accessibility

Keyboard Navigation

  • Keyboard accessible via standard button interaction

Focus Management

  • Focus states use ring tokens for visibility

Screen Readers

  • - Platform icons include aria-hidden="true" as they are decorative
  • Button text provides accessible name for screen readers

Additional

  • For icon-only buttons, the platform label is still rendered but visually hidden

Localization

Translatable Content

  • - Default platform labels ("Twitter", "Facebook", etc.) are English
  • Pass translated text via children prop to localize button labels
  • The `title` prop should contain translated share text
  • Email `body` and `subject` (title) should be pre-translated

Related

Related Components