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.


                link(href=",300,400" rel="stylesheet")

h1 Custom Select Component
p A styleable, dynamic dropdown componet with Vue.js 
    span.selected-option {{ placeholder }}
     svg(width="24" height="24" viewBox="0 0 24 24")
          v-for="option in options"
          v-bind:class="{'selected': option === selected}"
            span.option-text {{ option }}



                $vue-navy: #2c3e50;
$vue-navy-light: #3a5169;
$vue-teal: #42b883;
$vue-teal-light: #42b983;
$light-gray: #f8f8f8;

@mixin active-state() {
  background-color: #f4fbf8;
  border: none;

@mixin ellipsis() {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

body {
  background: $light-gray;
  color: $vue-navy;
  font-family: 'Source Sans Pro', sans-serif;
  min-height: 1000px;

h1 {
  font-size: 3.6em;
  font-weight: 100;
  text-align: center;
  margin-bottom: 0;
  color: $vue-teal;

p {
  color: $vue-navy-light;
  text-align: center;
  margin-top: 10px;

.vue-select {
  width: 300px;
  background-color: #fff;
  margin: 45px auto;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.06);
  border: none;
  transition: all 200ms linear;
  .selected-option {
    @include ellipsis();
    display: inline-block;
    padding: 15px 50px 15px 15px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
    transition: all 200ms linear;
    &:hover {
      color: rgba(0,0,0,.45);
    svg {
      fill: $vue-teal;
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      transition: fill 300ms linear;
      &:hover {
        fill: darken($vue-teal, 15%);

.dropdown-options-container {
  overflow-y: scroll;
  height: 150px;

.dropdown-options--cell {
  padding: 15px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  &:hover { 
    @include active-state();
.dropdown-options.selected {
  .dropdown-options--cell {
    @include active-state(); 

.slide-enter-active, .slide-leave-active  {
  transition: height 150ms ease;

.slide-enter, .slide-leave-to {
  height: 0px;


                window.demoOptions = [
  "A really long option A really long option A really long option A really long option A really long option"

Vue.component('vue-select', {
  template: '#vue-select-template',
  data() {
    return {
      selected: "select an option",
      showDropdown: false
  methods: {
    toggleDropdown() {
      this.showDropdown = !this.showDropdown;
    selectOption(option) {
      this.selected = option;
      this.placeholder = option;
      // inform parent (the form) of a selection so the model can be updated.
      this.$emit('interface', this.selected)
  props: {
    options: {
      defaut: [],
      type: Array,
    placeholder: {
      default: "Select from the dropdown",
      type: String

new Vue({
  el: '#app'