# useId



## Introduction

The `useId` hook creates an autogenerated unique `id` for an element. An `id`
from props can used instead of the autogenerated `id` when available.

## Example

```tsx
import {useId} from '@react-aria/utils';

let elementId = useId();
let componentId = useId(props.id);
```

## API

<FunctionAPI
  function={docs.exports.useId}
  links={docs.links}
/>
