Pen Settings



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


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


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.


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.


                <div class="container">
    <button  slot="button" behavior="button" class="selectmenu-button">
      <span behavior="selected-value" slot="selected-value"></span>      
    <option class="option">Normal</option>
    <option class="option option--h1">H1</option>
    <option class="option option--h2">H2</option>
    <option class="option option--h3">H3</option>
    <option class="option option--h4">H4</option>
    <option class="option option--quote">
<p>Note: this demo was tested and should work in Edge or Chrome Canary 105 with Experimental Web Platform Features flag on</p>
<p>See also: <a href="">Example where options are styled directly, no parts replaced</a></p>


                selectmenu {
  border: 0;
  --hover-color: #f2f3f5;
  --hover-color-2: #2276fc;
  --open-color: #d2e3fe;
.selectmenu-button {
  border: 0;
  font-size: 2em;
  border-radius: .1875rem;
  background-repeat: no-repeat;
  background-size: 1em;
  background-position: right .25em center;
  padding-right: 1.25em;
  text-align: left;
  min-width: 7em;
  background-image: url("data:image/svg+xml,%3Csvg data-sanity-icon='select' width='1em' height='1em' viewBox='0 0 25 25' fill='none' xmlns=''%3E%3Cpath d='M16.5 15.5L12.5 19.5L8.5 15.5M8.5 9.5L12.5 5.5L16.5 9.5' stroke='currentColor' stroke-width='1.2'%3E%3C/path%3E%3C/svg%3E");
  background-color: #fff;

.selectmenu-button:hover {
  background-color: var(--hover-color);

selectmenu::part(listbox) {
  position: relative;
selectmenu::part(listbox)::after {
  content: " ";
	border-bottom: 11px solid white;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
  position: absolute;
  top: 0;
  right: 0;

selectmenu option:hover {
  background-color: var(--hover-color-2);
  color: white;

.option {
  border-radius: .1875rem;
  font: inherit;
  padding: 0.75rem;
.option--h1 {
  font-size: 3em;
  font-weight: bold;
.option--h2 {
  font-size: 2em;
  font-weight: bold;
.option--h3 {
  font-size: 1.5em;
  font-weight: bold;
.option--quote span {
  border-left: .25em solid #ccc;
  padding-left: .5em;

.container {
  border: 1px solid #ccc;
  padding: 0.25em;

body {
  font-family: sans-serif;