• Stars
    star
    733
  • Rank 59,486 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⚪️ SVG component to create placeholder loading, like Facebook cards loading.

Angular Content Loader

All Contributors

Example's react-content-loader

Angular component that uses SVG to create a collection of loaders which simulates the structure of the content that will be loaded, similar to Facebook cards loaders.

Live Demo

Features

This is an Angular port for react-content-loader.

  • ⚙️ Completely customizable: you can change the colors, speed and sizes;
  • ✏️ Create your own loading: use the create-react-content-loader to create your custom loadings easily;
  • 👌 You can use right now: there are a lot of presets to use the loader, see the options;
  • 🚀 Performance: uses pure SVG to work, so it works without any extra scripts, canvas, etc;

Buy Me A Coffee

Install

Yarn

yarn add @ngneat/content-loader

Usage

import { ContentLoaderModule } from '@ngneat/content-loader';

@NgModule({
  imports: [ContentLoaderModule]
})
export class AppModule {}
<content-loader>
  <svg:rect x="0" y="0" rx="3" ry="3" width="250" height="10" />
  <svg:rect x="20" y="20" rx="3" ry="3" width="220" height="10" />
  <svg:rect x="20" y="40" rx="3" ry="3" width="170" height="10" />
  <svg:rect x="0" y="60" rx="3" ry="3" width="250" height="10" />
  <svg:rect x="20" y="80" rx="3" ry="3" width="200" height="10" />
  <svg:rect x="20" y="100" rx="3" ry="3" width="80" height="10" />
</content-loader>

Warning: Safari renders the SVG in black in case your Angular application uses the <base href="/" /> tag in the <head/> of your index.html. Refer to the input property baseUrl below to fix this issue.

Examples

Facebook Style

<facebook-content-loader></facebook-content-loader>

Facebook Style

List Style

<list-content-loader></list-content-loader>

List Style

Bullet list Style

<bullet-list-content-loader></bullet-list-content-loader>

Bullet list Style

API

@Inputs

Prop name and type
Environment Description
animate?: boolean
Defaults to true
- Opt-out of animations with false
baseUrl?: string
Defaults to an empty string
- Required if you're using <base url="/" /> document <head/>
This prop is common used as: 
<ContentLoader baseUrl={window.location.pathname} /> which will fill the SVG attribute with the relative path. Related #93.
speed?: number
Defaults to 1.2
- Animation speed in seconds.
interval?: number
Defaults to 0.25
- Interval of time between runs of the animation, 
as a fraction of the animation speed.
viewBox?: string
Defaults to undefined
- Use viewBox props to set a custom viewBox value,
for more information about how to use it,
read the article How to Scale SVG.
gradientRatio?: number
Defaults to 1.2
- Width of the animated gradient as a fraction of the view box width.
rtl?: boolean
Defaults to false
- Content right-to-left.
backgroundColor?: string
Defaults to #f5f6f7
- Used as background of animation.
foregroundColor?: string
Defaults to #eee
- Used as the foreground of animation.
backgroundOpacity?: number
Defaults to 1
- Background opacity (0 = transparent, 1 = opaque)
used to solve an issue in Safari
foregroundOpacity?: number
Defaults to 1
- Animation opacity (0 = transparent, 1 = opaque)
used to solve an issue in Safari
style?: CSSProperties
Defaults to {}
-

Credits

This is basically an Angular port for react-content-loader.

License

MIT © NetanelBasal

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Netanel Basal

💻 🖋 📖

Heo

💻

Andreas Aeschlimann

📖

alexw10

💻 📖

Chinonso Chukwuogor

💻

wynfred

💻

Rustam

💻

Alex Malkevich

📖

Daniel Sogl

💻 🚧 📦

Alex Szabó‮

💻

Roy

📖

Robin Van den Broeck

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

falso

All the Fake Data for All Your Real Needs 🙂
TypeScript
3,098
star
2

spectator

🦊 🚀 A Powerful Tool to Simplify Your Angular Tests
TypeScript
2,029
star
3

