An Interest In:
Web News this Week
- April 15, 2024
- April 14, 2024
- April 13, 2024
- April 12, 2024
- April 11, 2024
- April 10, 2024
- April 9, 2024
I made DEV.to widget for websites/blogs
Hey Everyone! So I made an (Unofficial) DEV.to widget / profile-card which you can use in your websites and blogs (You just have to copy-paste 2 lines of code :D).
Here's how it looks like
Usage ( JUST 2 LINES OF CODE :D )
<dev-widget data-username="saurabhdaware"></dev-widget> <!-- Place script tag before the end of the body tag --> <script src="https://unpkg.com/[email protected]/dist/card.component.mjs" type="module"></script>
And BOOM that's it! Just put your dev.to username in data-username attribute and you will get your profile card :D
If you want to install it as ES6 module (Mostly used in frameworks)
npm install --save dev-widget
and import at the top of your file
import 'dev-widget'
Then you can use
<dev-widget data-username="saurabhdaware"></dev-widget>
There are some other attributes like data-width
, data-limit
You can checkout full documentation on my GitHub:
saurabhdaware / DEV-widget
Unofficial Widget/profile card for https://dev.to/
DEV widget
Codepen: https://codepen.io/saurabhdaware/pen/NWWbOvv
Unofficial Widget / profile card for dev.to.
You can use it in your website/blog and show off your DEV.to articles
Installation and Usage
- Through script tag
<dev-widget data-username="saurabhdaware"></dev-widget> <!-- Place script tag before the end of the body tag --> <script src="https://unpkg.com/[email protected]/dist/card.component.mjs" type="module"></script>
- As NPM module
This can be used in React, Vue and almost any other frontend framework
npm install --save dev-widget
Inside your framework component
import 'dev-widget'
Attributes Guide
attributes | description | default |
---|---|---|
data-username | Your DEV.to Username | |
data-width | Width of the card | 300px |
data-name (optional) | Name to display on card | Will be fetched from API |
data-limit | Number of articles to display | 30 |
Note: Value of data-limit
should not be too high. An API request has to be made
Do the repository
Also, for the hacktoberfest, if anyone wants to contribute to this project, I would love to help. You can checkout CONTRIBUTING.md for contribution guidelines.
Original Link: https://dev.to/saurabhdaware/i-made-dev-to-widget-for-websites-blogs-40p2
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To