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
Display upgrade or tier indicators on individual fields or entire sections. Badges render as small inline pills next to labels and section titles. Combine with `disabled` to create a locked preview state for premium features.
3
+
Display upgrade or tier indicators on individual fields or entire sections. Badges render as small inline pills next to
4
+
labels and section titles. When a badge is visible, the associated field is automatically disabled — creating a locked
5
+
preview state for premium features.
4
6
5
7
## Field Badge
6
8
7
9
Add a `badge` key to any field config:
8
10
9
11
```php
10
12
'advanced_sync' => [
11
-
'type' => 'toggle',
12
-
'label' => 'Advanced Sync',
13
-
'badge' => 'Pro',
14
-
'disabled' => true,
13
+
'type' => 'toggle',
14
+
'label' => 'Advanced Sync',
15
+
'badge' => 'Pro',
15
16
],
16
17
```
17
18
18
-
The badge appears inline after the field label, between the required asterisk and the tooltip icon.
19
+
The badge appears inline after the field label, between the required asterisk and the tooltip icon. When the badge is
20
+
visible, the field is automatically disabled — no need to set `disabled` separately.
19
21
20
22
### Full Config
21
23
@@ -24,20 +26,20 @@ The badge appears inline after the field label, between the required asterisk an
@@ -91,24 +120,46 @@ Linked badges change to a solid color on hover.
91
120
92
121
## Disabled Cascade
93
122
94
-
When a section has `'disabled' => true`, all child fields inherit the disabled state automatically. You don't need to set `disabled` on each field individually. The section's form table is dimmed with reduced opacity while the section header remains fully interactive.
123
+
When a section has an active badge, all child fields inherit the disabled state automatically. You don't need to set
124
+
`disabled` on each field individually. The section's form table is dimmed with reduced opacity while the section header
125
+
remains fully interactive.
95
126
96
-
## Dynamic Badges
127
+
## Example: License-Gated Features
97
128
98
-
You can conditionally add badges based on license status or feature flags:
129
+
A common pattern for freemium plugins — fields are locked with a badge until the user activates a license:
0 commit comments