Card

PRO

You can edit 8 Components for free. Get premium for unlimited access.

Displays a card with header, content, and footer.

Figma

The Card component is used to group elements together and allows quick access to features.

1. Reference

This component inherits props from the Card.

Prop
Type
Default
state
default
active
disabled
default
size
md
lg
lg
description
true
false
true

2. Size

You can edit the size with the md or lg parameter.

Image 2.1 : Size md

Image 2.2 : Size lg

3. State

You can edit the state with the default, active or disabled parameter.

Image 3.1 : State default

Image 3.2 : State active

Image 3.3 : State disabled

4. Description

You can edit the description with the true or false parameter.

Image 4.1 : Description true

Image 4.2 : Description false

SwiftUI

The DLCard component is used to group elements together and allows quick access to features.

1. Reference

This component inherits props from the Card.

Prop
Type
Default
state
.normal
.disabled
.normal
size
.md
.lg
.lg
description
"text"

-

title
"text"

-

icon
"icon"

-

2. Size

You can edit the size with the .md or .lg parameter.

Title
Description
Title
Description
DLCard(
icon: "ic_Placeholder",
title: "Title",
description: "Description",
size: .lg,
state: .normal
)

DLCard(
icon: "ic_Placeholder",
title: "Title",
description: "Description",
size: .md,
state: .normal
)

3. State

You can edit the state with the .normal or .disabled parameter.

Title
Description
Title
Description
DLCard(
icon: "ic_Placeholder",
title: "Title",
description: "Description",
size: .lg,
state: .disabled
)

DLCard(
icon: "ic_Placeholder",
title: "Title",
description: "Description",
size: .md,
state: .disabled
)

Jetpack Compose

The Card component is used to group elements together and allows quick access to features.

1. Reference

This component inherits props from the Card.

Prop
Type
Default
state
CardState.default
CardState.disabled
CardState.default
size
CardSize.md
CardSize.lg
CardSize.lg
description
"text"

-

title
"text"

-

icon
"icon"

-

2. Size

You can edit the size with the CardSize.md or CardSize.lg parameter.

Title
Description
Title
Description
Card(
title = "Title",
description = "Description",
size = CardSize.lg,
icon = R.drawable.ic_crop,
state = CardState.default,
onClick = {}
)

Card(
title = "Title",
description = "Description",
size = CardSize.md,
icon = R.drawable.ic_crop,
state = CardState.default,
onClick = {}
)

3. State

You can edit the state with the CardState.default or CardState.disabled parameter.

Title
Description
Title
Description
Card(
title = "Title",
description = "Description",
size = CardSize.lg,
icon = R.drawable.ic_crop,
state = CardState.disabled,
onClick = {}
)

Card(
title = "Title",
description = "Description",
size = CardSize.md,
icon = R.drawable.ic_crop,
state = CardState.disabled,
onClick = {}
)

Preview

Title
Description
import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "@/components/ui/avatar"

export function AvatarDemo() {
  return (
    <div className="flex flex-row flex-wrap items-center gap-12">
      <Avatar>
        <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
        <AvatarFallback>CN</AvatarFallback>
      </Avatar>
      <Avatar className="rounded-lg">
        <AvatarImage
          src="https://github.com/evilrabbit.png"
          alt="@evilrabbit"
        />
        <AvatarFallback>ER</AvatarFallback>
      </Avatar>
      <div className="*:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:grayscale">
        <Avatar>
          <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
          <AvatarFallback>CN</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage src="https://github.com/leerob.png" alt="@leerob" />
          <AvatarFallback>LR</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage
            src="https://github.com/evilrabbit.png"
            alt="@evilrabbit"
          />
          <AvatarFallback>ER</AvatarFallback>
        </Avatar>
      </div>
    </div>
  )
}
Copy

Installation

Use this command to install the component in your project.

pnpm dlx shadcn@latest add alert
Copy

Usage

Add this code example to your project to see how the component works.

import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
Copy
<Alert variant="default | destructive">
  <Terminal />
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>
    You can add components and dependencies to your app using the cli.
  </AlertDescription>
</Alert>
Copy

Examples

Size

Title
Description
Title
Description
import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "@/components/ui/avatar"

export function AvatarDemo() {
  return (
    <div className="flex flex-row flex-wrap items-center gap-12">
      <Avatar>
        <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
        <AvatarFallback>CN</AvatarFallback>
      </Avatar>
      <Avatar className="rounded-lg">
        <AvatarImage
          src="https://github.com/evilrabbit.png"
          alt="@evilrabbit"
        />
        <AvatarFallback>ER</AvatarFallback>
      </Avatar>
      <div className="*:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:grayscale">
        <Avatar>
          <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
          <AvatarFallback>CN</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage src="https://github.com/leerob.png" alt="@leerob" />
          <AvatarFallback>LR</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage
            src="https://github.com/evilrabbit.png"
            alt="@evilrabbit"
          />
          <AvatarFallback>ER</AvatarFallback>
        </Avatar>
      </div>
    </div>
  )
}
Copy

State

Title
Description
Title
Description
Title
Description
import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "@/components/ui/avatar"

export function AvatarDemo() {
  return (
    <div className="flex flex-row flex-wrap items-center gap-12">
      <Avatar>
        <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
        <AvatarFallback>CN</AvatarFallback>
      </Avatar>
      <Avatar className="rounded-lg">
        <AvatarImage
          src="https://github.com/evilrabbit.png"
          alt="@evilrabbit"
        />
        <AvatarFallback>ER</AvatarFallback>
      </Avatar>
      <div className="*:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:grayscale">
        <Avatar>
          <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
          <AvatarFallback>CN</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage src="https://github.com/leerob.png" alt="@leerob" />
          <AvatarFallback>LR</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage
            src="https://github.com/evilrabbit.png"
            alt="@evilrabbit"
          />
          <AvatarFallback>ER</AvatarFallback>
        </Avatar>
      </div>
    </div>
  )
}
Copy

Without Description

Title
Description
Title
import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "@/components/ui/avatar"

export function AvatarDemo() {
  return (
    <div className="flex flex-row flex-wrap items-center gap-12">
      <Avatar>
        <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
        <AvatarFallback>CN</AvatarFallback>
      </Avatar>
      <Avatar className="rounded-lg">
        <AvatarImage
          src="https://github.com/evilrabbit.png"
          alt="@evilrabbit"
        />
        <AvatarFallback>ER</AvatarFallback>
      </Avatar>
      <div className="*:data-[slot=avatar]:ring-background flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:grayscale">
        <Avatar>
          <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
          <AvatarFallback>CN</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage src="https://github.com/leerob.png" alt="@leerob" />
          <AvatarFallback>LR</AvatarFallback>
        </Avatar>
        <Avatar>
          <AvatarImage
            src="https://github.com/evilrabbit.png"
            alt="@evilrabbit"
          />
          <AvatarFallback>ER</AvatarFallback>
        </Avatar>
      </div>
    </div>
  )
}
Copy

Discover more content

You have questions or need help?

E-Mail

You want to try?

Test for free

Save time and money?

Get Pro Version