Feature grid
A title and a short intro above a grid of features, each with an icon.
A title and a short intro above a grid of features, each with an icon.
npm install @mantine/core @tabler/icons-react
First time with Mantine UI? Set it up once.
/**
* Component from Mantine UI, https://ui.mantine.dev
* MIT License, Copyright (c) 2022 Vitaly Rtischev. Full text: https://github.com/mantinedev/ui.mantine.dev/blob/master/LICENCE
* Changed for Tastebud: the sample copy is new.
*/
import { IconCookie, IconGauge, IconLock, IconMessage2, IconUser } from '@tabler/icons-react';
import { Container, SimpleGrid, Text, ThemeIcon, Title } from '@mantine/core';
import classes from './FeaturesGrid.module.css';
export const MOCKDATA = [
{
icon: IconGauge,
title: 'Extreme performance',
description:
'Pages load in under a second, even on slow connections, because each screen sends only the code it needs.',
},
{
icon: IconUser,
title: 'Privacy focused',
description:
'We collect only what the product needs to work, and you can export or delete your data at any time.',
},
{
icon: IconCookie,
title: 'No third parties',
description:
'No ad trackers and no selling of data. What you do in the app stays between you and us.',
},
{
icon: IconLock,
title: 'Secure by default',
description:
'Two-step sign-in, encrypted storage and regular security reviews are switched on from day one.',
},
{
icon: IconMessage2,
title: '24/7 Support',
description:
'Real people answer within an hour, day or night, and stay with you until the problem is solved.',
},
];
interface FeatureProps {
icon: React.FC<any>;
title: React.ReactNode;
description: React.ReactNode;
}
export function Feature({ icon: Icon, title, description }: FeatureProps) {
return (
<div>
<ThemeIcon variant="light" size={40} radius={40}>
<Icon size={18} stroke={1.5} />
</ThemeIcon>
<Text mt="sm" mb={7}>
{title}
</Text>
<Text size="sm" c="dimmed" lh={1.6}>
{description}
</Text>
</div>
);
}
export function FeaturesGrid() {
const features = MOCKDATA.map((feature, index) => <Feature {...feature} key={index} />);
return (
<Container className={classes.wrapper}>
<Title className={classes.title}>Integrate effortlessly with any technology stack</Title>
<Container size={560} p={0}>
<Text size="sm" className={classes.description}>
Connect the tools you already use in a few clicks. No custom code, no long setup, and nothing
to look after once it runs.
</Text>
</Container>
<SimpleGrid
mt={60}
cols={{ base: 1, sm: 2, md: 3 }}
spacing={{ base: 'xl', md: 50 }}
verticalSpacing={{ base: 'xl', md: 50 }}
>
{features}
</SimpleGrid>
</Container>
);
}
/**
* Component from Mantine UI, https://ui.mantine.dev
* MIT License, Copyright (c) 2022 Vitaly Rtischev. Full text: https://github.com/mantinedev/ui.mantine.dev/blob/master/LICENCE
* Changed for Tastebud: Mantine's PostCSS shorthands (@mixin, $mantine-breakpoint-*) are written out as
* plain CSS, so it runs without postcss-preset-mantine; headings use the theme font instead of Outfit.
*/
.wrapper {
padding-top: calc(var(--mantine-spacing-xl) * 4);
padding-bottom: calc(var(--mantine-spacing-xl) * 4);
}
.title {
font-family: var(--mantine-font-family);
font-weight: 500;
margin-bottom: var(--mantine-spacing-md);
text-align: center;
@media (max-width: 48em) {
font-size: 28px;
text-align: left;
}
}
.description {
text-align: center;
@media (max-width: 48em) {
text-align: left;
}
}
Changed for this site: The sample copy is new. Mantine's PostCSS shorthands (@mixin, $mantine-breakpoint-*) are written out as plain CSS, so it runs without postcss-preset-mantine; headings use the theme font instead of Outfit.