Skip to content

Instantly share code, notes, and snippets.

@khatabwedaa
Last active July 26, 2021 17:25
Show Gist options
  • Save khatabwedaa/1d7eff03203849274dfbc62c2c74f566 to your computer and use it in GitHub Desktop.
Save khatabwedaa/1d7eff03203849274dfbc62c2c74f566 to your computer and use it in GitHub Desktop.
@props([
'type' => 'success',
'colors' => [
'success' => 'bg-green-500',
'info' => 'bg-blue-500',
'warring' => 'bg-yellow-500',
'error' => 'bg-red-500'
],
'icon' => [
'success' => 'M20 3.33331C10.8 3.33331 3.33337 10.8 3.33337 20C3.33337 29.2 10.8 36.6666 20 36.6666C29.2 36.6666 36.6667 29.2 36.6667 20C36.6667 10.8 29.2 3.33331 20 3.33331ZM16.6667 28.3333L8.33337 20L10.6834 17.65L16.6667 23.6166L29.3167 10.9666L31.6667 13.3333L16.6667 28.3333Z',
'info' => 'M20 3.33331C10.8 3.33331 3.33337 10.8 3.33337 20C3.33337 29.2 10.8 36.6666 20 36.6666C29.2 36.6666 36.6667 29.2 36.6667 20C36.6667 10.8 29.2 3.33331 20 3.33331ZM21.6667 28.3333H18.3334V25H21.6667V28.3333ZM21.6667 21.6666H18.3334V11.6666H21.6667V21.6666Z',
'warring' => 'M20 3.33331C10.8 3.33331 3.33337 10.8 3.33337 20C3.33337 29.2 10.8 36.6666 20 36.6666C29.2 36.6666 36.6667 29.2 36.6667 20C36.6667 10.8 29.2 3.33331 20 3.33331ZM21.6667 28.3333H18.3334V25H21.6667V28.3333ZM21.6667 21.6666H18.3334V11.6666H21.6667V21.6666Z',
'error' => 'M20 3.36667C10.8167 3.36667 3.3667 10.8167 3.3667 20C3.3667 29.1833 10.8167 36.6333 20 36.6333C29.1834 36.6333 36.6334 29.1833 36.6334 20C36.6334 10.8167 29.1834 3.36667 20 3.36667ZM19.1334 33.3333V22.9H13.3334L21.6667 6.66667V17.1H27.25L19.1334 33.3333Z'
]
])
<div {{ $attributes->merge(['class' => "{$colors[$type]} text-white mb-12"]) }}>
<div class="flex container mx-auto py-4 px-6">
<svg viewBox="0 0 40 40" class="h-6 w-6 fill-current">
<path d="{{ $icon[$type] }}"></path>
</svg>
<p class="mx-3">{{ $slot }}</p>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment