0.0.4 • Published 11 months ago

ngx-placeholder v0.0.4

Weekly downloads
-
License
-
Repository
github
Last release
11 months ago

ngx-placeholder

Angular package to use customisable placeholders during development.

Usage

  • Install the package
npm i ngx-placeholder
  • Go to angular.json of your project
{
  // ...
  assets: [
    // ...
    {
      glob: "**/*",
      input: "./node_modules/ngx-placeholder/assets",
      output: "./assets",
    },
  ];
}

This is required to access the placeholder image when you use placeholder with type image

  • Import the module / component
@Component({
  // ...
  imports: [
  // ...
    NgxPlaceholderModule
  // ...
    ],
  // ...
})
<!-- Placeholder with box option -->
<ngx-placeholder width="200" height="100"></ngx-placeholder>
<!-- Placeholder with image option -->
<ngx-placeholder type="image" width="200" height="100"></ngx-placeholder>
<!-- Placeholder with text option -->
<ngx-placeholder type="text" phrase="hello world" width="200" height="100"></ngx-placeholder>

API

@Input

OptionstypeInference
widthstringset the width of the container default: 100% of the parent container
heightstringset the height of the container default: 100% of the parent container
borderWeightstringborderWeight for border default: 1px
type'box' | 'text' | 'image'set the type of the placeholder
phrasestringset the phrase to display when type is 'text'

Default Styles (can't be changed yet):

  • Border style: borderWidth solid black
  • Background color: #dddddd
  • ngx-placeholder selector style: display: contents

Pipeline

  1. Type support
  2. Demo site
  3. More input functionalities
0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago