Skip to content

Commit 92fc47e

Browse files
committed
docs
1 parent 90782ec commit 92fc47e

File tree

7 files changed

+47
-4
lines changed

7 files changed

+47
-4
lines changed

docs-assets/app/app/Livewire/PrimesDemo.php

+16
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@ public function primes(Schema $schema): Schema
8282
Action::make('complete')
8383
->label('Complete authenticator setup'),
8484
]),
85+
Group::make()
86+
->id('text')
87+
->extraAttributes([
88+
'class' => 'p-16 max-w-xl',
89+
])
90+
->schema([
91+
Text::make('Modifying these permissions may give users access to sensitive information.'),
92+
]),
93+
Group::make()
94+
->id('textHtml')
95+
->extraAttributes([
96+
'class' => 'p-16 max-w-xl',
97+
])
98+
->schema([
99+
Text::make(new HtmlString('<strong>Warning:</strong> Modifying these permissions may give users access to sensitive information.')),
100+
]),
85101
]);
86102
}
87103

Loading
Loading
Loading
Loading

docs-assets/screenshots/schema.js

+18
Original file line numberDiff line numberDiff line change
@@ -1829,6 +1829,24 @@ export default {
18291829
deviceScaleFactor: 3,
18301830
},
18311831
},
1832+
'primes/text/simple': {
1833+
url: 'primes',
1834+
selector: '#text',
1835+
viewport: {
1836+
width: 1920,
1837+
height: 640,
1838+
deviceScaleFactor: 3,
1839+
},
1840+
},
1841+
'primes/text/html': {
1842+
url: 'primes',
1843+
selector: '#textHtml',
1844+
viewport: {
1845+
width: 1920,
1846+
height: 640,
1847+
deviceScaleFactor: 3,
1848+
},
1849+
},
18321850
'tables/example': {
18331851
url: 'tables?table=example',
18341852
selector: 'body',

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

+13-4
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,37 @@ Text can be inserted into a schema using the `Text` component. Text content is p
1010
```php
1111
use Filament\Schemas\Components\Text;
1212

13-
Text::make('Modifying these permissions may give users access to sensitive information.');
13+
Text::make('Modifying these permissions may give users access to sensitive information.')
1414
```
1515

16+
<AutoScreenshot name="primes/text/simple" alt="Text" version="4.x" />
17+
1618
To render raw HTML content, you can pass an `HtmlString` object to the `make()` method:
1719

1820
```php
1921
use Filament\Schemas\Components\Text;
2022
use Illuminate\Support\HtmlString;
2123

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.'))
2325
```
2426

2527
<Aside variant="danger">
2628
Be aware that you will need to ensure that the HTML is safe to render, otherwise your application will be vulnerable to XSS attacks.
2729
</Aside>
30+
```
31+
32+
<AutoScreenshot name="primes/text/html" alt="Text with HTML" version="4.x" />
2833
2934
To render Markdown, you can use Laravel's `str()` helper to convert Markdown to HTML, and then transform it into an `HtmlString` object:
3035
3136
```php
3237
use Filament\Schemas\Components\Text;
3338
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+
)
3544
```
3645

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>
46+
<UtilityInjection set="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

Comments
 (0)