Heading
RSC
Generates headings from h1 to h6 with different sizes and semantic meanings.
Installation
API Reference
Important Note
This is the documentation for gluestack-ui v2 (beta). For @gluestack-ui/themed (stable) documentation, refer to gluestack-ui v1.
This is an illustration of Heading component.
<Heading>I am a Heading</Heading>
Installation
CLI
Manual
Run the following command:
npx gluestack-ui add heading
API Reference
To use this component in your project, include the following import statement in your file.
import { Heading } from "@/components/ui/heading"
export default () => <Heading />
Component Props
This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.
Heading
It inherits all the properties of @expo/html-elements's H1 component.
Props
Heading
Heading component is created using H1 component from @expo/html-elements. It extends all the props supported by Expo HTML Heading Elements, utility props and the props mentioned below.
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 |
Examples
The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.
Heading Sizes
Heading component 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.
function App() {const sizes = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl"]return (<Center>{sizes.map((size) => (<Heading size={size}>{size}</Heading>))}</Center>)}