Skip to content

Support custom components for PricingSlot's price & title #7

@Coriou

Description

@Coriou

I think it'd be nice to support custom components for the PricingSlot price & title (possibly elsewhere too, these seem like the most important to be customisable to me).

I started working on this, I'll publish the branch to my fork soon (I want to test it more & write an example, possibly tests too).

Would you be open to this ?

Here's how it currently looks like:

<PricingSlot
    priceText="$ 200"
    priceAccessor={customPrice}
>
const customPrice = ({ className, text }) => {
	return (
		<li className={className}>
			<span>Starting at</span>
			<span>{text}</span>
		</li>
	)
}

The className & text props are "tags" & this.props.priceText respectively. Not sure we should pass them to custom components, but then again why not ? And I've made pretty much the same thing for the title, allowing for custom title component.

Thoughts ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions