# useFilter
> Provides locale-aware string filtering methods.

Provides locale-aware string filtering with `contains`, `startsWith`, and `endsWith` methods. Built on `Intl.Collator` for proper locale-sensitive string comparison.

## Import

```js
import { useFilter } from '@volue/wave-react';
```

## Example

```jsx
() => {
  const { contains, startsWith, endsWith } = useFilter('en', {
    sensitivity: 'base'
  });

  const items = ['Apple', 'Résumé', 'Naïve', 'Crème brûlée', 'Café'];
  const [query, setQuery] = React.useState('');

  const filtered = items.filter(item => contains(item, query));

  return (
    <Flex flow="column">
      <TextInput
        value={query}
        onChange={e => setQuery(e.target.value)}
        placeholder='Try typing "creme" or "cafe"…'
      />
      <Flex flow="column" gap="spacingXs">
        {filtered.map(item => (
          <Text key={item}>{item}</Text>
        ))}
      </Flex>
    </Flex>
  );
};
```

---

## API reference

### Arguments

| Name      | Type                   | Default | Description                       | Required |
| --------- | ---------------------- | ------- | --------------------------------- | -------- |
| `locale`  | `string`               | `—`     | The locale for string comparison. | Yes      |
| `options` | `Intl.CollatorOptions` | `—`     | Additional collation options.     |          |

### Returns

```ts
{
  startsWith: (string: string, substring: string) => boolean;
  endsWith: (string: string, substring: string) => boolean;
  contains: (string: string, substring: string) => boolean;
}
```
