ホームページ  >  記事  >  ウェブフロントエンド  >  マテリアル UI: 非常に強力な CSS Framework_html/css_WEB-ITnose

マテリアル UI: 非常に強力な CSS Framework_html/css_WEB-ITnose

WBOY
WBOYオリジナル
2016-06-24 11:42:081283ブラウズ

マテリアル UI は、非常に新鮮で簡潔なインターフェイスを備えた非常に強力な CSS フレームワークです。マテリアル UI は、Google の新しいマテリアル デザイン言語を利用しており、各 UI コンポーネントが非常に独立しているため、開発者はマテリアル UI を使用することも簡単になります。 Bootstrap と同様に、マテリアル UI は、最も基本的なメニュー、ボタン、スライド バー、プログレス バー、ラジオ ボタン/チェック ボックスに加えて、一般的に使用される多くの UI コンポーネントを提供します。また、非常に興味深いカレンダー コンポーネントも提供します。アイコンが提供されます。

マテリアルUIの特徴

  • 多くのコンポーネントがあり、各コンポーネントのスタイルは比較的一貫しています。
  • 比較的使いやすいnpmパッケージ形式を提供します。
  • これはすべてオープンソースです。このオープンソースの CSS フレームワークを自由に使用できます。
  • マテリアル UI の応用例

    まずは、最も基本的なものから始めましょう。

    メニュー

    以下はシンプルな複数レベルのドロップダウンメニューです

    コードは次のとおりです:

    nestedMenuItems = [    { type: mui.MenuItem.Types.NESTED, text: 'Reports', items: [      { payload: '1', text: 'Nested Item 1' },      { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 2', items: [        { payload: '1', text: 'Nested Item 2.1' },        { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 2.2', items: [          { payload: '1', text: 'Nested Item 2.2.1' },          { payload: '3', text: 'Nested Item 2.2.2' }        ] },        { payload: '3', text: 'Nested Item 2.3' }      ] },      { payload: '3', text: 'Nested Item 3' },      { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 4', items: [        { payload: '1', text: 'Nested Item 4.1' },        { type: mui.MenuItem.Types.NESTED, text: 'Nested Item 4.2', items: [          { payload: '1', text: 'Nested Item 4.2.1', disabled: true },          { payload: '3', text: 'Nested Item 4.2.2' }        ] },        { payload: '3', text: 'Nested Item 4.3' }      ] },      { payload: '4', text: 'Nested Item 5' }    ] },    { payload: '1', text: 'Audio Library'},    { payload: '2', text: 'Settings'},    { payload: '3', text: 'Logout', disabled: true}  ];<Menu menuItems={nestedMenuItems} autoWidth={false}/>

    以下はアイコン付きの垂直メニューです

    コードは次のとおりです:

    //iconClassName is the classname for our icon that will get passed into mui.FontIconiconMenuItems = [   { payload: '1', text: 'Live Answer', iconClassName: 'muidocs-icon-communication-phone', number: '10' },   { payload: '2', text: 'Voicemail', iconClassName: 'muidocs-icon-communication-voicemail',  number: '5' },   { payload: '3', text: 'Starred', iconClassName: 'muidocs-icon-action-stars', number: '3' },   { payload: '4', text: 'Shared', iconClassName: 'muidocs-icon-action-thumb-up',  number: '12' }];<Menu menuItems={iconMenuItems} autoWidth={false}/>

    ボタン

    以下はシンプルなカラフルなボタンです。ボタンをクリックすると、波が広がるアニメーション効果が発生します。

    コードは次のとおりです:

    //Raised Buttons<RaisedButton label="Default" /><RaisedButton label="Primary" primary={true} /><RaisedButton label="Secondary" secondary={true} /><div style={styles.container}>  <RaisedButton primary={true} label="Choose an Image">    <input type="file" style={styles.exampleImageInput}></input>  </RaisedButton></div><div style={styles.container}>  <RaisedButton linkButton={true} href="https://github.com/callemall/material-ui" secondary={true} label="Github">    <FontIcon style={styles.exampleButtonIcon} className="muidocs-icon-custom-github"/>  </RaisedButton></div><RaisedButton label="Disabled" disabled={true} />

    ラジオボタンのチェックボックスを美化します

    以下はマテリアルUIのラジオボタンとチェックボックスを美化します

    コードは次のとおりです:

    <RadioButtonGroup name="shipSpeed" defaultSelected="not_light">        <RadioButton          value="light"          label="prepare for light speed"          style={{marginBottom:16}} />        <RadioButton          value="not_light"          label="light speed too slow"          style={{marginBottom:16}}/>        <RadioButton          value="ludicrous"          label="go to ludicrous speed"          style={{marginBottom:16}}          disabled={true}/>      </RadioButtonGroup>

    カレンダーコンポーネント

    これは個人的に最も美しい CSS カレンダー コンポーネントだと思います

    コードは次のとおりです:

    //Portrait Dialog<DatePicker  hintText="Portrait Dialog"//Landscape Dialog<DatePicker  hintText="Landscape Dialog"  mode="landscape"/>// Ranged Date Picker<DatePicker  hintText="Ranged Date Picker"  autoOk={this.state.autoOk}  minDate={this.state.minDate}  maxDate={this.state.maxDate}  showYearSelector={this.state.showYearSelector} />

    マテリアル UI には便利な CSS UI コンポーネントも多数あり、公式 Web サイトにアクセスしてダウンロードして使用方法を学ぶことができます。

    この記事は http://www.codeceo.com/article/material-ui.html から転載されています

    著作権声明: 再版へようこそ、再版する場合は元のアドレスを追加してください、ありがとうご協力、楽しく学習してください!

    声明:
    この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。