Search/

Setting list

Last modified:

A clean way of listing user options with support for switch toggles and control inputs.

Variants

Example of Setting list - default

<ul className="bc-setting-list">
    <li className="bc-setting-list__item">
      <BcSwitchInput
        label={<>Activity on <strong>subscribed</strong> submissions</>}
        id='setting-list-switch-block-eg1'
        name="switch"
        isReverse
        justify
        defaultChecked
      />
    </li>
    <li className="bc-setting-list__item">
      <BcSwitchInput
        label={<>Team members <strong>@mention</strong> me</>}
        id='setting-list-switch-block-eg2'
        name='switch'
        isReverse
        justify
      />
    </li>
    <li className="bc-setting-list__item">
      <BcSwitchInput
        label={<>I’m <strong>assigned</strong> to a submission</>}
        id='setting-list-switch-block-eg3'
        name='switch'
        isReverse
        justify
      />
    </li>
    <li className="bc-setting-list__item">
      <label className="bc-setting-list__control-input-label" htmlFor="checkbox-spiders">
        <div className="bc-setting-list__item-text">
          <BcLabel htmlFor='checkbox-spiders'>
            Receive sporadic <strong>spiders</strong>
          </BcLabel>
        </div>
        <div className="bc-setting-list__item-controls bc-control-input--unlabelled">
          <BcControlInput id="checkbox-spiders" name="checkbox-spiders" value='Yes' />
        </div>
      </label>
    </li>
    <li aria-describedby="setting__team-or-researcher-notification-types-react" className="bc-setting-list__item" role="group">
      <div className="bc-setting-list__item-text" id="setting__team-or-researcher-notification-types-react">
        <BcLabel htmlFor='checkbox'>
          Someone writes a <strong>team note</strong> or a researcher <strong>replies</strong>
        </BcLabel>
      </div>
      <div className="bc-setting-list__item-controls">
        <BcControlInput id="setting__team-or-researcher-notification-types-web" name='checkbox-web' value='Web' label='Web' />
        <BcControlInput defaultChecked id="setting__team-or-researcher-notification-types-email" name='checkbox-email' value='Email' label='Email' />
      </div>
    </li>
    <li aria-describedby="setting__ponies-react" className="bc-setting-list__item" role="group">
      <div className="bc-setting-list__item-text" id="setting__ponies-react">
        <BcLabel htmlFor='setting__ponies-react'>
          Receive sporadic <strong>ponies</strong>
        </BcLabel>
      </div>
      <div className="bc-setting-list__item-controls">
        <BcControlInput defaultChecked type="radio" id="setting__ponies-react-on" name='sporadic-ponies__on' value='On' label='On' />
        <BcControlInput type="radio" id="setting__ponies-react-off" name='sporadic-ponies__off' value='Off' label='Off' />
      </div>
    </li>
  </ul>

React documentation

Last modified:

ℹ️ This feature doesn’t have a corresponding React component yet.

HTML

Last modified:

Add .bc-setting-list to an <ul> or <ol> element inside a <form>.

Design

Last modified:

Use to group related user options into a list.

You can apply a border to the list by appending the Panel container class .bc-panel on the <ul> (or <ol>). Therein, the list items receive horizontal padding.

Please curtail the max-width of the Setting list through the Grid system, to ensure the form labels are not too far from their corresponding form controls.

Setting List dependencies

Accessibility

Last modified:

The setting list places all controls inline.

For settings with a single checkbox the text on the left becomes that checkbox’s label.

However, grouped radio buttons and checkboxes require some additional ARIA tags since they are no longer grouped using <fieldset>s within the list.

Use aria-describedby to associate a group of checkboxes or radio buttons with the left-hand descriptor text for said group. For an example see the markup below.

Rationale

Last modified:

See also

Last modified: