Skip to main content

Shortcode Labels

The CountryDropdown and RegionDropdown fields both let you customize the display values for the dropdowns. Either full (default) or short. You can mix and match. Note that this is purely for the label. If you want to change the values (i.e. what'll be saved + submitted to the server), see the next demo.


import React, { useState } from 'react';
import { CountryDropdown, RegionDropdown } from 'react-country-region-selector';

const ShortcodeLabels = () => {
const [country, setCountry] = useState('');
const [region, setRegion] = useState('');

return (
<>
<CountryDropdown
value={country}
labelType="short"
onChange={(val) => setCountry(val)}
/>
<RegionDropdown
country={country}
value={region}
labelType="short"
onChange={(val) => setRegion(val)}
/>
</>
);
};

export default ShortcodeLabels;