PHPackages                             afrux/forum-widgets-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. afrux/forum-widgets-core

ActiveFlarum-extension[Framework](/categories/framework)

afrux/forum-widgets-core
========================

Core Extension for Managing Forum Widgets

v0.1.7(4y ago)1950.4k—0%7[9 issues](https://github.com/afrux/forum-widgets-core/issues)[3 PRs](https://github.com/afrux/forum-widgets-core/pulls)3MITTypeScript

Since Aug 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/afrux/forum-widgets-core)[ Packagist](https://packagist.org/packages/afrux/forum-widgets-core)[ Docs](https://afrux.github.io)[ Fund](https://www.buymeacoffee.com/sycho)[ RSS](/packages/afrux-forum-widgets-core/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (2)Versions (9)Used By (3)

[![icon](https://raw.githubusercontent.com/afrux/forum-widgets-core/master/icon.svg)](https://raw.githubusercontent.com/afrux/forum-widgets-core/master/icon.svg)

Forum Widgets
=============

[](#forum-widgets)

[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265) [![Latest Stable Version](https://camo.githubusercontent.com/01aa34875a57567ac6cb36554eba9a76c9d697a2655eef6db50f2e9114db3043/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61667275782f666f72756d2d776964676574732d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/afrux/forum-widgets-core) [![Total Downloads](https://camo.githubusercontent.com/21cbaf6ff043680cab7da4ae2c451402ff9b73b39a79b4fac46ded751aaa39c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61667275782f666f72756d2d776964676574732d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/afrux/forum-widgets-core) [![donate](https://camo.githubusercontent.com/8a75d5c022ba03ef35ff5363dfee2eb11f67ae8c13bfef1092c0d5de35fd6f84/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d6275792532306d6525323061253230636f666665652d2532336666646533393f7374796c653d666c61742d737175617265)](https://www.buymeacoffee.com/sycho)

[Flarum](http://flarum.org) Core Extension for Managing Forum Widgets.
[![animated_screenshot](https://user-images.githubusercontent.com/20267363/127786249-4f17bb07-9dfb-4066-8d91-6c92b61358cd.gif)](https://user-images.githubusercontent.com/20267363/127786249-4f17bb07-9dfb-4066-8d91-6c92b61358cd.gif)
[![forum screenshot](https://user-images.githubusercontent.com/20267363/127903214-a96f08ba-1a71-42b0-bc17-5b2c65a68859.png)](https://user-images.githubusercontent.com/20267363/127903214-a96f08ba-1a71-42b0-bc17-5b2c65a68859.png)

Installation
------------

[](#installation)

Remember that this is just a forum widgets editor, it doesn't actually come with any widgets.

Install with composer:

```
composer require afrux/forum-widgets-core:"*"
```

Here is a list of currently compatible widgets you can install:

- [Online Users](https://github.com/afrux/online-users-widget)
- [Forum Stats](https://github.com/afrux/forum-stats-widget)
- [Top Posters](https://github.com/afrux/top-posters-widget)
- [News Fader](https://github.com/afrux/news-widget)

Updating
--------

[](#updating)

```
composer update afrux/forum-widgets-core:"*"
php flarum migrate
php flarum cache:clear
```

Extend
------

[](#extend)

Extension developers wanting to create widgets with this small framework, the following explains how you can register a new widget, for now you should only register one widget per extension.

1. Require this extension in your extension's `composer.json`:

```
"require": {
  "flarum/core": "^1.0.0",
  "afrux/forum-widgets-core": "^0.1.0"
},
```

2. Create your widget's component in `common/components` by extending the base `Widget` component provided with this package.

```
import Widget from 'flarum/extensions/afrux-forum-widgets-core/common/components/Widget';

export default class MyWidget extends Widget {
  className() {
    // Custom class name.
    // You can also use the class "AfruxWidgets-Widget--flat" for a flat widget (not contained in a block).
    // Please avoid strong custom styling so that it looks consistent in other themes.
    return 'MyWidget';
  }

  icon() {
    // Widget icon.
    return 'fas fa-cirlce';
  }

  title() {
    // Widget title.
    // Can return empty for a titleless widget.
    return app.translator.trans('afrux-online-users-widget.forum.widget.title');
  }

  content() {
    return (

        // ...

    );
  }
}
```

3. Register your widget in the admin and forum frontends:

- Create a new `registerWidget.js` file in `common`:

```
import Widgets from 'flarum/extensions/afrux-forum-widgets-core/common/extend/Widgets';

import MyWidget from './components/MyWidget';

export default function(app) {
  (new Widgets).add({
    key: 'onlineUsers',
    component: MyWidget,

    // Can be a callback that returns a boolean value.
    // example: () => app.forum.attribute('myCustomExtension.mySetting')
    isDisabled: false,

    // Is this a one time use widget ? leave true if you don't know.
    isUnique: true,

    // The following values are default values that can be changed by the admin.
    placement: 'end',
    position: 1,
  }).extend(app, 'my-extension-id');
};
```

- Register the widget in both frontends `admin/index.js` &amp; `forum/index.js`:

```
import registerWidget from '../common/registerWidget';

app.initializers.add('my-extension-id', () => {
  registerWidget(app);
});
```

4. If you are using typescript, you can add the typings of this package by adding this to the `paths` key in your `tsconfig.json` file:

```
"flarum/extensions/afrux-forum-widgets-core/*": ["../vendor/afrux/forum-widgets-core/js/dist-typings/*"]
```

You can also checkout other example widgets in the Afrux github org.

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/afrux/forum-widgets-core)
- [GitHub](https://github.com/afrux/forum-widgets-core)
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)

###  Health Score

33

—

LowBetter than 77% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~30 days

Recently: every ~53 days

Total

8

Last Release

1479d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3653255?v=4)[SychO](/maintainers/SychO)[@Sycho](https://github.com/Sycho)

---

Top Contributors

[![SychO9](https://avatars.githubusercontent.com/u/20267363?v=4)](https://github.com/SychO9 "SychO9 (40 commits)")[![flarum-bot](https://avatars.githubusercontent.com/u/39334649?v=4)](https://github.com/flarum-bot "flarum-bot (10 commits)")[![davwheat](https://avatars.githubusercontent.com/u/7406822?v=4)](https://github.com/davwheat "davwheat (1 commits)")[![weeliem](https://avatars.githubusercontent.com/u/2240115?v=4)](https://github.com/weeliem "weeliem (1 commits)")

---

Tags

flarumwidgetsframeworkcorewidgetsflarum

### Embed Badge

![Health badge](/badges/afrux-forum-widgets-core/health.svg)

```
[![Health](https://phpackages.com/badges/afrux-forum-widgets-core/health.svg)](https://phpackages.com/packages/afrux-forum-widgets-core)
```

###  Alternatives

[caffeina-core/core

Platform for rapid application development.

345.9k3](/packages/caffeina-core-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
