5 Github Elements you have to try

Contents

Intro

Time Elements

Image Cropping Element

File Attachment Element

Copy Element

Text Expander Element

Summary

Intro

I’m a big fan of web components. Reusable web elements that can work anywhere.

A frien…


This content originally appeared on DEV Community and was authored by Jordan Finneran

Contents

  1. Intro
  2. Time Elements
  3. Image Cropping Element
  4. File Attachment Element
  5. Copy Element
  6. Text Expander Element
  7. Summary

Intro

I'm a big fan of web components. Reusable web elements that can work anywhere.

A friend showed me this awesome set of components from Github.
I can't believe that I hadn't come across them before so I thought I'd share a few of the best ones with you!

These all work across all modern browsers, and browser support is documented.
They have virtually no dependencies either so they will be blazing fast, unlike other solutions to some of these problems.
More importantly they are battle tested as they are the elements Github uses itself!!

TLDR; Checkout the repository

Time Elements

Displaying Times can be hard! Figuring out how long ago something was to display in a human friendly format, or how long it is until an event.

Github have solved this for you, all with 0 dependencies!!

These are the same components you will have seen on Github itself where it displays times for example:

Github Time Element

This is really handy for any project when you need to display the time, you also know its tried and tested with it used themselves.

There are a few different types of time display available.
They even have a demo page available too!

Image Cropping Element

Image cropping can be a nightmare, and getting a library that handles it also can be difficult to setup and use. Github to the rescue!

Repository
Demo Page

This is really cool, especially the various ways Github advise you can use this, including automatically updating the values in inputs which you can send off to the server.

And again, it has no dependencies so will be super fast!

File Attachment Element

File uploads, I'm pretty certain everyone will have had to develop one of these in their career! Well now it's just an element away.

Repository
Demo Page

Copy Element

With the Clipboard API it's now fairly easy to write some logic to copy out some text to the users clipboard. But Github does this and one better by letting you bind to elements and there values for example, copying out a URL from a link.

<clipboard-copy for="blob-path">Copy full URL</clipboard-copy>
<a id="blob-path" href="/path/to#my-blob">Link text will not be copied</a>

Couldn't be easier!

Repository
Demo Page

Text Expander Element

Ever wondered how Github looks up users or issues as you type? Wonder no more as you can do it exactly like they do with another really simple element!
This would be super useful for anyone building social sites for example.

Repository
Demo Page

Summary

Github have done amazing work here, and I cannot thank the engineers who wrote them enough.
I've already started using these elements in projects I work on, and it has saved me plenty of time already!

There are lots more elements to take a look at so check the whole repository and examples here.

Let me know which are your favorites!

Happy Building!


This content originally appeared on DEV Community and was authored by Jordan Finneran


Print Share Comment Cite Upload Translate Updates
APA

Jordan Finneran | Sciencx (2021-04-12T19:23:45+00:00) 5 Github Elements you have to try. Retrieved from https://www.scien.cx/2021/04/12/5-github-elements-you-have-to-try/

MLA
" » 5 Github Elements you have to try." Jordan Finneran | Sciencx - Monday April 12, 2021, https://www.scien.cx/2021/04/12/5-github-elements-you-have-to-try/
HARVARD
Jordan Finneran | Sciencx Monday April 12, 2021 » 5 Github Elements you have to try., viewed ,<https://www.scien.cx/2021/04/12/5-github-elements-you-have-to-try/>
VANCOUVER
Jordan Finneran | Sciencx - » 5 Github Elements you have to try. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/12/5-github-elements-you-have-to-try/
CHICAGO
" » 5 Github Elements you have to try." Jordan Finneran | Sciencx - Accessed . https://www.scien.cx/2021/04/12/5-github-elements-you-have-to-try/
IEEE
" » 5 Github Elements you have to try." Jordan Finneran | Sciencx [Online]. Available: https://www.scien.cx/2021/04/12/5-github-elements-you-have-to-try/. [Accessed: ]
rf:citation
» 5 Github Elements you have to try | Jordan Finneran | Sciencx | https://www.scien.cx/2021/04/12/5-github-elements-you-have-to-try/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.