Material UI:非常强大的CSS框架_html/css_WEB-ITnose
Material UI 是一款功能非常强大,界面却十分清新简洁的CSS框架,Material UI利用了Google的Material Design 全新设计语言,并且让每一个UI组件都变得非常独立,因此开发者使用Material UI也会比较简单。和Bootstrap类似,Material UI提供了很多常用的UI组件,除了最基本的菜单、按钮、滑动杆、进度条、单选框/复选框外,它还提供了一个非常有趣的日历组件,另外还提供了一些很有趣的图标。
Material UI 的特点
Material 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} />
美化单选框复选框
下面是Material 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} />
Material UI还有很多有用的CSS UI组件,你可以前往其官方网站下载及学习使用。
本文转自http://www.codeceo.com/article/material-ui.html
版权声明:欢迎转转载,希望转载的同时添加原文地址,谢谢合作,学习快乐!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

HTML适合初学者学习,因为它简单易学且能快速看到成果。1)HTML的学习曲线平缓,易于上手。2)只需掌握基本标签即可开始创建网页。3)灵活性高,可与CSS和JavaScript结合使用。4)丰富的学习资源和现代工具支持学习过程。

HTML定义网页结构,CSS负责样式和布局,JavaScript赋予动态交互。三者在网页开发中各司其职,共同构建丰富多彩的网站。

AnexampleOfAstartingTaginHtmlis,beginSaparagraph.startingTagSareEssentialInhtmlastheyInitiateEllements,defiteTheeTheErtypes,andarecrucialforsstructuringwebpages wepages webpages andConstructingthedom。

WebDevelovermentReliesonHtml,CSS和JavaScript:1)HTMLStructuresContent,2)CSSStyleSIT和3)JavaScriptAddSstractivity,形成thebasisofmodernWebemodernWebExexperiences。

网页批注功能的Y轴位置自适应算法本文将探讨如何实现类似Word文档的批注功能,特别是如何处理批注之间的间�...

GiteePages静态网站部署失败:404错误排查与解决在使用Gitee...

HTML、CSS和JavaScript是Web开发的三大支柱。1.HTML定义网页结构,使用标签如、等。2.CSS控制网页样式,使用选择器和属性如color、font-size等。3.JavaScript实现动态效果和交互,通过事件监听和DOM操作。

实现图片点击后周围图片散开并放大效果许多网页设计中,需要实现一种交互效果:点击某张图片,使其周围的...
