<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHID",
  "identifier" : "/documentation/CoreHID/HIDElement/unit",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core HID"
    ],
    "preciseIdentifier" : "s:7CoreHID10HIDElementV4units6UInt32VSgvp"
  },
  "title" : "unit"
}
-->

# unit

The HID specification compliant unit code for this element.

```
var unit: UInt32?
```

## Discussion

The unit code specifies the physical units for the physical value, such as Seconds or Amperes.

See the HID specification for more details: [](https://www.usb.org/hid).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)