Country Dropdown

Use the select component as a country picker on mobile and desktop. You can add the dropdown to any input or use Mobiscroll input fields. If you don't want to make it a dropdown, you can embed the picker inline right into a page.

Search is enabled through the filter option.

In this example the data is loaded from a remote JSON in the following format: { "value": "FJ", "group": "F", "text": "Fiji" } and the flags are loaded from our server. For your implementation you should embed the list and flags into your own page.

For the image & text rendering use a custom item template.

Download and try example

Demo

Loading the live demo

Preview in full screen

Code

mobiscroll.setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
});

var inst = mobiscroll.select('#demo-country-picker', {
  display: 'anchored',
  filter: true,
  itemHeight: 40,
  renderItem: function (item) {
    return (
      '<div class="md-country-picker-item">' +
      '<img class="md-country-picker-flag" src="https://img.mobiscroll.com/demos/flags/' +
      item.data.value +
      '.png" />' +
      item.display +
      '</div>'
    );
  },
});

mobiscroll.getJson('https://trial.mobiscroll.com/content/countries.json', function (resp) {
  var countries = [];
  for (var i = 0; i < resp.length; ++i) {
    var country = resp[i];
    countries.push({ text: country.text, value: country.value });
  }
  inst.setOptions({ data: countries });
});
  

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.