Version: Next

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" | "full" | "sm" | "6" | "2xs" | "8" | "xs" | "12" | "md" | "16" | "xl" | "24" | "32" | "2" | "0.5" | "4" | "3" | "lg" | "1" | "2xl" | "0" | "container" | "3xs" | "1.5" | ... 29 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.