# Run a first use-device example

Start with the smallest workflow described by the README for **use-device**. Complete [installation and configuration](/docs/up-to-code-use-device/installation-guide) first.

## Use

```tsx
import { Text, View } from 'react-native';
import { useDevice } from '@kyna-code/use-device';

export function EnvironmentSummary() {
  const device = useDevice();

  return (
    <View>
      <Text>{device.width} × {device.height}</Text>
      <Text>{device.platform}</Text>
      <Text>{device.languageTag}</Text>
      <Text>{device.theme}</Text>
    </View>
  );
}
```

The returned snapshot updates when the app window, font scale, system theme, or
locale changes. `width` and `height` are the app-window dimensions in logical
pixels, not the physical screen size, so they behave correctly with split-screen
and resizable web or desktop windows.

App-specific decisions—such as breakpoints, supported interface languages, and
theme color tokens—belong in the consuming app and can be derived from this hook.

## Expected result

Render `EnvironmentSummary` inside an Expo screen. It should display the app-window width and height, platform, locale tag, and theme. Resize the window or change the system theme and confirm the snapshot updates. Width and height are logical pixels; choose your own breakpoints instead of treating them as physical screen measurements.

## Verify the repository source

For contributors working in the repository checkout, the root manifest provides this check. If you installed a library into another application, use that application’s scripts instead:

```sh
npm run typecheck
```

Read any errors before continuing. Build and type checks verify source consistency; exercise the README example to verify the behavior you need.

## Next task

[Read the usage guide](/docs/up-to-code-use-device/usage-guide) for the documented components, configuration, and source layout.

## Source and help

- [GitHub repository](https://github.com/qentrah/use-device)
- [Original README](https://github.com/qentrah/use-device/blob/main/README.md)
- [Issues and existing reports](https://github.com/qentrah/use-device/issues)

The catalog identifies the license as **MIT**. Read the repository license before redistributing source or assets.