
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
device-picker
Advanced tools
[](https://www.npmjs.com/package/device-picker)
npm install device-picker
import React from 'react';
import { View, DevicePicker } from 'device-picker';
import memoize from 'lodash/memoize';
function MyDevicePicker() {
return (
<DevicePicker
allowOrphan={true}
initialDevice={'iPhone'}
initialView={View.Grid}
fetchHierarchy={() =>
fetch(
'https://www.cominor.com/api/2.0/wikis/CATEGORY?display=hierarchy',
).then(response => response.json())
}
fetchChildren={
memoize(title =>
fetch(
`https://www.cominor.com/api/2.0/wikis/CATEGORY/${title}/children`,
).then(response => response.json()),
)
}
onSubmit={title => alert(`Selected "${title}"`)}
onCancel={() => alert(`Cancelled`)}
objectName="device"
/>
);
}
export default MyDevicePicker;
Prop | Type | Default | Required | Description |
---|---|---|---|---|
allowOrphan | boolean | false | No | |
initialDevice | string | '' | No | Default device to load picker with. |
initialView | View | View.Grid | No | Default layout for displaying devices. Available options View.Grid , View.Column . For IE defaults to View.Column |
fetchHierarchy | function | undefined | Yes | Function to get devices categories |
fetchChildren | function | undefined | Yes | Function to get category items |
onSubmit | function | undefined | Yes | Function that receives the device title. |
onCancel | function | undefined | Yes | Function when picker is cancelled. |
objectName | string | device | No | Singular object name for objects, usually "Device" or "Category". |
Clone repo
git clone https://github.com/iFixit/device-picker.git
Change directory
cd device-picker
Install dependencies
npm install
Start dev server
npm run dev
FAQs
[](https://www.npmjs.com/package/device-picker)
The npm package device-picker receives a total of 1 weekly downloads. As such, device-picker popularity was classified as not popular.
We found that device-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.