PHPackages                             youra-halloween/yii2-material-design-components - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. youra-halloween/yii2-material-design-components

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

youra-halloween/yii2-material-design-components
===============================================

Components can be used in php or in conjunction with the yii2 framework.

0.4(4y ago)014[5 PRs](https://github.com/youra-h/yii2-material-design-components/pulls)MITPHPPHP &gt;=5.6.0

Since Jan 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/youra-h/yii2-material-design-components)[ Packagist](https://packagist.org/packages/youra-halloween/yii2-material-design-components)[ Patreon](https://www.patreon.com/youra_soldatov)[ RSS](/packages/youra-halloween-yii2-material-design-components/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (13)Used By (0)

Material Components for the php or yii2.
========================================

[](#material-components-for-the-php-or-yii2)

Components can be used in php or in conjunction with the yii2 framework.

```
The project can be supported by money, beer, burger, clothes and your motorcycle. Thank you 😎

```

[Demos](https://youra-h.github.io/yii2-material-design-components.html)
[MDC Template](https://github.com/youra-h/MDC-web-template)
[MDC Google Components Page](https://github.com/material-components/material-components-web)

To generate a new template use [MDC Template](https://github.com/youra-h/MDC-web-template)
To generate a color scheme [Color tool](https://material.io/resources/color/#!/?view.left=0&view.right=0)

Google MDC version used v.10
----------------------------

[](#google-mdc-version-used-v10)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist youra-halloween/yii2-material-design-components "^0.4.0"

```

or add

```
"youra-halloween/yii2-material-design-components": "^0.4.0"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

```
/**
 * Main backend application asset bundle.
 */
class MainAsset extends AssetBundle
{
    public $depends = [
        'yh\mdc\assets\YhAsset',
    ];
}
```

If you use **YhAsset**, then **JS** and **CSS** scripts are included. Separately **JS** can be connected using **MdcJsAsset**.

**UtilsAsset** will connect scripts for working with **forms** and **tables** and asynchronous xhr requests.

Examples
--------

[](#examples)

Add textfield username and password

```
use yh\mdc\ActiveForm;
use yh\mdc\components\TextField;

$form->field($model, 'username')->textInput([
                'tabIndex' => 1,
                'autocomplete' => 'username',
                'required' => true,
                'property' => [
                    'autoFocus' => true,
                    'label' => Yii::t('backend/login', 'Введите логин'),
                    'labelTemplate' => TextField::ALIGN_TOP,
                    'labelSize' => Vars::LARGE,
                    'textSize' => Vars::LARGE,
                    'helper' => Yii::t('backend/login', 'email | логин'),
                    'height' => Vars::LARGE
                ],
            ])

$form->field($model, 'password')->passwordInput([
                'tabIndex' => 2,
                'autocomplete' => 'current-password',
                'required' => true,
                'property' => [
                    'label' => Yii::t('backend/login', 'Введите пароль'),
                    'labelTemplate' => TextField::ALIGN_TOP,
                    'labelSize' => Vars::LARGE,
                    'textSize' => Vars::LARGE,
                    'icons' => [
                        ['icon' => 'visibility', 'role' => 'button', 'toggle' => 'visibility_off']
                    ],
                    'helper' => '',
                    'height' => Vars::LARGE
            ]])

/**
 * role - can be icon or button
 * toggle - when you click on the button, change the icon
 */
'icons' => [
    ['icon' => 'visibility', 'role' => 'button', 'toggle' => 'visibility_off']
],
```

Add gray button

```
Button::one(Yii::t('backend/login', 'Войти'), ['spinner' => Button::SP_AUTO], ['tabIndex' => 4])
    ->setOwner($form)
    ->gray()
    ->submit()
```

Add menu

```
Menu::one([
    'id' => 'locale-menu',
    'items' => I18nLocale::getList()
])->render()

//Where I18nLocale::getList() returns an associative array

// OR

Menu::one([
    'id' => 'app-user-menu',
    'items' => [
        [
            'text' => Yii::t('backend/main/user-menu', 'Настройки профиля'),
            'separator' => true
        ],
        [
            'text' => Yii::t('backend/main-user-menu', 'Выход'),
            'href' => Url::to('main/logout'),
            'options' => [
                'data' => ['method' => 'post']
            ]
        ],
    ]
])
->render()
```

Add snackbar

```
Snackbar::one('')
    ->setProperty(['closeButton'=> Yii::t('backend', 'Закрыть')])
    ->setId('app-snackbar')
    ->render()
```

See the use of JS components here
---------------------------------

[](#see-the-use-of-js-components-here)

- [Material-Design-Components-for-web](https://github.com/youra-h/MDC-web-template)

### By Google

[](#by-google)

- [Material Components for the web](https://github.com/material-components/material-components-web)
- [Manual packages](https://github.com/material-components/material-components-web/tree/master/packages)
- [Examples of what components look like](https://material.io/components?platform=web)
- [And](https://material-components.github.io/material-components-web-catalog/#/)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~28 days

Recently: every ~42 days

Total

7

Last Release

1769d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fa5c8eecf7e0839c139b85aa77c405e839a8b2d2e85df56e8b86a3b5235d66b?d=identicon)[youra-halloween](/maintainers/youra-halloween)

---

Top Contributors

[![youra-h](https://avatars.githubusercontent.com/u/5162766?v=4)](https://github.com/youra-h "youra-h (61 commits)")

---

Tags

javscriptmaterial-componentsmaterial-uiphpyii2yii2-widgetcomponentsyii2extensionmaterial-designgoogle-components

### Embed Badge

![Health badge](/badges/youra-halloween-yii2-material-design-components/health.svg)

```
[![Health](https://phpackages.com/badges/youra-halloween-yii2-material-design-components/health.svg)](https://phpackages.com/packages/youra-halloween-yii2-material-design-components)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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