Skip to content

docs: Correct casing for icon imports in Vanilla examples #4520

Description

@Cirrous

Browser

  • Chrome/Chromium
  • Firefox
  • Safari
  • Edge
  • iOS Safari
  • Opera
  • Other/not relevant

Operating system

  • Windows
  • Linux
  • macOS
  • ChromeOS
  • iOS
  • Android
  • Other/not relevant

Description

The documentation on the website contains a small typo regarding icon imports in Vanilla JS projects.

Currently, the example shows the icon imported in lowercase, which throws an error because Lucide exports icons using PascalCase:

<script>
import { createIcons, pencil } from 'lucide'; // Throws an error

createIcons({
  icons: {
    pencil
  }
});
</script>

<i data-lucide="pencil"></i>

To make the import work:

<script>
import { createIcons, Pencil } from 'lucide'; //  pencil --> Pencil

createIcons({
  icons: {
    Pencil // pencil --> Pencil
  }
});
</script>

<i data-lucide="pencil"></i>

Steps to reproduce

See above

Checklist

  • I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    🌍 siteHas to do something with the Lucide website🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions