Property Card and Carousel
Display property listings
Use the PropertyCard
component to display details of a property, such as real estate listings or rental units, in a concise and visually appealing way. The component can be configured in many different ways to get visually distinct elements.
available for your exclusive rental.
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
The PropertyCard
component can be created in many different configurations using props. Only the img
and title
props are mandatory which sets an image for the property and a title.
Ribbons
To provide ribbons on the image, specify the ribbon
prop which expects an object with a text
property that sets the text for the ribbon. You can pass any valid RibbonProps
prop along to the object to customize the way your ribbon looks. To learn more about ribbons, read through the Ribbon
component documentation.
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
Rating
Similar to the ribbon, the rating can also be customized using the Rating
component. For example, you can show the number of ratings or display a link to reviews in the following way:
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
Meta information
The location
and meta
props can be used to add additional information next to the star rating:
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
CTAs
Providing a CTA is optional. The CTA prop accepts an array of Button
components, meaning you can also add multiple actions for users.
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
buttons
prop, please read the API documentation of the Button
component. Main Content
The main content for the card can be defined as the children of the component. This means you can extend the card with additional components if needed, and build more complex UIs. For example, the following code adds a collapsible section for property owner details:
available for your exclusive rental.
Phone | +1 234 5678 |
emily@example.com |
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
Amenities
Lastly, at the end of the card you can display a list of amenities using the amenities
array. This expects an array of strings:
available for your exclusive rental.
-
Pool
-
Jacuzzi
-
Sauna
-
Free WiFi
Property Carousels
You can combine the PropertyCard
component with the Carousel
component to also create property carousels in places with limited space:
Carousel
component here. API
You can find additional documentations below for the above types:
Prop | Purpose |
---|---|
img | Sets the property image for the card. |
img.src | Sets the path for the image. |
img.alt | Sets an alternate text for the image. |
img.width | Sets the width of the image. |
img.height | Sets the height of the image. |
img.lazy | Set to true to enable lazy loading for the image. |
ribbon | Sets a ribbon shown above the image. |
ribbon.text | Sets the text for the ribbon. |
rating | Sets the rating of the property. |
location | Sets a location for the property, shown under the title and image. |
meta | Sets additional text under the property's name. |
title | Sets a title for the property card. |
buttons | Sets CTA buttons under the rating. |
buttons.text | Sets the text for the CTA. |
buttons.icon | Sets an icon for the CTA. You can pass SVG strings, or an icon type for Astro components. |
amenities | Sets a list of amenities under the main content. |
className | Pass additional CSS classes for the PropertyCard component. |