Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ 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

Save Automatically?

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

              
                <label for="q">CEP</label>
<tadashi-pesquisa
  id="pesquisa"
  endpoint="https://ws.apicep.com/cep.json"
  prop="code"
  method="get"
  fx="true"
>
  <input
    type="text"
		id="q"
		name="q"
    class="pesquisa"
		placeholder="04080-000"
		data-mask="99999-999"
	>
</tadashi-pesquisa>

<br>

<label>Sample with the custom styled button via css
	<tadashi-pesquisa
		class="custom"
		endpoint="https://service.com/endpoint"
	>
		<input type="text" name="fake" placeholder="fake api trigger" class="pesquisa">
	</tadashi-pesquisa>
</label>
<pre id="data"></pre>
              
            
!

CSS

              
                body {
	color: #333;
	margin: 0;
	padding: 8px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pesquisa {
	width: 100%;
	height: 36px;
	box-sizing: border-box;
}

.custom {
	--tadashi_pesquisa__trigger_background_color: lightgray;
	--tadashi_pesquisa__trigger_background_image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 32 32" width="24" height="24"><path fill="hsl(0deg 0% 0%)" d="M20.682 3.732c-0.473-0.472-1.1-0.732-1.768-0.732s-1.295 0.26-1.77 0.733l-1.41 1.412c-0.473 0.472-0.734 1.1-0.734 1.769 0 0.471 0.129 0.922 0.371 1.313l-13.577 5.439c-0.908 0.399-1.559 1.218-1.742 2.189-0.185 0.977 0.125 1.979 0.834 2.687l12.72 12.58c0.548 0.548 1.276 0.859 2.045 0.877 0.018 0.001 0.060 0.001 0.078 0.001 0.202 0 0.407-0.021 0.61-0.062 0.994-0.206 1.808-0.893 2.177-1.828l5.342-13.376c0.402 0.265 0.875 0.407 1.367 0.407 0.67 0 1.297-0.261 1.768-0.733l1.407-1.408c0.477-0.474 0.738-1.103 0.738-1.773s-0.262-1.3-0.732-1.768l-7.724-7.727zM16.659 29.367c-0.124 0.313-0.397 0.544-0.727 0.612-0.076 0.016-0.153 0.022-0.229 0.021-0.254-0.006-0.499-0.108-0.682-0.292l-12.728-12.588c-0.234-0.233-0.337-0.567-0.275-0.893 0.061-0.324 0.279-0.598 0.582-0.73l6.217-2.49c4.189 1.393 8.379 0.051 12.57 4.522l-4.728 11.838zM26.992 13.58l-1.414 1.413c-0.195 0.196-0.512 0.196-0.707 0l-1.768-1.767-1.432 3.589 0.119-0.303c-3.010-3.005-6.069-3.384-8.829-3.723-0.887-0.109-1.747-0.223-2.592-0.405l8.491-3.401-1.715-1.715c-0.195-0.195-0.195-0.512 0-0.707l1.414-1.415c0.195-0.195 0.512-0.195 0.707 0l7.725 7.727c0.198 0.195 0.198 0.512 0.001 0.707zM16.5 21c1.378 0 2.5-1.121 2.5-2.5s-1.121-2.5-2.5-2.5c-1.379 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5zM16.5 17c0.828 0 1.5 0.672 1.5 1.5s-0.672 1.5-1.5 1.5c-0.829 0-1.5-0.672-1.5-1.5s0.671-1.5 1.5-1.5zM29.5 0c-1.379 0-2.5 1.121-2.5 2.5s1.121 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.121-2.5-2.5-2.5zM29.5 4c-0.828 0-1.5-0.672-1.5-1.5s0.672-1.5 1.5-1.5 1.5 0.672 1.5 1.5-0.672 1.5-1.5 1.5zM8 17c0 1.103 0.897 2 2 2s2-0.897 2-2-0.897-2-2-2-2 0.897-2 2zM10 16c0.552 0 1 0.447 1 1s-0.448 1-1 1-1-0.447-1-1 0.448-1 1-1zM12 23c0-0.552 0.448-1 1-1s1 0.448 1 1c0 0.552-0.448 1-1 1s-1-0.448-1-1zM28 8c0-0.552 0.448-1 1-1s1 0.448 1 1c0 0.552-0.448 1-1 1s-1-0.448-1-1z"></path></svg>');
	--tadashi_pesquisa__trigger___loading_background_image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 100 100" width="40" height="40"><path fill="hsl(0deg 0% 0%)" d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"><animateTransform attributeName="transform" attributeType="XML" type="rotate" dur="0.5s" from="0 50 50" to="360 50 50" repeatCount="indefinite" /></path></svg>');
}
              
            
!

JS

              
                import Mask from 'https://unpkg.com/@tadashi/mask@3.0.0/src/index.js'
new Mask(q, {init: true})

pesquisa.addEventListener('response', event => {
	data.textContent = JSON.stringify(event.detail, undefined, '  ')
})

              
            
!
999px

Console