transloco

🚀 😍 The internationalization (i18n) library for Angular
TypeScript
1,856
star
4

until-destroy

🦊 RxJS operator that unsubscribe from observables on destroy
TypeScript
1,712
star
5

elf

🧙‍♀️ A Reactive Store with Magical Powers
TypeScript
1,527
star
6

hot-toast

🍞 Smoking hot Notifications for Angular. Lightweight, customizable and beautiful by default.
TypeScript
687
star
7

cashew

🐿 A flexible and straightforward library that caches HTTP requests in Angular
TypeScript
671
star
8

reactive-forms

(Angular Reactive) Forms with Benefits 😉
TypeScript
610
star
9

tailwind

🔥 A schematic that adds Tailwind CSS to Angular applications
TypeScript
608
star
10

forms-manager

🦄 The Foundation for Proper Form Management in Angular
TypeScript
517
star
11

query

🚀 Powerful asynchronous state management, server-state utilities and data fetching for Angular Applications
TypeScript
510
star
12

error-tailor

🦄 Making sure your tailor-made error solution is seamless!
TypeScript
478
star
13

helipopper

🚁 A Powerful Tooltip and Popover for Angular Applications
TypeScript
392
star
14

nx-serverless

🚀 The Ultimate Monorepo Starter for Node.js Serverless Applications
TypeScript
388
star
15

dialog

👻 A simple to use, highly customizable, and powerful modal for Angular Applications
TypeScript
371
star
16

hotkeys

🤖 A declarative library for handling hotkeys in Angular applications
TypeScript
325
star
17

edit-in-place

A flexible and unopinionated edit in place library for Angular applications
TypeScript
252
star
18

svg-icon

👻 A lightweight library that makes it easier to use SVG icons in your Angular Application
TypeScript
251
star
19

inspector

🕵️ An angular library that lets you inspect and change Angular component properties
TypeScript
218
star
20

dirty-check-forms

🐬Detect Unsaved Changes in Angular Forms
TypeScript
199
star
21

input-mask

🎭 @ngneat/input-mask is an angular library that creates an input mask
TypeScript
199
star
22

lib

🤖 Lets you focus on the stuff that matters
TypeScript
180
star
23

transloco-keys-manager

🦄 The Key to a Better Translation Experience
TypeScript
174
star
24

dag

🐠 An Angular service for managing directed acyclic graphs
TypeScript
153
star
25

bind-query-params

Sync URL Query Params with Angular Form Controls
TypeScript
147
star
26

from-event

🦊 ViewChild and FromEvent — a Match Made in Angular Heaven
TypeScript
137
star
27

overview

🤖 A collection of tools to make your Angular views more modular, scalable, and maintainable
TypeScript
104
star
28

aim

Angular Inline Module Schematics
TypeScript
97
star
29

cmdk

Fast, composable, unstyled command menu for Angular. Directly inspired from pacocoursey/cmdk
TypeScript
91
star
30

copy-to-clipboard

✂️ Modern copy to clipboard. No Flash.
TypeScript
78
star
31

variabless

JS & CSS - A Match Made in Heaven 💎
HTML
78
star
32

loadoff

🤯 When it comes to loaders, take a load off your mind...
TypeScript
78
star
33

effects

🪄 A framework-agnostic RxJS effects implementation
TypeScript
59
star
34

avvvatars

Beautifully crafted unique avatar placeholder for your next angular project.
TypeScript
42
star
35

react-rxjs

🔌 "Plug and play" for Observables in React Apps!
TypeScript
37
star
36

subscribe

Subscription Handling Directive
TypeScript
34
star
37

elf-ng-router-store

Bindings to connect Angular router to Elf
TypeScript
24
star
38

ng-standalone-nx

TypeScript
24
star
39

lit-file-generator

🎁 A lit generator for a component, directive, and controller.
JavaScript
19
star
40

storage

TypeScript
18
star
41

material-schematics

TypeScript
3
star
42

svg-icon-demo

TypeScript
1
star