Skip to main content

Card

TkCard component description.

import { TkCard } from '@takeoff-ui/react'

Basic​

A simple TkCard is created using the header property along with content as children.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!

View Code
<TkCard header="Card Title">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque
quas!
</p>
</TkCard>

Card with Content​

Customize the card's content using the content slot to place any desired elements inside the TkCard.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!

View Code
<TkCard header="Card Title">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque
quas!
</p>
</TkCard>

Header Variants​

Demonstrates various header types basic, divided, light, dark, primary available via the headerType property.

This card demonstrates different header options. Use the controls above to change the header type and toggle avatar and menu button visibility.

View Code

Card with Image​

Shows how to include images using the image property and configure their display with imageOptions.

Card with top image in windowed mode.

View Code
<TkCard
header="Top Image"
image="path/to/image.jpg"
imageOptions={{ position: 'top', windowed: true }}
containerStyle={{ width: '312px' }}
showAvatar
showMenuButton
>
<p>Card with top image in windowed mode.</p>
<div slot="footer-actions">
<TkButton label="Cancel" variant="neutral" type="text"></TkButton>
<TkButton label="Submit" variant="primary"></TkButton>
</div>
</TkCard>

Illustrates how to add a footer using the footer-actions slot or customize it with the footerType property.

This card demonstrates the use of a footer with action buttons.

View Code

API​

Props​

NameTypeDefaultDescription
any{ severity: 'light', background: 'solid', rounded: true, }TO DO State hata verdiği için buraya alındı, düzeltilecek TkAvatar component properties
anynullThe style attribute of container element
anynullThe style attribute of content element
booleanfalseControls whether the card shows a hover shadow effect
"basic", "divided", "light"'basic'The mode of the footer
stringnullThe header text
"bottom", "top"'top'The position of the header
"basic", "dark", "divided", "light", "primary"'basic'The type of the header
booleanfalseControls whether the header is hidden
booleanfalseControls whether the card is displayed horizontally
stringnullThe image source for the card
{ badge?: string; badgeIcon?: string; badgeIconPosition?: "left", "right"; windowed?: boolean; background?: boolean; backgroundUrl?: string; position?: "top", "left", "right", "background"; }{ position: 'top', background: false, windowed: true, }TO DO Options for the image display
booleanfalseControls whether the header avatar is shown
booleanfalseControls whether the menu button is shown
stringnullThe subheader text

Slots​

NameDescription
avatarCustom avatar template of card header.
contentCustom content template.
defaultDefault slot to detect child to inner body.
footerCustom footer template.
footer-actionsCustom actions template to default footer.
headerCustom header template.