GSHeading

GSHeading widget gives you the ability to create headings for your page with different sizes and semantics.
API Reference
This is an illustration of a Themed GSHeading widget with default configuration.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSHeading(
      text: 'I am a Heading',
      style: GSStyle(textStyle: const TextStyle(letterSpacing: 2)),
    )


API Reference

Import

To use this widget in your project, include the following import statement in your file.
import "package:gluestack_ui/gluestack_ui.dart"

Widget Parameters

This section provides a comprehensive reference list for the widget parameters, detailing descriptions, properties, types, and default behavior for easy project integration.

GSHeading

It inherits all the properties of Flutter's Text widget.

GSHeading

Name
Value
Default
isTruncated
true | false
false
bold
true | false
false
underline
true | false
false
strikeThrough
true | false
false
sub
true | false
false
italic
true | false
false
highlight
true | false
false
size
5xl | 4xl | 3xl | 2xl | xl | lg | md | sm | xs
md
Note: These properties are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these properties may not be available.

GSHeading Sizes

GSHeading widget offers a range of sizes, including xs, sm, md, lg, xl, 2xl, 3xl, 4xl, and 5xl, allowing users to customize the size of the heading according to their design requirements.
The GSHeading widget also accepts some shorthands for basic quick styling.
Prop
Type
Default
Description
bold
boolean
false
Used to make the text bold.
isTruncated
boolean
false
If true, it will render an ellipsis when the text exceeds the width of the viewport or maxWidth set.
italic
boolean
false
Used to make the text italic.
underline
boolean
false
Used underline the text.
strikeThrough
boolean
false
A horizontal line through the center of the text.
highlight
boolean
false
Used to highlight the text with a yellow background.
Edit this page on GitHub