Skip to content

Conversation

@wavebeem
Copy link

@wavebeem wavebeem commented Dec 1, 2025

Description

The .append method of elements takes plain text, not HTML. This updates the code to use .insertAdjacentHTML instead.

Before Submitting

The .append method of elements takes plain text, not HTML. This updates the code to use .insertAdjacentHTML instead.
@github-actions github-actions bot added the 🌍 site Has to do something with the Lucide website label Dec 1, 2025
});
document.body.append('<i data-lucide="$Name"></i>');\
document.body.insertAdjacentHTML('beforeend', '<i data-lucide="$Name"></i>');\
Copy link
Member

@karsa-mistmere karsa-mistmere Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, maybe we should skip this entire statement and have the code example be a HTML block containing something like:

<script>
import { createIcons } from 'lucide';
import { $CamelCase } from '@lucide/lab';

createIcons({
  icons: {
    $CamelCase
  },
});
</script>

<i data-lucide="$Name"></i>

I think for vanilla JS this would make much more sense than appending to the DOM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌍 site Has to do something with the Lucide website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants