Mobile tab

Compatible with Flarum v1.8.5

Latest release 1.4.3

7,348 downloads

released on Jul 18, 2021

Mobile Tab Component

License Latest Stable Version Total Downloads GitHub Sponsors

A Flarum extension. Adds a bottom tab on mobile.

Imgur

Installation

Install with composer:

composer require acpl/mobile-tab

Updating

composer update acpl/mobile-tab
php flarum cache:clear

Extending

You can add, modify and delete items with your own extension. Read: https://docs.flarum.org/extend/extending-extensions/

Examples:

import { components } from "@acpl-mobile-tab";
import { extend } from "flarum/common/extend";

const { MobileTab, MobileTabItem } = components;

export default () => {
  extend(MobileTab.prototype, "items", (items) => {
    // Add new item
    items.add(
      "following",
      <MobileTabItem
        href={app.route("following")}
        icon="fas fa-star"
        label={app.translator.trans("my-ext.forum.my-item")}
      />,
      90,
    );

    // Add new item using custom HTML
    items.add("my-item", <div>...This is my custom item</div>, 70);

    // Remove item
    items.remove("home");
  });
};

If you are using TypeScript, add a path to your tsconfig.json to enable type hints in your code editor:

{
  "extends": "flarum-tsconfig",
  // ...
  "compilerOptions": {
    // ....
    "paths": {
      // ...
      "@acpl-mobile-tab": [
        "./vendor/acpl/mobile-tab/js/dist-typings/index.d.ts"
      ]
    }
  }
}

Links

© 2024 Hyn by DaniĆ«l "Luceos" Klabbers. All rights reserved. · Extensions and extension information is provided by the respective (copyright holding) authors. · Extiverse is not affiliated to the Flarum project or Flarum foundation. · Images on Extiverse pages are from Unsplash.