Smart Select - 图1

Smart Select Svelte Component

Smart Select allows you to easily convert your usual form selects to dynamic pages with grouped radio inputs. You can see such feature in many native apps.

It is not a separate Svelte component, but just a particular case of using and components with Framework7’s Smart Select component.

Smart Select Properties

PropTypeDefaultDescription
<ListItem> properties
smartSelectbooleanEnables Smart Select behavior
smartSelectParamsobjectObject with Smart Select Parameters

Access To Smart Select Instance

You can access Smart Select initialized instance by accessing .f7SmartSelect property of <ListItem> component.

Examples

  1. <Page>
  2. <Navbar title="Smart Select"></Navbar>
  3. <List>
  4. <ListItem title="Fruit" smartSelect>
  5. <select name="fruits" value="apple">
  6. <option value="apple">Apple</option>
  7. <option value="pineapple">Pineapple</option>
  8. <option value="pear">Pear</option>
  9. <option value="orange">Orange</option>
  10. <option value="melon">Melon</option>
  11. <option value="peach">Peach</option>
  12. <option value="banana">Banana</option>
  13. </select>
  14. </ListItem>
  15. <ListItem title="Car" smartSelect smartSelectParams={{openIn: 'popup', searchbar: true, searchbarPlaceholder: 'Search car'}}>
  16. <select name="car" multiple value={['honda', 'audi', 'ford']}>
  17. <optgroup label="Japanese">
  18. <option value="honda">Honda</option>
  19. <option value="lexus">Lexus</option>
  20. <option value="mazda">Mazda</option>
  21. <option value="nissan">Nissan</option>
  22. <option value="toyota">Toyota</option>
  23. </optgroup>
  24. <optgroup label="German">
  25. <option value="audi">Audi</option>
  26. <option value="bmw">BMW</option>
  27. <option value="mercedes">Mercedes</option>
  28. <option value="vw">Volkswagen</option>
  29. <option value="volvo">Volvo</option>
  30. </optgroup>
  31. <optgroup label="American">
  32. <option value="cadillac">Cadillac</option>
  33. <option value="chrysler">Chrysler</option>
  34. <option value="dodge">Dodge</option>
  35. <option value="ford">Ford</option>
  36. </optgroup>
  37. </select>
  38. </ListItem>
  39. <ListItem title="Mac or Windows" smartSelect smartSelectParams={{openIn: 'sheet'}}>
  40. <select name="mac-windows" value="mac">
  41. <option value="mac">Mac</option>
  42. <option value="windows">Windows</option>
  43. </select>
  44. </ListItem>
  45. <ListItem title="Super Hero" smartSelect smartSelectParams={{openIn: 'popover'}}>
  46. <select name="superhero" multiple value={['Batman']}>
  47. <option value="Batman">Batman</option>
  48. <option value="Superman">Superman</option>
  49. <option value="Hulk">Hulk</option>
  50. <option value="Spiderman">Spiderman</option>
  51. <option value="Ironman">Ironman</option>
  52. <option value="Thor">Thor</option>
  53. <option value="Wonder Woman">Wonder Woman</option>
  54. </select>
  55. </ListItem>
  56. </List>
  57. </Page>
  58. <script>
  59. import {Page, Navbar, List, ListItem} from 'framework7-svelte';
  60. </script>

← Skeleton

Sortable →