Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sharebuttons Bundle Laravel Package

c975l/sharebuttons-bundle

View on GitHub
Deep Wiki
Context7

ShareButtonsBundle

THIS BUNDLE HAS BEEN REPLACED BY c975L/SocialBundle

Symfony bundle that provides a Twig function to embed share buttons for popular social networks, with SVG icons included and multiple display styles.

GitHub Packagist Version PHP Version


Features

  • Single Twig function sharebuttons() to embed share buttons anywhere in a template
  • Supports a configurable list of social networks
  • main shorthand to display the most common networks
  • Multiple display styles: distinct, ellipse, circle, toolbar
  • Alignment options: left, center, right
  • Icon-only or icon + text display
  • Optional custom URL override
  • SVG icons embedded — no external CSS or JS required
  • Configuration managed via c975L/ConfigBundle

Requirements


Installation

Download

composer require c975l/sharebuttons-bundle

Enable routes

Add the following to config/routes.yaml:

c975_l_share_buttons:
    resource: "@c975LShareButtonsBundle/"
    type: attribute
    prefix: /
    # For multilingual websites:
    # prefix: /{_locale}
    # defaults: { _locale: '%locale%' }
    # requirements:
    #     _locale: en|fr|es

Load configuration values

php bin/console c975l:config:load-all

Then use the ConfigBundle dashboard to set the values for each key.


Usage

Use the sharebuttons() Twig function to render share buttons:

{# Full signature #}
{{ sharebuttons(shares, style, alignment, displayIcon, displayText, url) }}

{# Display the main social networks with default style #}
{{ sharebuttons('main') }}

{# Custom selection, ellipse style, centered, icon only #}
{{ sharebuttons(['facebook', 'linkedin', 'email'], 'ellipse', 'center', true, false) }}

{# Override the shared URL #}
{{ sharebuttons('main', 'distinct', 'center', true, false, 'https://example.com/my-page') }}
Parameter Type Default Description
shares array|'main' Network list, or 'main' for the default set
style string 'distinct' distinct, ellipse, circle, or toolbar
alignment string 'center' left, center, or right
displayIcon bool true Show network icon
displayText bool false Show network name
url string|null null Override the shared URL (defaults to current page)

If this project helps you save development time, consider sponsoring via the Sponsor button at the top of the GitHub page. Thank you!

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
cadot.eu/make
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky