<label>
    <select name="test1" id="test1" disabled>
        <option value="option1">Option 1</option>
        <option value="option2">Option 2</option>
        <option value="option3">Option 3</option>
    </select>
</label>
  • Content:
    body {
      font-family: 'Helvetica Neue';
      font-size: 18px;
    }
    
    *,
    *::before,
    *::after {
      box-sizing: border-box;
    }
    
    label {
      color: var(--text-color);
      font-size: 18px;
      display: inline-block;
      margin: .375em;
    }
    
    input[type="radio"], input[type="checkbox"] {
      display: inline-block;
      margin: 0 .33em 0 0;
      accent-color: var(--purple-800-brand);
    }
    
    input[type="radio"]:disabled, input[type="checkbox"]:disabled {
      cursor: not-allowed;
    }
    
    input[type="radio"]:focus, input[type="checkbox"]:focus {
      outline-color: var(--purple-800-brand);
    }
    
    .radio-header, .checkbox-header {
      margin: .5em 0 0;
      color: var(--gray-800);
    }
    
    .horizontal-group label {
      margin: .375em;
    }
    
    .vertical-group label {
      display: block;
    }
    
    select {
      display: block;
      color: var(--text-color);
      border-color: var(--text-color);
      border-radius: 6px;
      font-size: 18px;
      padding: .25em 1em .25em .25em;
    }
    
    select:hover {
      border-color: var(--gray-800);
    }
    
    select:focus{
      border-color: var(--purple-800-brand);
    }
    
    select:focus-visible {
      outline-color: var(--purple-800-brand);
    }
    
    select:disabled {
      cursor: not-allowed;
      border: none;
      background-color: var(--disabled-color);
      opacity: 75%;
    }
  • URL: /components/raw/select/selectables.css
  • Filesystem Path: components/02-components/select/selectables.css
  • Size: 1.2 KB

Usage Guidelines

  • Use when you have 5 or more options, otherwise use radio buttons if you have the space
  • Use a consistent size of form components on the same page (i.e. using same width/height of a text input)
  • Don’t overwhelm the user with too many options
  • Keep options to a single line of text