Px
Converts the specified number to a pixel string.
| Category | Strings |
| Author | Pol Gubau |
| Since | 1.0.0 |
| Last Updated | 2025-03-15 |
| Type | Sync |
| Compatibility | Universal |
Example
Input
px(10)Output:
'10px'
Input
px('10')Output:
'10px'
Return
Returns the input number or string with 'px' appended at the end.
Type: string
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| arg | string | number | null | Yes | The number or string to convert into a pixel string. |
Notes
If the input is a string or number, it will be converted to a string and suffixed with 'px'.
Tags
- conversion
- unit
- px
- string