Skip to Content
文档

标记

用于标记文本以进行强调。

The design system is a collection of UI elements

用法

¥Usage

import { Mark } from "@chakra-ui/react"
<Text>
  The <Mark>design system</Mark> is a collection of UI elements
</Text>

示例

¥Examples

变量

¥Variants

使用 variant 属性更改标记的颜色。

¥Use the variant prop to change the color of the mark.

The design system is a collection of UI elements

The design system is a collection of UI elements

The design system is a collection of UI elements

The design system is a collection of UI elements

import { For, Mark, Stack, Text } from "@chakra-ui/react"

const Demo = () => {
  return (
    <Stack gap="6">
      <For each={["subtle", "solid", "text", "plain"]}>
        {(variant) => (
          <Text key={variant}>
            The <Mark variant={variant}>design system</Mark> is a collection of
            UI elements
          </Text>
        )}
      </For>
    </Stack>
  )
}

属性

¥Props

PropDefaultType
colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink'

The color palette of the component

as
React.ElementType

The underlying element to render.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
variant
'subtle' | 'solid' | 'text' | 'plain'

The variant of the component

Previous

列表

Next

散文