Using Builtin MDX React Components Features

A example indicates how to use builtin MDX React components

The Builtin Components

  • Image
  • APITable
  • Code
  • Spacer
  • Snippet
  • Blockquote
  • PackageManagers
  • Kbd
  • Steps
  • Community

Component Image

<Image
  src="/static/images/canada/lake.jpg"
  alt="Image"
  width={500}
  height={500}
/>
Image

Component APITable

APITable.tsx

<APITable
  data={[
    {
      attribute: 'onFocus',
      type: '(e: FocusEvent) => void',
      description: 'Handler that is called when the element receives focus.',
      default: '-',
    },
    {
      attribute: 'onBlur',
      type: '(e: FocusEvent) => void',
      description: 'Handler that is called when the element loses focus.',
      default: '-',
    },
    {
      attribute: 'onFocusChange',
      type: '(isFocused: boolean) => void',
      description:
        "Handler that is called when the element's focus status changes.",
      default: '-',
    },
  ]}
/>
PropTypeDefault
onFocus
(e: FocusEvent) => void
onBlur
(e: FocusEvent) => void
onFocusChange
(isFocused: boolean) => void

Component Code

<Code>npm install @heroui/react</Code>
npm install @heroui/react

Component Spacer

<Spacer y={4} />

Component Snippet

<Snippet>npm install @heroui/react</Snippet>
$ npm install @heroui/react

Component Blockquote

<Blockquote color="primary">This is a blockquote</Blockquote>
<Blockquote color="warning">This is a blockquote</Blockquote>
<Blockquote color="danger">This is a blockquote</Blockquote>
<Blockquote color="success">This is a blockquote</Blockquote>
<Blockquote color="default">This is a blockquote</Blockquote>
This is a blockquote
This is a blockquote
This is a blockquote
This is a blockquote
This is a blockquote

Component PackageManagers

PackageManagers.tsx

<PackageManagers
  commands={{
    npm: 'npm install hps -g',
    yarn: 'yarn add hps -g',
    pnpm: 'pnpm add hps -g',
    bun: 'bun add hps -g',
  }}
/>

Component Kbd

<Kbd keys={['command']}>K</Kbd>
K

Component Steps

Used to display step-by-step tutorials or guides, making the content structure clearer.

Note: <Steps> is a built-in component of Hyperse-io. It only can be support markdown ###(h3), ####(h4)

<Steps>
### Add dependencies

In your Next.js project, run one of the following commands to install HeroUI:

<PackageManagers
commands={{
    npm: 'npm i @heroui/react framer-motion',
    yarn: 'yarn add @heroui/react framer-motion',
    pnpm: 'pnpm add @heroui/react framer-motion',
    bun: 'bun add @heroui/react framer-motion',
  }}
/>

### Hoisted Dependencies Setup

<Blockquote color="primary">
  **Note**: This step is only for those who use `pnpm` to install. If you
  install HeroUI using other package managers, you may skip this step.
</Blockquote>

### Tailwind CSS Setup

HeroUI is built on top of Tailwind CSS, so you need to install Tailwind CSS first. You can follow the official
[installation guide](https://tailwindcss.com/docs/installation/framework-guides/nextjs) to install Tailwind CSS.

<Blockquote color="primary">
  **Note**: If you are using pnpm and monorepo architecture, please make sure
  you are pointing to the ROOT `node_modules`
</Blockquote>

</Steps>

Add dependencies

In your Next.js project, run one of the following commands to install HeroUI:

Hoisted Dependencies Setup

Note: This step is only for those who use pnpm to install. If you install HeroUI using other package managers, you may skip this step.

Tailwind CSS Setup

HeroUI is built on top of Tailwind CSS, so you need to install Tailwind CSS first. You can follow the official installation guide to install Tailwind CSS.

Note: If you are using pnpm and monorepo architecture, please make sure you are pointing to the ROOT node_modules

Community

We're excited to see the community adopt Hyperse-io, raise issues, and provide feedback. Whether it's a feature request, bug report, or a project to showcase, please get involved!