Property Name | Description | Example | Output |
---|
Font Family | Specifies the font for the component. Examples of a Font Family are Times, Courier, Arial, Monospace, etc. | fontFamily: Monospace | |
Size | Specifies the size of the font in pixels (px) or points (pt). If you enter just a number, Perspective assumes the value is in pixels. | fontSize: 26px | |
Color | Specifies the color of the text. You can set the color with a HEX, RGB, or HSL value. See also Color Selector Reference. | color: #FF0000 | |
Weight | Sets how thick or thin characters in the text are displayed. Expand for Weight options Style | Description |
---|
normal | Defines normal characters. This is the default. | bold | Defines thick characters. | lighter | Defines lighter characters. | bolder | Defines thicker characters. | 100-900 | Defines from thin to thick characters. 400 is the same as normal. 700 is the same as bold. |
| fontWeight: Bold fontSize: 26px | |
fontWeight: Lighter fontSize: 26px | |
Italic | Checkbox to indicate if the font style should be italic. | fontStyle: italic | |
Line Height | Specifies the height of a line. Can be specified as one of the following: Expand for Line Height options Style | Description |
---|
normal | A normal line height. This is the default. | number | A number that will be multiplied with the current font-size to set the line height. | length | A fixed line height in px, pt, cm, etc. | percentage | A line height in percent of the current font size. |
| lineHeight: normal | |
lineHeight: 32px
| |
Letter Spacing | Increases or decreases the space between characters. The default is 0. | letterSpacing: 12px | |
Word Spacing | Increases or decreases the white space between words. The default is normal. | wordSpacing: 24px | |
Alignment |
---|
Text Align | The horizontal alignment of text in a component. Expand for Text Align options Style | Description |
---|
start | Aligns text to the left. | end | Aligns text to the right. | left | Align text to the left. | right | Aligns text to the right. | center | Centers the text. | justify | Stretches the text so the text has equal width on each side. | justify-all | Stretches the text so the text has equal width on each side. |
| textAlign : right | |
textAlign: center | |
textAlign: justify | |
Text Indent | The indentation of the first line in a text-block. The default value is 0. | textIndent: 24px | |
White space | Specifies how white-space inside a component is handled. Expand for White space options Style | Description |
---|
normal | Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary. This is the default. | nowrap | Sequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line. The text continues on the same line until a <br> tag is encountered. | pre | Whitespace is preserved by the browser. Text will only wrap on line breaks. Acts like the <pre> tag in HTML. | pre-wrap | Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks. | pre-line | Whitespace is preserved by the browser. Text will wrap when necessary, and on line breaks. |
| whiteSpace: pre-wrap
| |
Text Options |
---|
Transform | Capitalization setting for the text. | textTransform: uppercase | |
Decoration | | textDecoration: line-through | |
Break-word | Allows unbreakable words to be broken. | wordWrap: break-word | |
Shadow | Adds shadow to text. Shadow is set in pixels. Expand for Shadow options Style | Description |
---|
Color | Color for the shadow. You can set the color with a HEX, RGB, or HSL value. See also Color Selector Reference. | x-offset | Offset distance on x axis, in pixels | y-offset | Offset distance on y axis, in pixels | blur-radius | The blur-radius. The default value is 0. |
| textShadow: #ff0000 6px 6px 2px | |
Overflow wrap | Allows the browser to break a line of text inside a component into multiple lines in an otherwise unbreakable place, thus avoiding a long string of text causing layout problems due to overflow. Expand for Overflow wrap options. Style | Description |
---|
normal | Breaks lines according to normal line breaking rules. Words or unbroken strings will not break, even if they overflow the container. This is the default. | break-word | Words or strings of characters that are too large to fit inside their component will break in an arbitrary place to force a line break. A hyphen character will not be inserted, even if the hyphen property is used. |
| overflow wrap: normal | |
overflow wrap: break-word | |
Text overflow | Specifies how overflowed content that is not displayed should be signaled to the user. It can be clipped or it can display an ellipsis (...). Style | Description |
---|
clip | The text is clipped and not accessible. This is the default. | ellipsis | Render an ellipsis ("...") to represent the clipped text. |
| textOverflow: clip | |
textOverflow: ellipsis | |