Reflex
  • Blocks
    • Header
    • Hero
    • Features
    • Call to action
    • Forms
    • Pricing
    • Team
    • Testimonials
    • Cards
    • Footer
    • Posts
    • Videos
  • Examples
  • Learn
  • Videos
  • Docs
  • Theme

    Theme reference

    • Colors
    • Font family
    • Font size
    • Font weight
    • Line height
    • Box shadow
    Create a theme Extend base
arshadcnv0.5.3
Reflex
Reflex

Dynamic blocks

Using props in blocks.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

Dynamic blocks

Blocks can accept props and this makes blocks really powerful.

Wrap the card block we created in a named export.

export const Card = ({ heading, text, image }) => (
<Div borderWidth="1px" rounded="5px">
<Image src={image} />
<Div p="6">
<H4 my="0">{heading}</H4>
<P mb="0">{text}</P>
</Div>
</Div>
)

Using props with blocks

<Grid col="2" gap="4">
<Block src="card" heading="Heading One" text="This is the card one." />
<Block src="card" heading="Heading One" text="This is the card two." />
</Grid>

Heading One

This is the card one.

Heading One

This is the card two.

BlocksNavs

© 2020 Reflex

  • Blocks
  • Examples
  • Learn
  • Docs
  • Github