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
Copy file name to clipboardexpand all lines: packages/schemas/docs/05-primes/01-overview.md
+40-5
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,48 @@ import UtilityInjection from "@components/UtilityInjection.astro"
9
9
10
10
Within Filament schemas, prime components are the most basic building blocks that can be used to insert arbitrary content into a schema, such as text and images. As the name suggests, prime components are not divisible and cannot be made simpler.
11
11
12
-
Some examples of what prime components can be used for include:
12
+
<AutoScreenshotname="primes/overview/example"alt="An example of using prime components to set up two-factor authentication."version="4.x" />
13
13
14
-
- Displaying instructions to the user.
15
-
- Displaying an image like a QR code that the user can scan.
16
-
- Displaying a button that the user can click to perform an action.
14
+
In this example, prime components are being used to display instructions to the user, a QR code that the user can scan, and a button that the user can click to complete two-factor authentication setup.
17
15
18
-
<AutoScreenshotname="primes/overview/example"alt="An example of using prime components to set up two factor authentication."version="4.x" />
16
+
```php
17
+
use Filament\Actions\Action;
18
+
use Filament\Schemas\Components\Image;
19
+
use Filament\Schemas\Components\Section;
20
+
use Filament\Schemas\Components\Text;
21
+
use Filament\Schemas\Components\UnorderedList;
22
+
23
+
$schema
24
+
->components([
25
+
Text::make('Scan this QR code with your authenticator app:')
26
+
->color('neutral'),
27
+
Image::make(
28
+
url: asset('images/qr.jpg'),
29
+
alt: 'QR code to scan with an authenticator app',
30
+
)
31
+
->imageHeight('12rem')
32
+
->alignCenter(),
33
+
Section::make()
34
+
->schema([
35
+
Text::make('Please save the following recovery codes in a safe place. They will only be shown once, but you\'ll need them if you lose access to your authenticator app:')
36
+
->weight(FontWeight::Bold)
37
+
->color('neutral'),
38
+
UnorderedList::make(fn (): array => array_map(
39
+
fn (string $recoveryCode): Text => Text::make($recoveryCode)
0 commit comments