shout
shout copied to clipboard
Add `title()` method
The title() method has been added to allow the developer to define a title.
use Awcodes\Shout\Components\Shout;
Shout::make('so-important')
->content('This is a test')
->title('Test Shout')
->icon('tabler-alert-circle'),
Creates:
- I have included updated README with documentation on the
title()function as well.
I'm not opposed to this, but I can see possible a11y issues where the tile might need to be an h2 or h4. Any ideas on solving that?
@awcodes I have one idea.
This could be solved the same way helperText is implemented where one can use HTML strings (Htmlable). For example with helperText one can do the following:
->helperText(
str(__('The Title'))
->inlineMarkdown()
->toHtmlString()
)
For reference, the type signature of helperText is as follows:
use Closure;
use Illuminate\Contracts\Support\Htmlable;
public function helperText(string | Htmlable | Closure | null $text): static;