docs: add icons component with lucide-react integration (#4682)
* ✨ (package.json): add lucide-react package to dependencies for using Lucide icons in the project ✨ (index.tsx): create a new Icon component to render Lucide icons with specified name, size, and color properties * ♻️ (package.json): remove lucide-react dependency as it is no longer needed in the project * ⬆️ (package.json): upgrade lucide-react dependency to version 0.460.0
This commit is contained in:
parent
596c27b23e
commit
50ac92dda4
3 changed files with 289 additions and 305 deletions
19
docs/src/components/icon/index.tsx
Normal file
19
docs/src/components/icon/index.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import React from "react";
|
||||
import * as LucideIcons from "lucide-react";
|
||||
|
||||
/*
|
||||
How to use this component:
|
||||
|
||||
import Icon from "@site/src/components/icon";
|
||||
|
||||
<Icon name="AlertCircle" size={24} color="red" />
|
||||
*/
|
||||
|
||||
type IconProps = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export default function Icon({ name, ...props }: IconProps) {
|
||||
const Icon = LucideIcons[name];
|
||||
return Icon ? <Icon {...props} /> : null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue