Skip to content

Latest commit

 

History

History
141 lines (120 loc) · 5.15 KB

TextFormat.md

File metadata and controls

141 lines (120 loc) · 5.15 KB

TextFormat

Kind: global class
Npmpackage:

new TextFormat()

Custom constants to identify the layout type for a . Each type changes the format of how the text content is displayed and will run an internal auto size if applicable to the type.
Import from ad-ui

import { TextFormat } from 'ad-ui'

TextFormat.INLINE : string

UITextField lays out the words inline with no word wrapping, which does not necessarily mean only 1 line.
If html <br> tags are used, they will be honored, but no autmatic line breaking happens. This does NOT auto size and will overflow horizontally and vertically depending on the width and height.

Kind: static constant of TextFormat
Example

TextFormat.INLINE

TextFormat.INLINE_CLAMP : string

UITextField lays out the words inline with no word wrapping, which does not necessarily mean only 1 line.
If html <br> tags are used, they will be honored, but no autmatic line breaking happens. This does NOT auto size, however it changes the width AND height of the UITextField to clamp to the size of the content.

Kind: static constant of TextFormat
Example

TextFormat.INLINE_CLAMP

TextFormat.INLINE_FIT : string

UITextField lays out the words inline with no word wrapping, which does not necessarily mean only 1 line.
If html <br> tags are used, they will be honored, but no autmatic line breaking happens. This DOES auto size and will shrink horizontally and vertically to fit inside the width and height.

Kind: static constant of TextFormat
Example

TextFormat.INLINE_FIT

TextFormat.INLINE_FIT_CLAMP : string

This is a combination that applies TextFormat.INLINE_FIT followed by TextFormat.INLINE_CLAMP

would then become

Kind: static constant of TextFormat
Example

TextFormat.INLINE_FIT_CLAMP

TextFormat.PARAGRAPH : string

UITextField uses word wrapping to automatically break lines creating a paragraph layout. This does NOT auto size and will overflow vertically, just like a webpage.

Kind: static constant of TextFormat
Example

TextFormat.PARAGRAPH

TextFormat.PARAGRAPH_CLAMP : string

UITextField uses word wrapping to automatically break lines creating a paragraph layout. This does NOT auto size and will overflow vertically, just like a webpage. However, while maintaining the defined width, it changes the height of the UITextField to clamp to the size of the content.

Kind: static constant of TextFormat
Example

TextFormat.PARAGRAPH_CLAMP

TextFormat.PARAGRAPH_FIT : string

UITextField uses word wrapping to automatically break lines creating a paragraph layout. This DOES auto size and will shrink the entire chunk to fit inside the width and height.

Kind: static constant of TextFormat
Example

TextFormat.PARAGRAPH_FIT

TextFormat.PARAGRAPH_FIT_CLAMP : string

This is a combination that applies TextFormat.PARAGRAPH_FIT followed by TextFormat.PARAGRAPH_CLAMP

would then become

Kind: static constant of TextFormat
Example

TextFormat.PARAGRAPH_FIT_CLAMP