mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 13:17:00 +04:00
25 lines
736 B
Plaintext
25 lines
736 B
Plaintext
---
|
|
import { iconSvg, iconSourceComment } from '@shared/lib/svg'
|
|
|
|
/** core/scss/ui/_icons.scss `.icon-{size}` modifier classes */
|
|
export type IconSize = 'sm' | 'md' | 'lg'
|
|
|
|
interface Props {
|
|
name: string
|
|
/** filled icon variant (default: outline) */
|
|
filled?: boolean
|
|
class?: string | undefined
|
|
color?: string | undefined
|
|
size?: IconSize | undefined
|
|
inline?: boolean
|
|
}
|
|
|
|
const { name, filled, class: className, color, size, inline } = Astro.props
|
|
|
|
const classes = ['icon', className, color && `text-${color}`, inline && 'icon-inline', size && `icon-${size}`].filter(Boolean).join(' ')
|
|
|
|
const svg = iconSvg(name, { filled, classes })
|
|
---
|
|
|
|
{svg !== undefined && <Fragment set:html={`${iconSourceComment(name)}\n\t${svg}`} />}
|