mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-18 17:27:41 +01:00
Compare commits
3 Commits
package/an
...
0.562.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b4075b89b | ||
|
|
7a68e10b12 | ||
|
|
a4531a9985 |
@@ -102,10 +102,16 @@ The example below imports all ES Modules, so exercise caution when using it. Imp
|
||||
|
||||
### Icon Component Example
|
||||
|
||||
```jsx
|
||||
import { icons } from 'lucide-react-native';
|
||||
```tsx
|
||||
import * as icons from 'lucide-react-native/icons';
|
||||
|
||||
const Icon = ({ name, color, size }) => {
|
||||
interface IconProps {
|
||||
name: keyof typeof icons;
|
||||
color?: string;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
const Icon = ({ name, color, size }: IconProps) => {
|
||||
const LucideIcon = icons[name];
|
||||
|
||||
return <LucideIcon color={color} size={size} />;
|
||||
@@ -116,11 +122,11 @@ export default Icon;
|
||||
|
||||
#### Using the Icon Component
|
||||
|
||||
```jsx
|
||||
```tsx
|
||||
import Icon from './Icon';
|
||||
|
||||
const App = () => {
|
||||
return <Icon name="house" />;
|
||||
return <Icon name="House" />;
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
37
icons/toolbox.json
Normal file
37
icons/toolbox.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"$schema": "../icon.schema.json",
|
||||
"contributors": [
|
||||
"karsa-mistmere"
|
||||
],
|
||||
"tags": [
|
||||
"toolkit",
|
||||
"tools",
|
||||
"trunk",
|
||||
"chest",
|
||||
"box",
|
||||
"storage",
|
||||
"utility",
|
||||
"utilities",
|
||||
"container",
|
||||
"kit",
|
||||
"set",
|
||||
"repair",
|
||||
"fix",
|
||||
"service",
|
||||
"maintenance",
|
||||
"mechanic",
|
||||
"workshop",
|
||||
"construction",
|
||||
"hardware",
|
||||
"equipment",
|
||||
"gear",
|
||||
"handyman",
|
||||
"engineering",
|
||||
"craft",
|
||||
"diy"
|
||||
],
|
||||
"categories": [
|
||||
"tools",
|
||||
"home"
|
||||
]
|
||||
}
|
||||
17
icons/toolbox.svg
Normal file
17
icons/toolbox.svg
Normal file
@@ -0,0 +1,17 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M16 12v4" />
|
||||
<path d="M16 6a2 2 0 0 1 1.414.586l4 4A2 2 0 0 1 22 12v7a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 .586-1.414l4-4A2 2 0 0 1 8 6z" />
|
||||
<path d="M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2" />
|
||||
<path d="M2 14h20" />
|
||||
<path d="M8 12v4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 471 B |
@@ -24,11 +24,23 @@
|
||||
"author": "Eric Fennis",
|
||||
"amdName": "lucide-react-native",
|
||||
"main": "dist/cjs/lucide-react-native.js",
|
||||
"main:umd": "dist/umd/lucide-react-native.js",
|
||||
"module": "dist/esm/lucide-react-native.js",
|
||||
"unpkg": "dist/umd/lucide-react-native.min.js",
|
||||
"typings": "dist/lucide-react-native.d.ts",
|
||||
"react-native": "dist/esm/lucide-react-native.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/lucide-react-native.d.ts",
|
||||
"import": "./dist/esm/lucide-react-native.js",
|
||||
"browser": "./dist/esm/lucide-react-native.js",
|
||||
"require": "./dist/cjs/lucide-react-native.js"
|
||||
},
|
||||
"./icons": {
|
||||
"types": "./dist/icons.d.ts",
|
||||
"import": "./dist/esm/icons/index.js",
|
||||
"browser": "./dist/esm/icons/index.js",
|
||||
"require": "./dist/cjs/icons/index.js"
|
||||
}
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -5,7 +5,7 @@ import pkg from './package.json' with { type: 'json' };
|
||||
const packageName = 'LucideReact';
|
||||
const outputFileName = 'lucide-react-native';
|
||||
const outputDir = 'dist';
|
||||
const inputs = ['src/lucide-react-native.ts'];
|
||||
const inputs = ['src/lucide-react-native.ts', 'src/icons/index.ts'];
|
||||
const bundles = [
|
||||
{
|
||||
format: 'cjs',
|
||||
@@ -60,6 +60,16 @@ export default [
|
||||
],
|
||||
plugins: [dts()],
|
||||
},
|
||||
{
|
||||
input: inputs[1],
|
||||
output: [
|
||||
{
|
||||
file: `dist/icons.d.ts`,
|
||||
format: 'es',
|
||||
},
|
||||
],
|
||||
plugins: [dts()],
|
||||
},
|
||||
{
|
||||
input: `src/${outputFileName}.suffixed.ts`,
|
||||
output: [
|
||||
|
||||
@@ -31,6 +31,7 @@ const Icon = forwardRef<SVGSVGElement, IconComponentProps>(
|
||||
absoluteStrokeWidth,
|
||||
children,
|
||||
iconNode,
|
||||
className,
|
||||
...rest
|
||||
},
|
||||
ref,
|
||||
@@ -46,6 +47,7 @@ const Icon = forwardRef<SVGSVGElement, IconComponentProps>(
|
||||
{
|
||||
ref,
|
||||
...defaultAttributes,
|
||||
className,
|
||||
width: size,
|
||||
height: size,
|
||||
...customAttrs,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export * from './icons';
|
||||
export * as icons from './icons';
|
||||
export * from './aliases/prefixed';
|
||||
export * from './types';
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export * from './icons';
|
||||
export * as icons from './icons';
|
||||
export * from './aliases/suffixed';
|
||||
export * from './types';
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export * from './icons';
|
||||
export * as icons from './icons';
|
||||
export * from './aliases';
|
||||
export * from './types';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user