Hero

The Hero component is a versatile and visually appealing element designed for the landing page. It serves as the first screen that captures users' attention and introduces them to the key features and messaging of the product. The component incorporates a title, description, announce, call-to-action buttons, some extra content slot and a flexible area for visual content, such as images, videos, or animations (or Terminal in case of Docux website).

Usage

Docux v2 is out ๐ŸŽ‰

The best place to start your documentation.

Write pages in Markdown, use Vue components and enjoy the power of Nuxt.

  • +50 Components ready to build rich pages
  • Docs and Page layouts
  • Start from a README, scale to a framework documentation
  • Navigation and Table of Contents generation
  • Fully configurable design system
  • Leverages Typography and Elements
  • Used on Content Documentation
Bash
>npx nyxbi@latest init -t nyxb/docux>cd docs>npm install>npm run dev
Click to copy
MDC
::hero

#announce
  ::announce{href=https://docux.dev/v2}
  Docux v2 is out ๐ŸŽ‰
  ::

#title
  The best place to start your documentation.

#description
  Write pages in [:icon{name=mdi:language-markdown}]{style="margin-right:4px"} [Markdown](https://content.nuxtjs.org), use [:icon{name=vscode-icons:file-type-vue}]{style="margin-right:4px"} [Vue](https://vuejs.org) components and enjoy the power of [:icon{name=vscode-icons:file-type-nuxt}]{style="margin-right:4px"} [Nuxt](https://nuxt.com).

#extra
  ::list
  - **+50 Components** ready to build rich pages
  - **Docs** and **Page** layouts
  - Start from a `README`, scale to a framework documentation
  - Navigation and Table of Contents generation
  - Fully configurable design system
  - Leverages [**Typography**](https://typography.nuxt.space/) and [**Elements**](https://elements.nuxt.dev)
  - Used on [Content Documentation](https://content.nuxtjs.org)
  ::

#actions
  ::button-link{href=/introduction/getting-started size=medium}
  Get started
  ::
  ::button-link{href=https://github.com/nyxb/docux size=medium color=gray ghost blank}
  Open on GitHub โ†’
  ::

#support
  ::terminal
  ---
  content:
  - npx nyxbi@latest init -t themes/docux
  - cd docs
  - npm install
  - npm run dev
  ---
  :: 
::

Slots

NameDescription
rootA slot for any content, rendered at the root of the component
announceA slot for providing updates or any kind of announce. rendered above the title
titleA slot for main Hero title
descriptionA slot for Hero description
extraA slot for any kind of additional Hero content. Rendered under the description
actionsA slot for Hero actions, such as buttons, links or any other Call to Action. Rendered under the extra
supportA slot for Hero visual support content: image, video, animation, demo etc

Design Tokens

tokens.config.ts
import { defineTheme } from 'pinceau'

export default defineTheme({
   docux: {
      landing: {
         hero: {
            padding: {
               initial: '{space.20} 0',
               sm: '{space.24} 0',
               lg: '{space.24} 0 {space.32} 0'
            },
            layout: {
               gap: {
                  initial: '{space.16}',
                  xl: '{space.4}'
               },
               gridTemplateColumns: {
                  initial: 'none',
                  xl: 'repeat(12, minmax(0, 1fr))'
               }
            },
            content: {
               gridColumn: {
                  initial: 'auto',
                  xl: 'span 7 / span 7'
               },
               alignItems: {
                  initial: 'center',
                  xl: 'flex-start'
               },
               announce: {
                  marginBottom: '{space.8}'
               },
               title: {
                  fontSize: {
                     initial: '{text.4xl.fontSize}',
                     sm: '{text.5xl.fontSize}',
                     lg: '{text.6xl.fontSize}'
                  },
                  lineHeight: {
                     initial: '{text.4xl.lineHeight}',
                     sm: '{text.5xl.lineHeight}',
                     lg: '{text.6xl.lineHeight}'
                  },
                  color: '{elements.text.primary.color.static}',
                  fontWeight: '{fontWeight.semibold}',
                  letterSpacing: '{letterSpacing.tight}',
                  paddingX: {
                     initial: '{space.8}',
                     md: '{space.12}',
                     lg: '{space.14}',
                     xl: '{space.0}'
                  },
                  textAlign: {
                     initial: 'center',
                     xl: 'start'
                  },
                  marginBottom: '{space.8}',
                  gradientText: {
                     initial: 'linear-gradient(114deg, {color.gray.900} 10%, {color.gray.600} 54%, {color.gray.500})',
                     dark: 'linear-gradient(114deg, {color.gray.400} 10%, {color.gray.100} 54%, {color.gray.700})'
                  },
                  mixBlendMode: 'normal'
               },
               description: {
                  textAlign: {
                     initial: 'center',
                     xl: 'start'
                  },
                  marginBottom: '{space.12}',
                  fontSize: {
                     initial: '{text.lg.fontSize}',
                     lg: '{text.xl.fontSize}'
                  },
                  lineHeight: {
                     initial: '{text.lg.lineHeight}',
                     lg: '{text.xl.lineHeight}'
                  },
                  color: '{elements.text.secondary.color.static}',
                  paddingX: {
                     initial: '{space.2}',
                     md: '{space.6}',
                     xl: '{space.0}'
                  },
                  mixBlendMode: 'normal'
               },
               extra: {
                  justifyContent: {
                     initial: 'center',
                     xl: 'flex-start'
                  },
                  marginBottom: '{space.16}'
               },
               actions: {
                  flexDirection: {
                     initial: 'column',
                     sm: 'row'
                  },
                  gap: {
                     initial: '{space.2}',
                     sm: '{space.3}'
                  },
                  justifyContent: {
                     initial: 'center',
                     xl: 'flex-start'
                  }
               }
            },
            support: {
               gridColumn: {
                  initial: 'auto',
                  xl: 'span 5 / span 5'
               }
            }
         },
      }
   }
})