# useId

A hook that generates a unique ID using nanoid.

This hook provides a simple way to generate unique identifiers for elements and components. It uses the nanoid library to create URL-safe, compact, and unique IDs.

## Usage

```tsx
import { useId } from '@woby/use'

const MyComponent = () => {
  const id = useId()
  
  return (
    <div>
      <label htmlFor={id}>Input field</label>
      <input id={id} type="text" />
    </div>
  )
}
```

## Parameters

This hook does not take any parameters.

## Return Value

Returns a unique string ID generated by nanoid.

## Example

```tsx
const id = useId()

return (
  <div>
    <label htmlFor={id}>Input field</label>
    <input id={id} type="text" />
  </div>
)
```

## Implementation Details

The hook is a direct export of the nanoid function, which generates secure, URL-friendly unique IDs. The generated IDs are 21 characters long by default and use a large alphabet that makes collisions extremely unlikely.

## Use Cases

- Generating unique IDs for form elements
- Creating unique keys for list items
- Generating identifiers for DOM elements that need to be referenced
- Creating unique identifiers for accessibility attributes

## See Also

- [nanoid documentation](https://github.com/ai/nanoid)