flags.mdx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. title: Flags
  3. description: Thanks to the Tabler flags plugin, you can create flags to visually represent countries or languages. Flags are often used in forms, as an element of a delivery address, phone number dialling code and many more.
  4. plugin: flags
  5. libs: tabler-flags
  6. ---
  7. import config from '../config.json'
  8. ## Installation
  9. This part of Tabler is distributed as plugin. To enable it you should include `tabler-flags.css` or `tabler-flags.min.css` file to your page.
  10. You can also include plugin via CDN:
  11. ```html
  12. <link rel="stylesheet" href="$TABLER_CDN/dist/css/tabler-flags.min.css">
  13. ```
  14. ## Flag
  15. To create a flag, add the `flag` class to a component and choose the country whose flag you want to use. The full list of countries can be found below.
  16. ```html code example centered separated plugins="flags"
  17. <span class="flag flag-country-tg"></span>
  18. <span class="flag flag-country-br"></span>
  19. <span class="flag flag-country-pt"></span>
  20. ```
  21. ## Flag sizes
  22. Using Bootstrap’s typical naming structure, you can create a standard flag, or scale it up or down to different sizes based on what’s needed.
  23. ```html example centered separated plugins="flags"
  24. <span class="flag flag-xl flag-country-us"></span>
  25. <span class="flag flag-lg flag-country-us"></span>
  26. <span class="flag flag-md flag-country-us"></span>
  27. <span class="flag flag-sm flag-country-us"></span>
  28. <span class="flag flag-xs flag-country-us"></span>
  29. ```
  30. ```html
  31. <span class="flag flag-xl ..."></span>
  32. <span class="flag flag-lg ..."></span>
  33. <span class="flag flag-md ..."></span>
  34. <span class="flag flag-sm ..."></span>
  35. <span class="flag flag-xs ..."></span>
  36. ```
  37. ## Types
  38. To use the flag of a particular country, add the `flag-country-(country name)` class. For example, to create a flag of Andorra should use the following class: `.flag-country-ad`.
  39. <FlagsTable flags={config.flags}/>