Open this example in the interactive library
Live preview
Source code
// components/UniqueVocabularyList.tsx
export default function UniqueVocabularyList({
source = "Copper Studio North",
}: { source?: string } = {}) {
const words = source.toLowerCase().match(/\p{L}+/gu) ?? [];
return (
<ul>
{[...new Set(words)].sort().map((w) => (
<li key={w}>{w}</li>
))}
</ul>
);
}
