Reflexjs
文档块库指南GitHub
/
,

行动号召

行动号召 001
全屏预览

如何使用此块

1. 复制块源代码并将其复制到 src/components/call-to-action-001.jsx 文件。

块(JavaScript)
import * as React from "react"
export default function Block({
subheading,
heading,
text,
buttons,
...props
}) {
return (
<section py="6|8|12|20" {...props}>
<div variant="container">
{subheading && (
<p color="primary" textTransform="uppercase" m="0">
{subheading}
</p>
)}
{heading && (
<h1 variant="heading.h1" fontWeight="bolder" lineHeight="tight">
{heading}
</h1>
)}
{text && (
<p variant="text.lead" mt="2">
{text}
</p>
)}
{buttons}
</div>
</section>
)
}

2. 复制以下示例代码并将其添加到您的页面。

用法(JavaScript)
import * as React from "react"
import { Icon } from "reflexjs"
import Block from "../src/components/call-to-action-001"
export default function Example() {
return (
<Block
subheading="Subheading"
heading="Start building today"
text="Reiciendis quia totam esse. Dicta minus iusto quisquam doloribus temporibus."
buttons={
<a variant="button.accent.lg" href="#" mt="6">
Get started <Icon name="arrow-right" ml="2" size="4" />
</a>
}
/>
)
}

© 2022 Reflexjs

文档块库指南GitHub