Heading - Vision UI Dashboard - Creative Tim
- Docs
Getting Started
InstallationChangelogRoutingTheme
- Theme (Colors, etc)
Layout
- Box
- Cards
- Fixed Plugin
- Flex
- Grid
- Separator
- SimpleGrid
- Stack
Forms
- Button
- Form Control
- Icon Button
- Input
- Switch
Data Display
- Badge
- Charts
- Close Button
- List
- Stat
- Table
- Timeline
Feedback
- Alerts
- Progress
Typography
- Text
- Heading
Overlay
- Menu
- Modal
Navigation
- Breadcrumb
- Link
- Navbar
- Sidebar
Media and icons
- Avatar
- Icon
- Image
Others
- CalendarPRO
- Data TablesPRO
- Gradient Border
- KanbanPRO
- Portal
- QuillPRO
- React GlobePRO
- WizardPRO
Hooks
- useDisclosure
Headings are used for rendering headlines.
Heading composes Box so you can use all the style props and add responsive styles as well. It renders an <h2> tag by default.
Import#
import{Heading}from"@chakra-ui/react"copyUsage#
<Heading>I'm a Heading</Heading>copy<Heading>I'm a Heading</Heading>copyChanging font size#
To increase the size of the heading, you can use the fontSize or size props. If you use the size prop, the font size of the heading will automatically decrease in size for smaller screens.
<Stackspacing={6}><Headingas="h1"size="4xl"isTruncated>(4xl) In love with React & Next</Heading><Headingas="h2"size="3xl"isTruncated>(3xl) In love with React & Next</Heading><Headingas="h2"size="2xl">(2xl) In love with React & Next</Heading><Headingas="h2"size="xl">(xl) In love with React & Next</Heading><Headingas="h3"size="lg">(lg) In love with React & Next</Heading><Headingas="h4"size="md">(md) In love with React & Next</Heading><Headingas="h5"size="sm">(sm) In love with React & Next</Heading><Headingas="h6"size="xs">(xs) In love with React & Next</Heading></Stack>copy<Stackspacing={6}><Headingas="h1"size="4xl"isTruncated>(4xl)In love withReact&Next</Heading><Headingas="h2"size="3xl"isTruncated>(3xl)In love withReact&Next</Heading><Headingas="h2"size="2xl">(2xl)In love withReact&Next</Heading><Headingas="h2"size="xl">(xl)In love withReact&Next</Heading><Headingas="h3"size="lg">(lg)In love withReact&Next</Heading><Headingas="h4"size="md">(md)In love withReact&Next</Heading><Headingas="h5"size="sm">(sm)In love withReact&Next</Heading><Headingas="h6"size="xs">(xs)In love withReact&Next</Heading></Stack>copyTruncate heading#
Pass the isTruncated prop to render an ellipsis when the heading exceeds the width of the viewport or maxWidth prop.
<HeadingisTruncated> Basic text writing, including headings, body text, lists, and more.</Heading>copy<HeadingisTruncated>Basic text writing, including headings, body text, lists, and more.</Heading>copyOverride style#
You can override the size of the Heading component by passing the fontSize prop. No need to write css or styled().
<Headingsize="lg"fontSize="50px">I'm overriding this heading</Heading>copy<Headingsize="lg"fontSize="50px">I'm overriding this heading</Heading>copyComposition#
// Example from paystack.com<LightMode><BoxmaxW="32rem"><Headingmb={4}>Modern online and offline payments for Africa</Heading><TextfontSize="xl"> Paystack helps businesses in Africa get paid by anyone, anywhere in the world</Text><Buttonsize="lg"colorScheme="green"mt="24px"> Create a free account</Button></Box></LightMode>copy// Example from paystack.com<BoxmaxW="32rem"><Headingmb={4}>Modern online and offline payments forAfrica</Heading><TextfontSize="xl">Paystack helps businesses inAfricaget paid by anyone, anywhere in the world</Text><Buttonsize="lg"colorScheme="green"mt="24px">Create a free account</Button></Box>copyProps#
The Heading composes the Box component, so you can pass all Box props.
colorScheme
DescriptionColor Schemes for Heading are not implemented in the default theme. You can extend the theme to implement them.
Type"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"orientation
Type"horizontal" | "vertical"size
Type"sm" | "md" | "lg" | "xl" | "2xl" | "xs" | "3xl" | "4xl"Default"xl"styleConfig
TypeRecord<string, any>variant
DescriptionVariants for Heading are not implemented in the default theme. You can extend the theme to implement them.
Typestring© 2021, Made with ❤️ by Creative Tim & Simmmple for a better web
- Creative Tim
- Simmmple
- Blog
- License
On this page
- Import
- Usage
- Changing font size
- Truncate heading
- Override style
- Composition
- Props
Từ khóa » H1 Chakra Ui
-
Heading - Chakra UI
-
Chakra Factory
-
How Do I Preserve The Styling Of H2, H3, Etc? Problem ... - GitHub
-
Text Style Not Applying Unless Property Is Defined #3612 - GitHub
-
Advanced Techniques In Chakra UI - LogRocket Blog
-
Chakra UI For React - All You Need To Know - KnowledgeHut
-
Choc UI: Chakra UI Prebuilt Components
-
Chakra-ui-markdown-renderer - Npm
-
Chakra Prose Is Finally Here - James Perkins
-
Chakra UI Test - StackBlitz
-
Chakra Ui Button Not Rendering - Stack Overflow
-
Alignment Is Not Proper In Next.js Using Chakra UI - Stack Overflow
-
@chakra-ui/system NPM
-
@chakra-ui/portal - Npm Package Health Analysis | Snyk