Headings are used for rendering headlines.
Heading composes
so you can use all the style props.
import { Heading } from 'native-base';
function Example() {
return <Heading alignSelf={{
base: "center",
md: "flex-start"
}}>
I'm a Heading
</Heading>;
}
function Example() {
return <VStack alignSelf={{
base: "center",
md: "flex-start"
}}>
{
}
<Heading size="4xl">(4xl) Heading</Heading>
{
}
<Heading size="3xl">(3xl) Heading</Heading>
<Heading size="2xl">(2xl) Heading</Heading>
<Heading size="xl">(xl) Heading</Heading>
<Heading size="lg">(lg) Heading</Heading>
<Heading size="md">(md) Heading </Heading>
<Heading size="sm">(sm) Heading </Heading>
<Heading size="xs">(xs) Heading </Heading>
</VStack>;
}
function Example() {
return <Heading isTruncated>
Basic text writing, including headings, body text, lists, and more.
</Heading>;
}
function Example() {
return <Heading size="lg" fontSize={50} bold alignSelf={{
base: "center",
md: "flex-start"
}}>
I'm overriding this heading
</Heading>;
}
function Example() {
return <Box alignSelf={{
base: "center",
md: "flex-start"
}}>
<Heading mb={4}>
Mobile first accessible components for React Native & Web.
</Heading>
<Text fontSize="xl">
An accessible & utility-first component library to build your design
system for all the platforms (web in beta).
</Text>
<Button size="md" colorScheme="green" mt="24px">
Let's get started
</Button>
</Box>;
}
Heading implements
,
,
,
,
,
,
,
,
,
,
,
,
The size of the heading.
Type: number | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
NativeBase ships with a default theme for each component. Check out the default theme of the heading
.
Info:
We can easily extend the heading component theme using extendTheme function as described in the documentation .