Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.amber-pink.min.css" />
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>

<h1>Material Design Toggle Switch</h1>

<hr />
<h2>チェックボックス</h2>

<div class="inner">
	<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="checkbox-1">
	<input type="checkbox" id="checkbox-1" class="mdl-checkbox__input" checked />
		<span class="mdl-checkbox__label">Checkbox</span>
	</label>
<!-- / .inner --></div>

<div class="inner">
	<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="checkbox-2">
	<input type="checkbox" id="checkbox-2" class="mdl-checkbox__input" />
		<span class="mdl-checkbox__label">Checkbox</span>
	</label>
<!-- / .inner --></div>


<hr />
<h2>ラジオボタン</h2>

<div class="inner">
	<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="option-1">
	<input type="radio" id="option-1" class="mdl-radio__button" name="options" value="1" checked />
		<span class="mdl-radio__label">RadioButton</span>
	</label>
<!-- / .inner --></div>
<div class="inner">
	<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="option-2">
	<input type="radio" id="option-2" class="mdl-radio__button" name="options" value="2" />
		<span class="mdl-radio__label">RadioButton</span>
	</label>
<!-- / .inner --></div>


<hr />
<h2>アイコントグル</h2>

<div class="inner">
	<label class="mdl-icon-toggle mdl-js-icon-toggle mdl-js-ripple-effect" for="icon-toggle-1">
	<input type="checkbox" id="icon-toggle-1" class="mdl-icon-toggle__input" checked />
		<i class="mdl-icon-toggle__label material-icons">format_bold</i>
	</label>
<!-- / .inner --></div>

<div class="inner">
	<label class="mdl-icon-toggle mdl-js-icon-toggle mdl-js-ripple-effect" for="icon-toggle-2">
	<input type="checkbox" id="icon-toggle-2" class="mdl-icon-toggle__input" />
		<i class="mdl-icon-toggle__label material-icons">format_italic</i>
	</label>
<!-- / .inner --></div>


<hr />
<h2>トグルスイッチ</h2>

<div class="inner">
	<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="switch-1">
	<input type="checkbox" id="switch-1" class="mdl-switch__input" checked />
		<span class="mdl-switch__label"></span>
	</label>
<!-- / .inner --></div>

<div class="inner">
	<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="switch-2">
	<input type="checkbox" id="switch-2" class="mdl-switch__input" />
		<span class="mdl-switch__label"></span>
	</label>
<!-- / .inner --></div>

</body>
</html>
              
            
!

CSS

              
                body {
  text-align:center;
}
.inner {
  display:inline-block;
  text-align:left;
  margin:2em 3em;
}
              
            
!

JS

              
                
              
            
!
999px

Console