Skip to content

Commit 4e41418

Browse files
committed
docs
1 parent ae3a3b6 commit 4e41418

File tree

14 files changed

+145
-5
lines changed

14 files changed

+145
-5
lines changed

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

+37
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ public function primes(Schema $schema): Schema
9696
Text::make('Information')
9797
->color('info'),
9898
]),
99+
Group::make()
100+
->id('textNeutral')
101+
->extraAttributes([
102+
'class' => 'p-16 max-w-xl',
103+
])
104+
->schema([
105+
Text::make('Modifying these permissions may give users access to sensitive information.'),
106+
Text::make('Modifying these permissions may give users access to sensitive information.')
107+
->color('neutral'),
108+
]),
99109
Group::make()
100110
->id('textBadge')
101111
->extraAttributes([
@@ -117,6 +127,33 @@ public function primes(Schema $schema): Schema
117127
->badge()
118128
->icon(Heroicon::ExclamationTriangle),
119129
]),
130+
Group::make()
131+
->id('textLarge')
132+
->extraAttributes([
133+
'class' => 'p-16 max-w-xl',
134+
])
135+
->schema([
136+
Text::make('Modifying these permissions may give users access to sensitive information.')
137+
->size(TextSize::Large),
138+
]),
139+
Group::make()
140+
->id('textBold')
141+
->extraAttributes([
142+
'class' => 'p-16 max-w-xl',
143+
])
144+
->schema([
145+
Text::make('Modifying these permissions may give users access to sensitive information.')
146+
->weight(FontWeight::Bold),
147+
]),
148+
Group::make()
149+
->id('textMono')
150+
->extraAttributes([
151+
'class' => 'p-16 max-w-xl',
152+
])
153+
->schema([
154+
Text::make('28o.-AK%D~xh*.:[4"3)zPiC')
155+
->fontFamily(FontFamily::Mono),
156+
]),
120157
]);
121158
}
122159

Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

docs-assets/screenshots/schema.js

