Flarum UiKit with reusable frontend utilities for extension developers. (Not An Extension)
Use the package's extender to register its resources.
extend.php
return [
new SychO\UiKit\Extend\Register,
];
example.js
import ProgressBar from 'flarum/uikit/common/ProgressBar';
import Label from 'flarum/uikit/common/Label';
import LabelGroup from 'flarum/uikit/common/LabelGroup';
import Input from 'flarum/uikit/common/Input';
import DiscussionSearch from 'flarum/uikit/forum/DiscussionSearch';
/**
* @param mini bool small sized
* @param alternate bool works with backgrounds using control-bg background color
* @param progress number percentage
* @param className string
*/
<ProgressBar fancy={true} mini={false} alternate={false} progress={93} />
/**
* @param color string
*/
<Label color="red">Text</Label>
/**
* Container for a group of labels
*/
<LabelGroup></LabelGroup>
/**
* @param icon string fontawesome icon
* @param className string
* ...attrs: other attributes
*/
<Input icon="fas fa-user" className="Input--example"/>
/**
* @param state GlobalSearchState
* @param ignore number
* @param onSelect (discussion: Discussion) => void
*/
<DiscussionSearch state={} ignore={485} onSelect={(discussion) => ...} />
$ composer require sycho/flarum-uikit:^0.2.0
$ composer update sycho/flarum-uikit:^0.2.0
The MIT License.