Reflexjs
文档区库指南GitHub
/
,

区库行动号召区库

行动号召 003
全屏查看

如何使用这个块

1. 复制代码区库并将其放在 src/components/call-to-action-003.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">
<div
display="flex"
flexDirection="column|row"
justifyContent="space-between"
alignItems="flex-start|center"
>
<div flex="1">
{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>
)}
</div>
{buttons}
</div>
</div>
</section>
)
}

2. 复制代码示例并将其添加到你的页面中。

用法(JavaScript)
import * as React from "react"
import { Icon } from "reflexjs"
import Block from "../src/components/call-to-action-003"
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