You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To render raw HTML content, you can pass an `HtmlString` object to the `make()` method:
17
19
18
20
```php
19
21
use Filament\Schemas\Components\Text;
20
22
use Illuminate\Support\HtmlString;
21
23
22
-
Text::make(new HtmlString('<strong>Warning:</strong> Modifying these permissions may give users access to sensitive information.'));
24
+
Text::make(new HtmlString('<strong>Warning:</strong> Modifying these permissions may give users access to sensitive information.'))
23
25
```
24
26
25
27
<Asidevariant="danger">
26
28
Be aware that you will need to ensure that the HTML is safe to render, otherwise your application will be vulnerable to XSS attacks.
27
29
</Aside>
30
+
```
31
+
32
+
<AutoScreenshot name="primes/text/html" alt="Text with HTML" version="4.x" />
28
33
29
34
To render Markdown, you can use Laravel's `str()` helper to convert Markdown to HTML, and then transform it into an `HtmlString` object:
30
35
31
36
```php
32
37
use Filament\Schemas\Components\Text;
33
38
34
-
Text::make(str('**Warning:** Modifying these permissions may give users access to sensitive information.')->inlineMarkdown()->toHtmlString());
39
+
Text::make(
40
+
str('**Warning:** Modifying these permissions may give users access to sensitive information.')
41
+
->inlineMarkdown()
42
+
->toHtmlString(),
43
+
)
35
44
```
36
45
37
-
<UtilityInjectionset="primeComponents"version="4.x">As well as allowing a static value, the `compact()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
46
+
<UtilityInjectionset="primeComponents"version="4.x">As well as allowing a static value, the `make()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
0 commit comments