Chip

PRO

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

Displays a chip or a component that looks like an chip.

Figma

The Chip component that can be used to display filters or categories.

1. Reference

This component inherits props from the Chip.

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

2. Amount

You can edit the amount with the true or false parameter

Image 2.1 : Amount false

Image 2.2 : Amount true

3. Size

You can edit the Size with the xs, md, lg paramenters.

Image 3.1 : Size lg

Image 3.2 : Size md

Image 3.3 : Size sm

4. State

You can edit the State with the default, active and disabled parameters.

Image 4.1 : State default

Image 4.2 : State active

Image 4.3 : State disabled

Jetpack Compose

The Chip component that can be used to display filters or categories.

1. Reference

This component inherits props from the Chip.

Prop
Type
Default
state
ChipState.default
ChipState.active
ChipState.disabled
ChipState.default
size
ChipSize.sm
ChipSize.md
ChipSize.lg
ChipSize.lg
title
"text"

-

count
"text"

-

2. State

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

Chip
Chip
10
Chip
Chip
Chip(
title = "Chip",
size = ChipSize.lg,
state = ChipState.default
)

Chip(
title = "Chip",
count = 10,
size = ChipSize.lg,
state = ChipState.default
)

Chip(
title = "Chip",
size = ChipSize.lg,
state = ChipState.disabled
)

Chip(
title = "Chip",
size = ChipSize.lg,
state = ChipState.active
)

3. Size

You can edit the size with the ChipSize.sm, ChipSize.md or ChipSize.lg parameter.

Chip
Chip
Chip
Chip(
title = "Chip",
size = ChipSize.lg,
state = ChipState.default
)

Chip(
title = "Chip",
size = ChipSize.md,
state = ChipState.default
)

Chip(
title = "Chip",
size = ChipSize.sm,
state = ChipState.default
)

Preview

Chip
Chip
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

Chip
Chip
Chip
Chip
Chip
Chip
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

Disabled

Chip
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