<script context="module">
import Device from 'svelte-device-info'
</script>
<script>
console.log('this device is ' + (Device.isMobile ? '' : 'not') + ' mobile')
switch (true) {
case Device.isPhone: console.log('this device is a smartphone'); break
case Device.isTablet: console.log('this device is a tablet'); break
default: console.log('this device is neither a smartphone nor a tablet')
}
</script>
Open the console (shown below) to see the output of this example