@props([ 'name' => '', 'style' => 'outlined', // 'outlined', 'rounded', 'sharp' 'filled' => false, 'weight' => 400, 'grade' => 0, 'opsz' => 24, 'size' => null, // e.g. 16, 18, 20, 24, or '1.25rem', '18px' ]) @php $styleClass = match ($style) { 'rounded' => 'material-symbols-rounded', 'sharp' => 'material-symbols-sharp', default => 'material-symbols-outlined', }; $fillVal = $filled ? 1 : 0; $variation = "'FILL' {$fillVal}, 'wght' {$weight}, 'GRAD' {$grade}, 'opsz' {$opsz}"; $iconName = trim(!empty($name) ? $name : (string)$slot); $sizeStyle = ''; if ($size) { $sizeValue = is_numeric($size) ? "{$size}px" : $size; $sizeStyle = "font-size: {$sizeValue}; width: {$sizeValue}; height: {$sizeValue};"; } @endphp merge([ 'class' => "{$styleClass} select-none shrink-0 inline-flex items-center justify-center leading-none" ]) }} style="font-variation-settings: {{ $variation }}; {{ $sizeStyle }} {{ $attributes->get('style') }}" aria-hidden="true" >{{ $iconName }}