Skip to Content
🎉 Nextra 4.0 已发布。Dima Machina 正在 寻找新的工作或咨询机会

<Callout> Component

一个用于向读者显示重要信息的内置组件。

示例

💡

提示框是一段旨在吸引注意力的简短文本。

A callout is a short piece of text intended to attract attention.

⚠️

A callout is a short piece of text intended to attract attention.

🚫

A callout is a short piece of text intended to attract attention.

用法

默认样式

👾

太空侵略者是一款由西角友宏开发的1978年街机射击游戏。

import { Callout } from 'nextra/components' <Callout emoji="👾"> **Space Invaders** is a 1978 shoot 'em up arcade game developed by Tomohiro Nishikado. </Callout>

信息提示

ℹ️

今天是星期五。

import { Callout } from 'nextra/components' <Callout type="info" emoji="ℹ️"> Today is Friday. </Callout>

警告提示

⚠️

此 API 即将弃用。

import { Callout } from 'nextra/components' <Callout type="warning" emoji="⚠️"> This API will be deprecated soon. </Callout>

错误提示

🚫

这是一个可能导致一切爆炸的危险功能。

import { Callout } from 'nextra/components' <Callout type="error" emoji="️🚫"> This is a dangerous feature that can cause everything to explode. </Callout>

API

提示框组件接受以下属性:

OptionTypeDefault ValueDescription
type'default' | 'info' | 'warning' | 'error''default'The type of the callout.
emojistring | ReactNode
'💡' for type: 'default'
'🚫' for type: 'error'
for type: 'info'
'⚠️' for type: 'warning'
The icon to show in the callout. You can also render your custom icon.
childrenReactNodeThe content of the callout.
Last updated on