Text

Markdown docs

Text

This is Twig implementation of the Text component.

Basic example usage:


                                                
                                                <Text>Text content</Text>

Advanced example usage:


                                                
                                                <Text size="large" emphasis="italic">Text content</Text>

Without lexer:


                                                
                                                {% embed "@spirit/text.twig" with { props: {
                                                    size: 'medium'
                                                    emphasis: 'bold'
                                                }} %}
                                                    {% block content %}
                                                        Text content
                                                    {% endblock %}
                                                {% endembed %}

API

Name Type Default Required Description
elementType string p HTML tag to render
emphasis [regular | bold | italic] regular Emphasis of the text
size Size Extended dictionary medium Size of the text
translate [yes | no | ''] null Set to no to disable machine translation of the text content

On top of the API options, the components accept additional attributes. If you need more control over the styling of a component, you can use style props and escape hatches.

Example