Files
lucide/packages/astro/src/Icon.astro
Eric Fennisandcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> f06ac67e33 chore(typchecking): More typecheck jobs for all packages (#4885)
* Add typecheck jobs

* update lockfile

* Fix types

* Fix lucide solid types

* Fix type lucide-react-native

* fix: align react-native svg mock children typing

* fix: format build font spec

* fix: restore shared workflow and RN class context

* fix: restore lucide-react build typecheck

* fix: keep react build generating icons

* fix: preserve builder color prop types

* test: cover RN provider class merge

* Revert 711255b

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-09-22 13:49:09 +02:00

45 lines
885 B
Plaintext

---
import buildLucideIconNode from './utils/buildLucideIconNode';
import type { IconProps as Props } from './types';
import { hasA11yProp } from './utils/hasA11yProp';
const {
color = 'currentColor',
size = 24,
width,
height,
'stroke-width': strokeWidth = 2,
absoluteStrokeWidth = false,
nonScalingStroke = false,
iconNode = [],
icon = {
node: iconNode,
aliases: [],
size: 24,
},
class: className,
...rest
} = Astro.props;
const [, builtIconAttributes, builtIconNode = []] = buildLucideIconNode(icon, {
color,
width: width ?? size,
height: height ?? size,
strokeWidth,
absoluteStrokeWidth,
nonScalingStroke,
className,
hasA11yProp: hasA11yProp(rest),
});
const iconAttributes = {
...builtIconAttributes,
...rest,
};
---
<svg {...iconAttributes}>
{builtIconNode.map(([Tag, attrs]) => <Tag {...attrs} />)}
<slot />
</svg>