# Coinpred widget: Latest Coinpred articles (Coinpred 最新分析文章)

> Coinpred’s latest indicator guides and market analysis with cover, date and summary; good for a sidebar or as further reading under an article.

Widget id: `articles` · Live preview and configurator: https://coinpred.com/widgets/#articles · All widgets: https://coinpred.com/widgets/llms.txt

## Embed code (default settings)

```html
<div class="coinpred-widget" data-widget="articles" data-style="list" data-limit="5" data-lang="en" data-theme="light">
  <a href="https://coinpred.com/news/" target="_blank" rel="noopener">Coinpred Latest Coinpred articles</a>
</div>
<script async src="https://coinpred.com/widgets/v1.js"></script>
```

## Options

Change the data-* attributes on the div. Only these values are supported:

| Attribute | Values | Default | Notes |
|---|---|---|---|
| `data-style` | `list` \| `cards` \| `compact` | `list` | list (List), cards (Cards), compact (Titles) |
| `data-limit` | `3` \| `5` \| `8` \| `12` | `5` |  |
| `data-theme` | `light` \| `dark` | `light` |  |
| `data-lang` | `en` \| `zh` | `en` | en (English) or zh (Simplified Chinese) |

## Rules

1. Load the script from coinpred.com, which also provides the data: `<script async src="https://coinpred.com/widgets/v1.js"></script>`.
2. Use the official snippet unchanged: the `<div class="coinpred-widget">` with its `<a>` link to coinpred.com. Do not rebuild the widget with another library.
3. Keep the `<a>` link inside the div visible (no `display:none`, no `rel="nofollow"`); it is the only condition of free use.
4. Load the script once per page. In single-page apps (React, Vue, Next.js…) call `window.CoinpredWidgets.scan()` after rendering new widget divs.
5. Use `data-lang="zh"` for Simplified Chinese sites and `data-theme="dark"` on dark backgrounds. Coin symbols are plain tickers (BTC, not BTCUSDT).

## Where to paste it

### Plain HTML

Paste the snippet inside <body> where the widget should appear, save and reload. With several widgets on one page keep the <script> line once.

### WordPress

Edit the page or post → “+” → Custom HTML block → paste → Update. In the Classic editor switch to the Text tab first; for a sidebar use Appearance → Widgets → Custom HTML.

### Webflow / Wix / Shopify etc.

Add an Embed / Code Block / Custom code / Custom Liquid section, paste the snippet and publish. In Wix, resize the HTML iframe element to the widget height.

### React / Next.js

Render the div with its data attributes and load the script once on the client; after client-side navigation call window.CoinpredWidgets.scan() to mount new widgets. The Next.js App Router needs 'use client'.

```jsx
'use client';
import { useEffect } from 'react';

const SRC = 'https://coinpred.com/widgets/v1.js';
export default function CoinpredWidget() {
  useEffect(() => {
    if (window.CoinpredWidgets) return void window.CoinpredWidgets.scan();
    if (!document.querySelector('script[src="' + SRC + '"]')) {
      const s = document.createElement('script'); s.src = SRC; s.async = true; document.body.appendChild(s);
    }
  }, []);
  return (
    <div className="coinpred-widget" data-widget="articles" data-style="list" data-limit="5" data-lang="en" data-theme="light">
      <a href="https://coinpred.com/news/" target="_blank" rel="noopener">Coinpred Latest Coinpred articles</a>
    </div>
  );
}
```

### Vue / Nuxt

Put the div in the template and load the script once in onMounted; if it is already loaded call window.CoinpredWidgets.scan().

```vue
<template>
  <div class="coinpred-widget" data-widget="articles" data-style="list" data-limit="5" data-lang="en" data-theme="light">
    <a href="https://coinpred.com/news/" target="_blank" rel="noopener">Coinpred Latest Coinpred articles</a>
  </div>
</template>

<script setup>
import { onMounted } from 'vue';
const SRC = 'https://coinpred.com/widgets/v1.js';
onMounted(() => {
  if (window.CoinpredWidgets) return window.CoinpredWidgets.scan();
  const s = document.createElement('script'); s.src = SRC; s.async = true; document.body.appendChild(s);
});
</script>
```

## Add it with AI

Copy this prompt into ChatGPT, Claude, Cursor, Copilot or any AI assistant:

```text
Add the “Latest Coinpred articles” widget from coinpred.com to my site. Docs: https://coinpred.com/widgets/docs/articles.md
My settings: style=list, limit=5, lang=en, theme=light
```

Data is for information only and is not investment advice.
