Version: 3.2.1

Heading

Headings are used for rendering headlines. Heading composes Text so you can use all the style props.

Import#

import { Heading } from 'native-base';

Example#

Basic#

Sizes#

Truncate#

Override#

Composition#

Props#

Name Type Description Default
size ResponsiveValue<number | "px" | "container" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "0" | "0.5" | "1" | "1.5" | "2" | "2.5" | "3" | "3.5" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | ... 28 more ... | (string & {})> The size of the heading. xl

Heading implements Text

Styling#

NativeBase ships with a default theme for each component. Checkout the default theme of heading
We can easily extend the heading component theme using extendTheme function as shown below.
import { extendTheme, NativeBaseProvider } from "native-base";
const theme = extendTheme({
components: {
Heading: {
baseStyle: {},
defaultProps: {},
variants: {},
sizes: {},
}
}
});
function MyApp() {
return (
<NativeBaseProvider theme={theme}>
{/* Rest of the app goes here */}
</NativeBaseProvider>
)
}
Read more about extending component theme here.