+36
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,15 @@ export default {
18561856
deviceScaleFactor: 3,
18571857
},
18581858
},
1859+
'primes/text/neutral': {
1860+
url: 'primes',
1861+
selector: '#textNeutral',
1862+
viewport: {
1863+
width: 1920,
1864+
height: 640,
1865+
deviceScaleFactor: 3,
1866+
},
1867+
},
18591868
'primes/text/badge': {
18601869
url: 'primes',
18611870
selector: '#textBadge',
@@ -1874,6 +1883,33 @@ export default {
18741883
deviceScaleFactor: 3,
18751884
},
18761885
},
1886+
'primes/text/large': {
1887+
url: 'primes',
1888+
selector: '#textLarge',
1889+
viewport: {
1890+
width: 1920,
1891+
height: 640,
1892+
deviceScaleFactor: 3,
1893+
},
1894+
},
1895+
'primes/text/bold': {
1896+
url: 'primes',
1897+
selector: '#textBold',
1898+
viewport: {
1899+
width: 1920,
1900+
height: 640,
1901+
deviceScaleFactor: 3,
1902+
},
1903+
},
1904+
'primes/text/mono': {
1905+
url: 'primes',
1906+
selector: '#textMono',
1907+
viewport: {
1908+
width: 1920,
1909+
height: 640,
1910+
deviceScaleFactor: 3,
1911+
},
1912+
},
18771913
'tables/example': {
18781914
url: 'tables?table=example',
18791915
selector: 'body',

packages/schemas/docs/03-infolists/02-text.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ TextEntry::make('tags')
524524

525525
<UtilityInjection set="infolistEntries" version="4.x">As well as allowing a static value, the `separator()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
526526

527-
### Customizing the text size
527+
## Customizing the text size
528528

529529
Text columns have small font size by default, but you may change this to `TextSize::ExtraSmall`, `TextSize::Medium`, or `TextSize::Large`.
530530

@@ -540,7 +540,7 @@ TextEntry::make('title')
540540

541541
<AutoScreenshot name="infolists/entries/text/large" alt="Text entry in a large font size" version="4.x" />
542542

543-
### Customizing the font weight
543+
## Customizing the font weight
544544

545545
Text entries have regular font weight by default, but you may change this to any of the following options: `FontWeight::Thin`, `FontWeight::ExtraLight`, `FontWeight::Light`, `FontWeight::Medium`, `FontWeight::SemiBold`, `FontWeight::Bold`, `FontWeight::ExtraBold` or `FontWeight::Black`.
546546

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

+70-3
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,25 @@ Text::make('Information')
5757
->color('info')
5858
```
5959

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

6262
<AutoScreenshot name="primes/text/color" alt="Text in the info color" version="4.x" />
6363

64+
### Using a neutral color
65+
66+
By default, the text color is set to `gray`, which is typically fairly dim against its background. You can darken it using the `color('neutral')` method:
67+
68+
```php
69+
use Filament\Schemas\Components\Text;
70+
71+
Text::make('Modifying these permissions may give users access to sensitive information.')
72+
73+
Text::make('Modifying these permissions may give users access to sensitive information.')
74+
->color('neutral')
75+
```
76+
77+
<AutoScreenshot name="primes/text/neutral" alt="Text in the neutral color" version="4.x" />
78+
6479
## Displaying as a "badge"
6580

6681
By default, text is quite plain and has no background color. You can make it appear as a "badge" instead using the `badge()` method. A great use case for this is with statuses, where may want to display a badge with a [color](#customizing-the-color) that matches the status:
@@ -85,9 +100,9 @@ Text::make('Warning')
85100
->badge(FeatureFlag::active())
86101
```
87102

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

90-
### Adding an icon to a badge
105+
### Adding an icon to the badge
91106

92107
You may add other things to the badge, like an [icon](../../styling/icons):
93108

@@ -102,3 +117,55 @@ Text::make('Warning')
102117
```
103118

104119
<AutoScreenshot name="primes/text/badge-icon" alt="Text as badge with an icon" version="4.x" />
120+
121+
## Customizing the text size
122+
123+
Text columns have small font size by default, but you may change this to `TextSize::ExtraSmall`, `TextSize::Medium`, or `TextSize::Large`.
124+
125+
For instance, you may make the text larger using `size(TextSize::Large)`:
126+
127+
```php
128+
use Filament\Schemas\Components\Text;
129+
use Filament\Support\Enums\TextSize;
130+
131+
Text::make('Modifying these permissions may give users access to sensitive information.')
132+
->size(TextSize::Large)
133+
```
134+
135+
<AutoScreenshot name="primes/text/large" alt="Text entry in a large font size" version="4.x" />
136+
137+
## Customizing the font weight
138+
139+
Text entries have regular font weight by default, but you may change this to any of the following options: `FontWeight::Thin`, `FontWeight::ExtraLight`, `FontWeight::Light`, `FontWeight::Medium`, `FontWeight::SemiBold`, `FontWeight::Bold`, `FontWeight::ExtraBold` or `FontWeight::Black`.
140+
141+
For instance, you may make the font bold using `weight(FontWeight::Bold)`:
142+
143+
```php
144+
use Filament\Schemas\Components\Text;
145+
use Filament\Support\Enums\FontWeight;
146+
147+
Text::make('Modifying these permissions may give users access to sensitive information.')
148+
->weight(FontWeight::Bold)
149+
```
150+
151+
<UtilityInjection set="primeComponents" version="4.x">As well as allowing a static value, the `weight()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
152+
153+
<AutoScreenshot name="primes/text/bold" alt="Text entry in a bold font" version="4.x" />
154+
155+
## Customizing the font family
156+
157+
You can change the text font family to any of the following options: `FontFamily::Sans`, `FontFamily::Serif` or `FontFamily::Mono`.
158+
159+
For instance, you may make the font monospaced using `fontFamily(FontFamily::Mono)`:
160+
161+
```php
162+
use Filament\Support\Enums\FontFamily;
163+
use Filament\Schemas\Components\Text;
164+
165+
Text::make('28o.-AK%D~xh*.:[4"3)zPiC')
166+
->fontFamily(FontFamily::Mono)
167+
```
168+
169+
<UtilityInjection set="primeComponents" version="4.x">As well as allowing a static value, the `fontFamily()` method also accepts a function to dynamically calculate it. You can inject various utilities into the function as parameters.</UtilityInjection>
170+
171+
<AutoScreenshot name="primes/text/mono" alt="Text entry in a monospaced font" version="4.x" />

0 commit comments

Comments
 (0)