All Projects → egoist → Vue Content Loader

egoist / Vue Content Loader

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

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
Vue
7211 projects

Projects that are alternatives of or similar to Vue Content Loader

Vue Content Loading
Vue component to easily build (or use presets) SVG loading cards Facebook like.
Stars: ✭ 729 (-73.87%)
Mutual labels:  svg, loading, placeholder
React Content Loader
⚪ SVG-Powered component to easily create skeleton loadings.
Stars: ✭ 11,830 (+324.01%)
Mutual labels:  svg, loading, placeholder
React Native Blurhash
🖼️ A library to show colorful blurry placeholders while your content loads.
Stars: ✭ 430 (-84.59%)
Mutual labels:  component, loading, placeholder
Vue Svg Map
A set of Vue.js components to display an interactive SVG map
Stars: ✭ 48 (-98.28%)
Mutual labels:  svg, component
Awloader
AWLoader is a UI Component that allows you to integrate loader that fits your needs within your app.
Stars: ✭ 11 (-99.61%)
Mutual labels:  component, loading
Respin
React SVG loading spinner based on jxnblk.com/loading
Stars: ✭ 21 (-99.25%)
Mutual labels:  svg, component
Svg Loaders React
React adaptation of the SVG Loaders library by Sam Herbert
Stars: ✭ 75 (-97.31%)
Mutual labels:  svg, loading
Any Ui
❄️ 一个移动端组件库
Stars: ✭ 58 (-97.92%)
Mutual labels:  svg, component
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+287.24%)
Mutual labels:  loading, placeholder
Vue Loaders
Vue + loaders.css
Stars: ✭ 127 (-95.45%)
Mutual labels:  component, loading
React Svg Map
A set of React.js components to display an interactive SVG map
Stars: ✭ 150 (-94.62%)
Mutual labels:  svg, component
React Planner
✏️ A React Component for plans design. Draw a 2D floorplan and navigate it in 3D mode.
Stars: ✭ 846 (-69.68%)
Mutual labels:  svg, component
Create Content Loader
✏️ Tool to create your own react-content-loader easily.
Stars: ✭ 937 (-66.42%)
Mutual labels:  svg, loading
Svg To Component
Convert SVG to React/Vue components
Stars: ✭ 40 (-98.57%)
Mutual labels:  svg, component
React Circle
Renders a svg circle + progress, it just works 💘
Stars: ✭ 925 (-66.85%)
Mutual labels:  svg, loading
Placeholder Loading
Simple and flexible, css only, content placeholder loading animation. https://zalog.github.io/placeholder-loading/
Stars: ✭ 1,137 (-59.25%)
Mutual labels:  loading, placeholder
React Cool Img
😎 🏞 A React <Img /> component let you handle image UX and performance as a Pro!
Stars: ✭ 356 (-87.24%)
Mutual labels:  component, placeholder
React Nprogress
⌛️ A React primitive for building slim progress bars.
Stars: ✭ 173 (-93.8%)
Mutual labels:  component, loading
Vue Calendar Heatmap
A lightweight calendar heatmap Vuejs component built on SVG, inspired by github's contribution calendar graph
Stars: ✭ 120 (-95.7%)
Mutual labels:  svg, component
Hgplaceholders
Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project
Stars: ✭ 2,048 (-26.59%)
Mutual labels:  loading, placeholder

vue-content-loader

NPM version NPM downloads CircleCI

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

preview

Features

This is a Vue port for react-content-loader.

  • Completely customizable: you can change the colors, speed and sizes.
  • Create your own loading: use the online tool to create your custom loader easily.
  • You can use it right now: there are a lot of presets already.
  • Performance:
    • Tree-shakable and highly optimized bundle.
    • Pure SVG, so it's works without any javascript, canvas, etc.
    • Pure functional components.

Install

⚠️ The latest version is compatible with Vue 3 only. For Vue 2 & Nuxt 2, use vue-content-loader@^0.2 instead.

With npm:

npm i vue-content-loader

Or with yarn:

yarn add vue-content-loader

CDN: UNPKG | jsDelivr (available as window.contentLoaders)

Usage

👀👉 Demo: CodeSandbox

<template>
  <content-loader></content-loader>
</template>

<script>
import { ContentLoader } from 'vue-content-loader'

export default {
  components: {
    ContentLoader,
  },
}
</script>

Built-in loaders

import {
  ContentLoader,
  FacebookLoader,
  CodeLoader,
  BulletListLoader,
  InstagramLoader,
  ListLoader,
} from 'vue-content-loader'

ContentLoader is a meta loader while other loaders are just higher-order components of it. By default ContentLoader only displays a simple rectangle, here's how you can use it to create custom loaders:

<ContentLoader viewBox="0 0 250 110">
  <rect x="0" y="0" rx="3" ry="3" width="250" height="10" />
  <rect x="20" y="20" rx="3" ry="3" width="220" height="10" />
  <rect x="20" y="40" rx="3" ry="3" width="170" height="10" />
  <rect x="0" y="60" rx="3" ry="3" width="250" height="10" />
  <rect x="20" y="80" rx="3" ry="3" width="200" height="10" />
  <rect x="20" y="100" rx="3" ry="3" width="80" height="10" />
</ContentLoader>

This is also how ListLoader is created.

You can also use the online tool to create shapes for your custom loader.

API

Props

Prop Type Default Description
width number, string SVG width in pixels without unit
height number, string SVG height in pixels without unit
viewBox string '0 0 ${width ?? 400} ${height ?? 130}' See SVG viewBox attribute
preserveAspectRatio string 'xMidYMid meet' See SVG preserveAspectRatio attribute
speed number 2 Animation speed
primaryColor string '#f9f9f9' Background color
secondaryColor string '#ecebeb' Highlight color
uniqueKey string randomId() Unique ID, you need to make it consistent for SSR
animate boolean true
baseUrl string empty string Required if you're using <base url="/" /> in your <head />. Defaults to an empty string. This prop is common used as: <content-loader :base-url="$route.fullPath" /> which will fill the SVG attribute with the relative path. Related #14.
primaryOpacity number 1 Background opacity (0 = transparent, 1 = opaque) used to solve an issue in Safari
secondaryOpacity number 1 Background opacity (0 = transparent, 1 = opaque) used to solve an issue in Safari

Examples

Responsiveness

To create a responsive loader that will follow its parent container width, use only the viewBox attribute to set the ratio:

<ContentLoader viewBox="0 0 300 200">
  <!-- ... -->
</ContentLoader>

To create a loader with fixed dimensions, use width and height attributes:

<ContentLoader width="300" height="200">
  <!-- ... -->
</ContentLoader>

Note: the exact behavior might be different depending on the CSS you apply to SVG elements.

Credits

This is basically a Vue port for react-content-loader.

Thanks to @alidcastano for transferring the package name to me. 😘

License

MIT © EGOIST

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].