import Card from '@megafon/ui-shared';
Демо данныеconst featuresList = {items: [{ title: 'Матрица:', value: '2 МП' },{ title: 'Угол обзора:', value: '146,5°' },{ title: 'ИК‑подсветка:', value: 'до 20 м' },],desc: 'Купольная камера для применения внутри помещений и на улице',};const textsList = [{title: 'Задача:',desc: 'Привлечь новых клиентов под акцию «установка импланта под ключ с коронкой»',},{title: 'Решение:',desc: '<ol><li>Подобрали лиды по гео</li><li>Взяли текущую базу клиента и выполнили обзвон роботом</li></ol>',},];const markerList = [{title: 'Хранения записей в облаке',note: '30 дней',},{title: 'Уведомления о движениях и звуках',note: 'Включено в тариф',},{title: 'Количество пользователей',note: 'Неограниченно',},];const iconsList = {items: [{ icon: <WiFi />, text: '10 клипов доступно к выгрузке в месяц' },{ icon: <WiFi />, text: '10 клипов одновременно хранятся на сервере' },{ icon: <WiFi />, text: '30 неудаляемых закладок одновременно хранятся на сервере' },],desc: 'Бесплатный просмотр видео с опциями:',};
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'left' }} badge={<PromoBadge color="system-blue">Акция</PromoBadge>} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'center' }} /> </GridColumn> </Grid>
Одновременно в карточке может выводиться только один из трех типов контента (textsList, featuresList, iconsList), остальные будут проигнорированы
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} markerList={markerList} badge={<PromoBadge color="137c">Акция</PromoBadge>} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} textsList={textsList} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} featuresList={featuresList} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} iconsList={iconsList} /> </GridColumn> </Grid>
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'center' }} price={{ value: '340 ₽', period: 'в месяц' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'center' }} price={{ oldValue: '560 ₽', value: '340 ₽', period: 'в месяц' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'center' }} price={{ value: '11% конверсия' }} /> </GridColumn> </Grid>
Если основной кнопке передан type outline, то дополнительная кнопка будет игнорировать переданный type, и отобразится с type text
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} button={{ title: 'Заказать', href: '#', target: '_blank', type: 'primary', theme: 'green' }} extraButton={{ title: 'Подробнее', href: '#', type: 'outline' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} button={{ title: 'Заказать', href: '#', target: '_blank', type: 'primary', theme: 'green-soft' }} extraButton={{ title: 'Подробнее', href: '#', type: 'text' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} button={{ title: 'Заказать', href: '#', target: '_blank', type: 'outline', theme: 'green' }} extraButton={{ title: 'Подробнее', href: '#', type: 'outline' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} button={{ title: 'Заказать', href: '#', target: '_blank' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий' }} extraButton={{ title: 'Подробнее', href: '#', isCentered: true }} /> </GridColumn> </Grid>
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'left' }} icon={<WiFi fill="#00B956" />} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} /> </GridColumn> </Grid>
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} price={{ value: '340 ₽', period: 'в месяц' }} badge={<PromoBadge color="night">Акция</PromoBadge>} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий', position: 'bottom' }} featuresList={featuresList} price={{ value: '340 ₽', period: 'в месяц' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий', position: 'bottom' }} iconsList={iconsList} button={{ title: 'Заказать', href: '#', target: '_blank' }} extraButton={{ title: 'Подробнее', href: '#' }} /> </GridColumn> </Grid>
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card view="shadow" title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} button={{ title: 'Заказать', href: '#', target: '_blank' }} extraButton={{ title: 'Подробнее', href: '#' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card view="background" title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} button={{ title: 'Заказать', href: '#', target: '_blank' }} extraButton={{ title: 'Подробнее', href: '#' }} /> </GridColumn> </Grid>
<div style={{ backgroundColor: 'var(--spbSky0)', padding: '20px' }}> <Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card view="hover-shadow" title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} button={{ title: 'Заказать', href: '#', target: '_blank', isCentered: true }} extraButton={{ title: 'Подробнее', href: '#' }} /> </GridColumn> </Grid> </div>
Карточка может быть ссылкой, только если передан href и отсутствуют кнопки. При наличии кнопок href будет проигнорирован.
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card link={{ href: '#', target: '_blank' }} view="shadow" title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card link={{ href: '#', target: '_blank' }} view="background" title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} /> </GridColumn> </Grid>
<div style={{ backgroundColor: 'var(--spbSky0)', padding: '20px' }}> <Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card link={{ href: '#', target: '_blank' }} view="hover-shadow" title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} /> </GridColumn> </Grid> </div>
<Grid guttersLeft="medium" guttersBottom="medium"> <GridColumn all="4" tablet="6" mobile="12"> <Card isFullHeight title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий', position: 'bottom' }} textsList={textsList} price={{ value: '340 ₽', period: 'в месяц' }} button={{ title: 'Заказать', href: '#', target: '_blank' }} extraButton={{ title: 'Подробнее', href: '#' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card isFullHeight title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий', position: 'bottom' }} featuresList={featuresList} price={{ value: '340 ₽', period: 'в месяц' }} button={{ title: 'Заказать', href: '#', target: '_blank' }} extraButton={{ title: 'Подробнее', href: '#' }} /> </GridColumn> <GridColumn all="4" tablet="6" mobile="12"> <Card isFullHeight title={{ text: 'Сеть стоматологий', align: 'left' }} image={{ src: img.src, alt: 'Сеть стоматологий', position: 'bottom' }} iconsList={iconsList} price={{ value: '340 ₽', period: 'в месяц' }} button={{ title: 'Заказать', href: '#', target: '_blank' }} extraButton={{ title: 'Подробнее', href: '#' }} /> </GridColumn> </Grid>
Prop name | Type | Default | Description |
---|---|---|---|
dataAttrs | { root?: Record<string, string>; icon?: Record<string, string>; imgBox?: Record<string, string>; button?: Record<string, string>; extraButton?: Record<string, string>; } | Дополнительные data атрибуты к внутренним элементам | |
className | string | Дополнительный класс для компонента | |
classes | { root?: string; button?: string; extraButton?: string; } | Дополнительные классы для внутренних элементов | |
rootRef | Ref<HTMLDivElement | HTMLAnchorElement> | Ссылка на корневой элемент | |
isFullHeight | boolean | false | |
view | "shadow" | "hover-shadow" | "background" | shadow | Вид |
link | Link | Ссылка для карточки | |
image | Image | Изображение | |
icon | ReactNode | Иконка | |
title* | Title | Заголовок | |
markerList | MarkerList | Маркированный список | |
textsList | TextsList | Список текстов | |
featuresList | FeaturesList | Список характеристик | |
iconsList | IconsList | Список иконок | |
price | Price | Цена | |
button | MainButtonType | Кнопка | |
extraButton | ExtraButtonType | Дополнительная кнопка | |
badge | ReactElement<any, string | JSXElementConstructor<any>> | Бейдж | |
onClick | () => void | Обработчик клика по карточке |
type Target = '_self' | '_blank' | '_parent' | '_top';type Link = {/** Ссылка */href?: string;/** Target свойство ссылки */target?: Target;};type Image = {/** Ссылка на изображение */src: string;/** Значение тега alt для изображения */alt?: string;/** Позиция изображения */position?: 'top' | 'bottom';};type Title = {/** Текст */text: string;/** Выравнивание */align?: 'left' | 'center';};type MarkerList = {/** Заголовок */title: string;/** Примечание */note?: string;}[];type TextsList = {/** Заголовок */title?: string;/** Описание */desc: string;}[];type FeaturesList = {/** Список */items: {/** Заголовок */title: string;/** Значение */value: string;}[];/** Описание */desc?: string;};type IconsList = {/** Список */items: {/** Иконка */icon: React.ReactNode;/** Текст */text: string;}[];/** Описание */desc?: string;};type Price = {/** Старая цена */oldValue?: string;/** Текущая цена */value: string;/** Период */period?: string;};type ButtonType = {/** Название */title: string;/** Ссылка */href?: string;/** Target свойство кнопки */target?: Target;/** Центрировать кнопку */isCentered?: boolean;/** Обработчик клика по кнопке */onClick?: () => void;};type MainButtonType = ButtonType & {/** Тип кнопки */type?: 'primary' | 'outline';/** Тема кнопки */theme?: 'green' | 'green-soft';};type ExtraButtonType = ButtonType & {/** Тип кнопки */type?: 'outline' | 'text';};