Skip to content

Commit 90782ec

Browse files
committed
docs
1 parent 62cdf0c commit 90782ec

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

packages/schemas/docs/04-layouts/01-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Section::make()
4545
->extraAttributes(['class' => 'custom-section-style'])
4646
```
4747

48-
<UtilityInjection set="formFields" version="4.x">As well as allowing a static value, the `extraAttributes()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
48+
<UtilityInjection set="layoutComponents" version="4.x">As well as allowing a static value, the `extraAttributes()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
4949

5050
By default, calling `extraAttributes()` multiple times will overwrite the previous attributes. If you wish to merge the attributes instead, you can pass `merge: true` to the method.
5151

packages/schemas/docs/05-primes/01-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Text::make()
8181
->extraAttributes(['class' => 'custom-text-style'])
8282
```
8383

84-
<UtilityInjection set="formFields" version="4.x">As well as allowing a static value, the `extraAttributes()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
84+
<UtilityInjection set="primeComponents" version="4.x">As well as allowing a static value, the `extraAttributes()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
8585

8686
By default, calling `extraAttributes()` multiple times will overwrite the previous attributes. If you wish to merge the attributes instead, you can pass `merge: true` to the method.
8787

packages/schemas/docs/05-primes/02-text.md

+30
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,33 @@ import Aside from "@components/Aside.astro"
55
import AutoScreenshot from "@components/AutoScreenshot.astro"
66
import UtilityInjection from "@components/UtilityInjection.astro"
77

8+
Text can be inserted into a schema using the `Text` component. Text content is passed to the `make()` method:
9+
10+
```php
11+
use Filament\Schemas\Components\Text;
12+
13+
Text::make('Modifying these permissions may give users access to sensitive information.');
14+
```
15+
16+
To render raw HTML content, you can pass an `HtmlString` object to the `make()` method:
17+
18+
```php
19+
use Filament\Schemas\Components\Text;
20+
use Illuminate\Support\HtmlString;
21+
22+
Text::make(new HtmlString('<strong>Warning:</strong> Modifying these permissions may give users access to sensitive information.'));
23+
```
24+
25+
<Aside variant="danger">
26+
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+
</Aside>
28+
29+
To render Markdown, you can use Laravel's `str()` helper to convert Markdown to HTML, and then transform it into an `HtmlString` object:
30+
31+
```php
32+
use Filament\Schemas\Components\Text;
33+
34+
Text::make(str('**Warning:** Modifying these permissions may give users access to sensitive information.')->inlineMarkdown()->toHtmlString());
35+
```
36+
37+
<UtilityInjection set="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>

0 commit comments

Comments
 (0)