<primer-input-label>
Provides consistent label styling for input fields. Used internally by card inputs and available for custom fields.Quick Reference
| Parent | <primer-input-wrapper> |
| Properties | disabled |
| Slot | label (in wrapper) |
Examples
With Input Wrapper
Disabled
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
disabled | disabled | boolean | false | Applies disabled styling |
CSS Properties
| Property | Description |
|---|---|
--primer-typography-body-small-font | Font family |
--primer-typography-body-small-size | Font size |
--primer-typography-body-small-weight | Font weight |
--primer-color-text-primary | Default color |
--primer-color-text-disabled | Disabled color |
States
| State | Description | Visual Change |
|---|---|---|
| Default | Normal state | Primary text color |
| Disabled | disabled attribute set | Muted text color |
Usage Guidelines
Do
- Use inside
<primer-input-wrapper>in thelabelslot for consistent styling - Match the
disabledstate to the corresponding input - Use a
<label>element with aforattribute when wrapping native inputs for accessibility
Don’t
- Don’t use outside of the wrapper context unless you need standalone label styling
- Don’t duplicate labels — one label per input
Content Guidelines
Label text
| Do | Don’t |
|---|---|
| ”Discount code" | "DISCOUNT CODE” |
| Use sentence case | Use title case or all caps |
Formatting
| Do | Don’t |
|---|---|
| No trailing punctuation | ”Card number:” (no colon needed) |
| Mark optional fields: “Company (optional)“ | Mark required fields with asterisks |
Related
- primer-input-wrapper — Parent wrapper
- primer-card-form — Card form container