x-postpress - Vaadin Add-on Directory
A Web Component showing the "latest posts" using a WordPress REST API# x-postpress
A Web Component that fetches [WordPress](https://wordpress.org/) posts [from the REST API](https://developer.wordpress.org/rest-api/reference/posts/#list-posts) based on attributes set on the element.
## About
* Built using [LitElement](https://lit-element.polymer-project.org/) and [TypeScript](https://www.typescriptlang.org/)
* [Supports Internet Explorer 11](https://github.com/kherrick/x-postpress/tree/master/build/es5-bundled)
## Try
* [Demo the element](https://kherrick.github.io/x-postpress/) on GitHub Pages
* [Exercise the element](https://codesandbox.io/s/5yj96r0n9k) on CodeSandbox
## Use
* Add the Web Component to the project (unpkg and npm examples)
1. Load the custom element using a `script` tag:
```html
```
2. Alternatively, add using `npm`:
```bash
npm i x-postpress
```
Then import the module from another file:
```javascript
import 'x-postpress'
```
* Add the tag into the document and style using available CSS custom properties. Articles can be included with the provided slot element:
```html
```
## Misc
* An [Angular repository](https://github.com/kherrick/angular-x-postpress) and [unpkg examples](https://github.com/kherrick/x-postpress/tree/master/examples) are available for experimentation
* Try using devtools to change the `apiHost` attribute within the `x-postpress` tag to render another REST API posts endpoint
* If building an app with x-postpress, the included [index.html](index.html) checks the query string for parameters to override particular custom element attributes (example):
```html
example.com
```
Article
Thursday, 01 January 1970
Lorem ipsum dolor sit amet