Start free trial

Extensions (PHP) · Components

Components for your pages

Build your pages from the components ForumSpark uses itself: page layout, buttons, menus, dialogs, the editor, filters, the forum picker, reactions and more. Your extension then looks and works like the rest of the forum, in every theme and in dark mode, on phones too.

The catalogue

On a forum with developer mode on, Developer, Components lists every component with a live example in that forum's theme, the code to copy and its options.

ComponentTagFor
Page layoutx-forum-layoutWraps a forum page in the board's header, menu, sidebar and footer.
Page headerx-ui.page-headThe title and one-line description at the top of a page, with room for buttons.
Buttonx-ui.buttonFor actions and links. Follows the board's theme colours.
Menux-ui.menuA list of actions behind a button. One action shows as a plain button by itself.
Dialogx-ui.modalA window over the page for a short form or a question.
Tabsx-ui.tabsSwitch between views of the same page.
Rowsx-ui.rowsA simple list of links or facts, one per row.
Choice listx-ui.selectPick one option. Use it instead of a plain select, so it matches the theme.
Date and timex-ui.date-timePick a date, a time or both, in the member's own time zone.
Member pickerx-ui.member-pickerFind a member by name while typing. Use it for every username field.
Editorx-editorThe editor members know from new topics and replies, with the attachment tray inside it. Always put it in a tiptapEditor container.
Tagsx-ui.tags-inputAdd tags with suggestions from the board's own tags.
Avatarx-avatarA member's picture in the board's avatar shape.
Member namex-user-linkA member's name, in their group colour, linking to their profile.
Time agox-relative-timeA date as "3 hours ago" that keeps up to date, with the exact time on hover.
Empty statex-empty-stateWhat a list shows when there is nothing in it yet.
App sidebarx-app-navThe sidebar every app uses for its own pages, with headings and counts.
Reactionsx-ui.reactionsThe board's own reactions, the same as on posts. Give your model HasReactions.
Popoverx-ui.popoverA small panel that opens from a button, for filters or a short form.
Multiple choicex-ui.multi-selectPick several options from a list, with search for long lists.
Image uploadx-ui.image-dropDrop or pick one image, with a preview and a remove button.
Attachmentsx-attachmentsShows the files attached to your model, under its text, like under a post.
Formatted textx-rich-textShows text written in the editor with the same spacing and styles as posts.
Tag listx-ui.tag-listThe tags of one item, linking to the board's tag pages.
Filterx-ui.filterA Filter button with the number of active filters. Opens a panel on desktop and a sheet on phones, with Reset and Apply.
Active filtersx-ui.filter.chipsThe filters that are on, each with a remove link, above a filtered list.
Topic filterx-topic-filterThe sort tabs, Filter panel and active filters at the top of a topic list: label, starter, last activity, status, sort, tag and show only. Read the choices with TopicListFilter.
Forum pickerx-ui.forum-pickerChoose one forum to post in, with search, recent forums and the board's categories. The same picker as the new topic window.
Forum treex-ui.forum-treePick forums from the board's categories, with counts and search. Ticking a category ticks its forums.
Tag cloudx-ui.tag-cloudPopular tags, sized by how often they are used.
Sidebar blockx-blockA titled box like the ones in the board sidebar, with a link to see more.
Loading placeholderx-skeleton-rowsGrey shapes while something loads, so the page does not jump.
Icon pickerx-fa-icon-pickerChoose a Font Awesome icon from a searchable list.
Page numbers->links()Page numbers under a long list, in the board's style.
Pagex-acp.pageThe title, description and buttons at the top of every admin page.
Cardx-acp.cardA white box for a table or a list.
Section and fieldx-k2-sectionA settings form: a section with labelled fields and help text.
Switchx-k2-switchAn on or off setting.
Row menux-acp.moreThe ... menu at the end of a table row.
Dialogx-k2-modalA window over an admin page.
Page numbersx-acp.pagerPage numbers under an admin table.
Icon pickerx-acp.icon-pickerChoose an icon in an admin form.
Category tablex-acp.category-tableA list of categories with drag to reorder, counts, edit and delete, like the Blog and Gallery categories.

A few rules

  • Use x-ui.select, x-ui.date-time and x-ui.member-picker instead of plain form fields, so they match the theme.
  • Take colours from the theme. The check flags hard-coded colours.
  • Wrap forum pages in x-forum-layout and admin pages in x-admin-layout with x-acp.page.