开源软件名称(OpenSource Name):mebibou/mdl-selectfield开源软件地址(OpenSource Url):https://github.com/mebibou/mdl-selectfield开源编程语言(OpenSource Language):JavaScript 61.9%开源软件介绍(OpenSource Introduction):mdl-selectfieldMaterial Design Lite selectfield component (https://github.com/google/material-design-lite)
Live ExampleCheck out the CodePen InstallVia bower:
Or via npm:
Then include in your html:
Basic useTo use any MDL component, you must include the minified CSS and JavaScript files using standard relative-path references in the To include a MDL select field component: 1. Code a <div>
...
</div> 2. Inside the div, code an <div>
<select id="gender">
<option value=""></option>
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</div> 3. Also inside the div, after the select field, code a <div>
<select id="gender">
<option value=""></option>
<option value="option1">option 1</option>
<option value="option2">option 2</option>
</select>
<label for="gender">User gender</label>
</div> 4. Add one or more MDL classes, separated by spaces, to the div container, select field, select label, and error message using the <div class="mdl-selectfield mdl-js-selectfield">
<select id="gender" class="mdl-selectfield__select">
<option value=""></option>
<option value="option1">option 1</option>
<option value="option2">option 2</option>
</select>
<label class="mdl-selectfield__label" for="gender">User gender</label>
<span class="mdl-selectfield__error">Select a value</span>
</div> The select field component is ready for use. ExamplesSelect field with a standard label. <div class="mdl-selectfield mdl-js-selectfield">
<select id="gender" class="mdl-selectfield__select">
<option value=""></option>
<option value="option1">option 1</option>
<option value="option2">option 2</option>
</select>
<label class="mdl-selectfield__label" for="gender">User gender</label>
<span class="mdl-selectfield__error">Select a value</span>
</div> Select field with a floating label. <div class="mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label">
<select id="gender" class="mdl-selectfield__select">
<option value=""></option>
<option value="option1">option 1</option>
<option value="option2">option 2</option>
</select>
<label class="mdl-selectfield__label" for="gender">User gender</label>
<span class="mdl-selectfield__error">Select a value</span>
</div> Select field with a standard label, and error message. <div class="mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label">
<select id="gender" class="mdl-selectfield__select">
<option value=""></option>
<option value="option1">option 1</option>
<option value="option2">option 2</option>
</select>
<label class="mdl-selectfield__label" for="gender">User gender</label>
<span class="mdl-textfield__error">Select a value</span>
</div> Select field with a floating label and icon. <div class="mdl-selectfield mdl-js-selectfield mdl-selectfield--floating-label">
<select id="gender" class="mdl-selectfield__select">
<option value=""></option>
<option value="option1">option 1</option>
<option value="option2">option 2</option>
</select>
<div class="mdl-selectfield__icon"><i class="material-icons">arrow_drop_down</i></div>
<label class="mdl-selectfield__label" for="gender">User gender</label>
</div> |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论