Skip to content

Commit

Permalink
more doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Feb 12, 2025
1 parent aabcbb6 commit 5f84d3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sites/docs/content/components/pin-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ For more in-depth information on controlled components and advanced state manage

</Callout>

## Paste Handling
## Paste Transformation

The `onPaste` prop allows you to sanitize pasted text. This can be useful for cleaning up pasted text, like removing hyphens or other characters that should not make it into the input. This function should return the sanitized text.
The `pasteTransformer` prop allows you to sanitize/transform pasted text. This can be useful for cleaning up pasted text, like removing hyphens or other characters that should not make it into the input. This function should return the sanitized text, which will be used as the new value of the input.

```svelte
<script lang="ts">
import { PinInput } from "bits-ui";
</script>
<PinInput.Root onPaste={(text) => text.replace(/-/g, "")}>
<PinInput.Root pasteTransformer={(text) => text.replace(/-/g, "")}>
<!-- ... -->
</PinInput.Root>
```
Expand Down

0 comments on commit 5f84d3d

Please sign in to comment.